dynarray.c
int dynarray_push(Dynarray *hdr, void *item) {
    if(hdr->used == hdr->nmemb) {
        if(!dynarray_resize(hdr, hdr->nmemb * 2))
            return 0;
    }
    hdr->ary[hdr->used] = item;
    hdr->used++;
    return 1;
}
//==============================================================================
// Pushes a new item onto the array, resizing by 2x as needed. Returns 0 on
// memory allocation failure, 1 on success.
//==============================================================================
Pushes a new item onto the array, resizing by 2x as needed. Returns 0 on
memory allocation failure, 1 on success.
Pushes a new item onto the array resizing by 2x as needed . Returns 0 on memory allocation failure 1 on success .
int dynarray_push(Dynarray *hdr, void *item) {
    if(hdr->used == hdr->nmemb) {
        if(!dynarray_resize(hdr, hdr->nmemb * 2))
            return 0;
    }
    hdr->ary[hdr->used] = item;
    hdr->used++;
    return 1;
}
int dynarray_push ( Dynarray * hdr , void * item ) { if ( hdr -> used == hdr -> nmemb ) { if ( ! dynarray_resize ( hdr , hdr -> nmemb * 2 ) ) return 0 ; } hdr -> ary [ hdr -> used ] = item ; hdr -> used ++ ; return 1 ; }
Pushes a new item onto the array, resizing by 2x as needed.
Pushes a new item onto the array resizing by 2x as needed .