Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 1 | /** |
Jeff Thompson | 7687dc0 | 2013-09-13 11:54:07 -0700 | [diff] [blame] | 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NDN_NDN_REALLOC_H |
Jeff Thompson | a0d18c9 | 2013-08-06 13:55:32 -0700 | [diff] [blame] | 8 | #define NDN_NDN_REALLOC_H |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 9 | |
Jeff Thompson | 10ad12a | 2013-09-24 16:19:11 -0700 | [diff] [blame] | 10 | #include "dynamic-uint8-array.h" |
Jeff Thompson | 9254d74 | 2013-08-12 12:04:44 -0700 | [diff] [blame] | 11 | |
Jeff Thompson | a0d18c9 | 2013-08-06 13:55:32 -0700 | [diff] [blame] | 12 | #ifdef __cplusplus |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 13 | extern "C" { |
| 14 | #endif |
| 15 | |
| 16 | /** |
Jeff Thompson | 10ad12a | 2013-09-24 16:19:11 -0700 | [diff] [blame] | 17 | * Wrap the C stdlib realloc to convert to/from void * to uint8_t *. |
| 18 | * This can be used by ndn_DynamicUInt8Array_initialize. |
Jeff Thompson | 9254d74 | 2013-08-12 12:04:44 -0700 | [diff] [blame] | 19 | * @param self This is ignored. |
| 20 | * @param array the allocated array buffer to realloc. |
| 21 | * @param length the length for the new array buffer. |
| 22 | * @return the new allocated array buffer. |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 23 | */ |
Jeff Thompson | 97223af | 2013-09-24 17:01:27 -0700 | [diff] [blame] | 24 | uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length); |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 25 | |
Jeff Thompson | a0d18c9 | 2013-08-06 13:55:32 -0700 | [diff] [blame] | 26 | #ifdef __cplusplus |
Jeff Thompson | 4554509 | 2013-07-16 18:36:26 -0700 | [diff] [blame] | 27 | } |
| 28 | #endif |
| 29 | |
| 30 | #endif |