blob: 07dd053d5894fcdcd6f210e524326e3183123ec9 [file] [log] [blame]
Jeff Thompson45545092013-07-16 18:36:26 -07001/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07002 * Copyright (C) 2013 Regents of the University of California.
3 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson45545092013-07-16 18:36:26 -07004 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NDN_NDN_REALLOC_H
Jeff Thompsona0d18c92013-08-06 13:55:32 -07008#define NDN_NDN_REALLOC_H
Jeff Thompson45545092013-07-16 18:36:26 -07009
Jeff Thompson9254d742013-08-12 12:04:44 -070010#include "dynamic-uchar-array.h"
11
Jeff Thompsona0d18c92013-08-06 13:55:32 -070012#ifdef __cplusplus
Jeff Thompson45545092013-07-16 18:36:26 -070013extern "C" {
14#endif
15
16/**
17 * Wrap the C stdlib realloc to convert to/from void * to unsigned char *.
Jeff Thompsond1427fb2013-08-29 17:20:32 -070018 * This can be used by ndn_DynamicUCharArray_initialize.
Jeff Thompson9254d742013-08-12 12:04:44 -070019 * @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 Thompson45545092013-07-16 18:36:26 -070023 */
Jeff Thompson9254d742013-08-12 12:04:44 -070024unsigned char *ndn_realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length);
Jeff Thompson45545092013-07-16 18:36:26 -070025
Jeff Thompsona0d18c92013-08-06 13:55:32 -070026#ifdef __cplusplus
Jeff Thompson45545092013-07-16 18:36:26 -070027}
28#endif
29
30#endif