This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | vec |
Defines | |
| #define | GROWTHFACTOR 2 |
| #define | VEC_DELETE_INPLACE(vec) free((vec)->vector) |
| #define | VEC_LENGTH(vec) ((vec)->len) |
| #define | VEC_ERR(vec) ((vec)->err) |
Functions | |
| int | vec_init_inplace (unsigned long int initsize, struct vec *vec) |
| int | vec_read_inplace (int srcfd, struct vec *vec, unsigned int size) |
| int | vec_expand (struct vec *vec, unsigned int size) |
| #define GROWTHFACTOR 2 |
| int vec_expand | ( | struct vec * | vec, | |
| unsigned int | size | |||
| ) |
Definition at line 189 of file vec.c.
References vec::err, vec::size, and vec::vector.
Referenced by vec_append(), and vec_putvbyte().
00189 { 00190 /* grow the buffer (+ 1 is to step around case where size is 0) */ 00191 void* newmem = realloc(v->vector, size); 00192 00193 if (newmem) { 00194 v->size = size; 00195 v->vector = newmem; 00196 return 1; 00197 } else { 00198 v->err = ENOMEM; 00199 return 0; 00200 } 00201 }
Here is the caller graph for this function:

| int vec_init_inplace | ( | unsigned long int | initsize, | |
| struct vec * | vec | |||
| ) |
| int vec_read_inplace | ( | int | srcfd, | |
| struct vec * | vec, | |||
| unsigned int | size | |||
| ) |
Definition at line 236 of file vec.c.
References vec::err, vec::len, vec::pos, vec::size, and vec::vector.
Referenced by vec_read().
00236 { 00237 if ((v->vector = malloc(len))) { 00238 unsigned int rlen; 00239 char *dst = v->vector; 00240 unsigned int size = len; 00241 00242 while (len && ((rlen = read(srcfd, dst, len)) > 0)) { 00243 len -= rlen; 00244 dst += rlen; 00245 } 00246 00247 if (!len) { 00248 v->len = v->size = size; 00249 v->pos = 0; 00250 v->err = 0; 00251 return 1; 00252 } else { 00253 free(v->vector); 00254 return 0; 00255 } 00256 } else { 00257 return 0; 00258 } 00259 }
Here is the caller graph for this function:

1.5.2