blob: 148fc2ca612b0ad0cde0dcedcca04b946c02392f [file] [log] [blame]
Jeff Thompson45545092013-07-16 18:36:26 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
4 */
5
6#ifndef NDN_NDN_REALLOC_H
Jeff Thompsona0d18c92013-08-06 13:55:32 -07007#define NDN_NDN_REALLOC_H
Jeff Thompson45545092013-07-16 18:36:26 -07008
Jeff Thompson9254d742013-08-12 12:04:44 -07009#include "dynamic-uchar-array.h"
10
Jeff Thompsona0d18c92013-08-06 13:55:32 -070011#ifdef __cplusplus
Jeff Thompson45545092013-07-16 18:36:26 -070012extern "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 Thompson9254d742013-08-12 12:04:44 -070018 * @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 Thompson45545092013-07-16 18:36:26 -070022 */
Jeff Thompson9254d742013-08-12 12:04:44 -070023unsigned char *ndn_realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length);
Jeff Thompson45545092013-07-16 18:36:26 -070024
Jeff Thompsona0d18c92013-08-06 13:55:32 -070025#ifdef __cplusplus
Jeff Thompson45545092013-07-16 18:36:26 -070026}
27#endif
28
29#endif