46 return ISC_R_NOMEMORY;
49 aptr -> deref = deref;
59 if (!array || !*array)
62 for (i = 0; i < aptr -> count; i++)
63 if (aptr -> data [i] && aptr -> deref)
64 (*aptr -> deref) (&aptr -> data [i],
file,
line);
75 int *index,
const char *
file,
int line)
78 int new = array -> count;
103 if (array -> max <= index) {
104 delta = index - array -> max + 10;
105 newbuf =
dmalloc ((array -> max + delta) *
sizeof (
char *),
108 return ISC_R_NOMEMORY;
110 memset (&newbuf [array -> max], 0, (
sizeof (
char *)) * delta);
111 array -> max += delta;
115 array -> data, array -> count *
sizeof (
char *));
118 array -> data = newbuf;
122 if (array -> data [index]) {
123 status = ((*array -> deref) (&array -> data [index],
136 status = (*array -> ref) (&array -> data [index], ptr,
141 if (index >= array -> count)
142 array -> count = index + 1;
149 if (!array || !ptr || *ptr || index < 0 || index >= array -> count)
151 if (array -> data [index])
152 return (*array -> ref) (ptr,
154 return ISC_R_NOTFOUND;
isc_result_t omapi_array_lookup(char **ptr, omapi_array_t *array, int index, const char *file, int line)
isc_result_t omapi_array_set(omapi_array_t *array, void *ptr, int index, const char *file, int line)
isc_result_t omapi_array_allocate(omapi_array_t **array, omapi_array_ref_t ref, omapi_array_deref_t deref, const char *file, int line)
isc_result_t omapi_array_free(omapi_array_t **array, const char *file, int line)
isc_result_t omapi_array_extend(omapi_array_t *array, char *ptr, int *index, const char *file, int line)
isc_result_t(* omapi_array_deref_t)(char **, const char *, int)
void * dmalloc(size_t, const char *, int)
void dfree(void *, const char *, int)
isc_result_t(* omapi_array_ref_t)(char **, char *, const char *, int)
#define DHCP_R_INVALIDARG