ソースの整理中ですが、利用はできます。 大きなファイルはできないかもしれません。

Dependencies:   EthernetInterface HttpServer TextLCD expatlib mbed-rpc mbed-rtos mbed Socket lwip-eth lwip-sys lwip

Fork of giken9_HTMLServer_Sample by Yasushi TAUCHI

Committer:
yueee_yt
Date:
Wed Mar 12 04:19:54 2014 +0000
Revision:
0:7766f6712673
???????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yueee_yt 0:7766f6712673 1 /*
yueee_yt 0:7766f6712673 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
yueee_yt 0:7766f6712673 3 * All rights reserved.
yueee_yt 0:7766f6712673 4 *
yueee_yt 0:7766f6712673 5 * Redistribution and use in source and binary forms, with or without modification,
yueee_yt 0:7766f6712673 6 * are permitted provided that the following conditions are met:
yueee_yt 0:7766f6712673 7 *
yueee_yt 0:7766f6712673 8 * 1. Redistributions of source code must retain the above copyright notice,
yueee_yt 0:7766f6712673 9 * this list of conditions and the following disclaimer.
yueee_yt 0:7766f6712673 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
yueee_yt 0:7766f6712673 11 * this list of conditions and the following disclaimer in the documentation
yueee_yt 0:7766f6712673 12 * and/or other materials provided with the distribution.
yueee_yt 0:7766f6712673 13 * 3. The name of the author may not be used to endorse or promote products
yueee_yt 0:7766f6712673 14 * derived from this software without specific prior written permission.
yueee_yt 0:7766f6712673 15 *
yueee_yt 0:7766f6712673 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
yueee_yt 0:7766f6712673 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
yueee_yt 0:7766f6712673 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
yueee_yt 0:7766f6712673 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
yueee_yt 0:7766f6712673 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
yueee_yt 0:7766f6712673 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
yueee_yt 0:7766f6712673 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
yueee_yt 0:7766f6712673 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
yueee_yt 0:7766f6712673 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
yueee_yt 0:7766f6712673 25 * OF SUCH DAMAGE.
yueee_yt 0:7766f6712673 26 *
yueee_yt 0:7766f6712673 27 * This file is part of the lwIP TCP/IP stack.
yueee_yt 0:7766f6712673 28 *
yueee_yt 0:7766f6712673 29 * Author: Adam Dunkels <adam@sics.se>
yueee_yt 0:7766f6712673 30 *
yueee_yt 0:7766f6712673 31 */
yueee_yt 0:7766f6712673 32
yueee_yt 0:7766f6712673 33 #ifndef __LWIP_MEMP_H__
yueee_yt 0:7766f6712673 34 #define __LWIP_MEMP_H__
yueee_yt 0:7766f6712673 35
yueee_yt 0:7766f6712673 36 #include "lwip/opt.h"
yueee_yt 0:7766f6712673 37
yueee_yt 0:7766f6712673 38 #ifdef __cplusplus
yueee_yt 0:7766f6712673 39 extern "C" {
yueee_yt 0:7766f6712673 40 #endif
yueee_yt 0:7766f6712673 41
yueee_yt 0:7766f6712673 42 /* Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */
yueee_yt 0:7766f6712673 43 typedef enum {
yueee_yt 0:7766f6712673 44 #define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
yueee_yt 0:7766f6712673 45 #include "lwip/memp_std.h"
yueee_yt 0:7766f6712673 46 MEMP_MAX
yueee_yt 0:7766f6712673 47 } memp_t;
yueee_yt 0:7766f6712673 48
yueee_yt 0:7766f6712673 49 #if MEM_USE_POOLS
yueee_yt 0:7766f6712673 50 /* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */
yueee_yt 0:7766f6712673 51 typedef enum {
yueee_yt 0:7766f6712673 52 /* Get the first (via:
yueee_yt 0:7766f6712673 53 MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/
yueee_yt 0:7766f6712673 54 MEMP_POOL_HELPER_FIRST = ((u8_t)
yueee_yt 0:7766f6712673 55 #define LWIP_MEMPOOL(name,num,size,desc)
yueee_yt 0:7766f6712673 56 #define LWIP_MALLOC_MEMPOOL_START 1
yueee_yt 0:7766f6712673 57 #define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
yueee_yt 0:7766f6712673 58 #define LWIP_MALLOC_MEMPOOL_END
yueee_yt 0:7766f6712673 59 #include "lwip/memp_std.h"
yueee_yt 0:7766f6712673 60 ) ,
yueee_yt 0:7766f6712673 61 /* Get the last (via:
yueee_yt 0:7766f6712673 62 MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */
yueee_yt 0:7766f6712673 63 MEMP_POOL_HELPER_LAST = ((u8_t)
yueee_yt 0:7766f6712673 64 #define LWIP_MEMPOOL(name,num,size,desc)
yueee_yt 0:7766f6712673 65 #define LWIP_MALLOC_MEMPOOL_START
yueee_yt 0:7766f6712673 66 #define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
yueee_yt 0:7766f6712673 67 #define LWIP_MALLOC_MEMPOOL_END 1
yueee_yt 0:7766f6712673 68 #include "lwip/memp_std.h"
yueee_yt 0:7766f6712673 69 )
yueee_yt 0:7766f6712673 70 } memp_pool_helper_t;
yueee_yt 0:7766f6712673 71
yueee_yt 0:7766f6712673 72 /* The actual start and stop values are here (cast them over)
yueee_yt 0:7766f6712673 73 We use this helper type and these defines so we can avoid using const memp_t values */
yueee_yt 0:7766f6712673 74 #define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST)
yueee_yt 0:7766f6712673 75 #define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST)
yueee_yt 0:7766f6712673 76 #endif /* MEM_USE_POOLS */
yueee_yt 0:7766f6712673 77
yueee_yt 0:7766f6712673 78 #if MEMP_MEM_MALLOC || MEM_USE_POOLS
yueee_yt 0:7766f6712673 79 extern const u16_t memp_sizes[MEMP_MAX];
yueee_yt 0:7766f6712673 80 #endif /* MEMP_MEM_MALLOC || MEM_USE_POOLS */
yueee_yt 0:7766f6712673 81
yueee_yt 0:7766f6712673 82 #if MEMP_MEM_MALLOC
yueee_yt 0:7766f6712673 83
yueee_yt 0:7766f6712673 84 #include "mem.h"
yueee_yt 0:7766f6712673 85
yueee_yt 0:7766f6712673 86 #define memp_init()
yueee_yt 0:7766f6712673 87 #define memp_malloc(type) mem_malloc(memp_sizes[type])
yueee_yt 0:7766f6712673 88 #define memp_free(type, mem) mem_free(mem)
yueee_yt 0:7766f6712673 89
yueee_yt 0:7766f6712673 90 #else /* MEMP_MEM_MALLOC */
yueee_yt 0:7766f6712673 91
yueee_yt 0:7766f6712673 92 #if MEM_USE_POOLS
yueee_yt 0:7766f6712673 93 /** This structure is used to save the pool one element came from. */
yueee_yt 0:7766f6712673 94 struct memp_malloc_helper
yueee_yt 0:7766f6712673 95 {
yueee_yt 0:7766f6712673 96 memp_t poolnr;
yueee_yt 0:7766f6712673 97 };
yueee_yt 0:7766f6712673 98 #endif /* MEM_USE_POOLS */
yueee_yt 0:7766f6712673 99
yueee_yt 0:7766f6712673 100 void memp_init(void);
yueee_yt 0:7766f6712673 101
yueee_yt 0:7766f6712673 102 #if MEMP_OVERFLOW_CHECK
yueee_yt 0:7766f6712673 103 void *memp_malloc_fn(memp_t type, const char* file, const int line);
yueee_yt 0:7766f6712673 104 #define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
yueee_yt 0:7766f6712673 105 #else
yueee_yt 0:7766f6712673 106 void *memp_malloc(memp_t type);
yueee_yt 0:7766f6712673 107 #endif
yueee_yt 0:7766f6712673 108 void memp_free(memp_t type, void *mem);
yueee_yt 0:7766f6712673 109
yueee_yt 0:7766f6712673 110 #endif /* MEMP_MEM_MALLOC */
yueee_yt 0:7766f6712673 111
yueee_yt 0:7766f6712673 112 #ifdef __cplusplus
yueee_yt 0:7766f6712673 113 }
yueee_yt 0:7766f6712673 114 #endif
yueee_yt 0:7766f6712673 115
yueee_yt 0:7766f6712673 116 #endif /* __LWIP_MEMP_H__ */