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