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