Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @author: Jeff Thompson |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #ifndef NDN_NDN_REALLOC_H |
Jeff Thompson | a0d18c9 | 2013-08-06 13:55:32 -0700 | [diff] [blame] | 7 | #define NDN_NDN_REALLOC_H |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 8 | |
Jeff Thompson | 9254d74 | 2013-08-12 12:04:44 -0700 | [diff] [blame] | 9 | #include "dynamic-uchar-array.h" |
| 10 | |
Jeff Thompson | a0d18c9 | 2013-08-06 13:55:32 -0700 | [diff] [blame] | 11 | #ifdef __cplusplus |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | /** |
| 16 | * Wrap the C stdlib realloc to convert to/from void * to unsigned char *. |
| 17 | * This can be used by ndn_DynamicUCharArray_init. |
Jeff Thompson | 9254d74 | 2013-08-12 12:04:44 -0700 | [diff] [blame] | 18 | * @param self This is ignored. |
| 19 | * @param array the allocated array buffer to realloc. |
| 20 | * @param length the length for the new array buffer. |
| 21 | * @return the new allocated array buffer. |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 22 | */ |
Jeff Thompson | 9254d74 | 2013-08-12 12:04:44 -0700 | [diff] [blame] | 23 | unsigned char *ndn_realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length); |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 24 | |
Jeff Thompson | a0d18c9 | 2013-08-06 13:55:32 -0700 | [diff] [blame] | 25 | #ifdef __cplusplus |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 26 | } |
| 27 | #endif |
| 28 | |
| 29 | #endif |