diff options
author | axel <axel@liljencrantz.se> | 2005-10-04 23:43:26 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-10-04 23:43:26 +1000 |
commit | efea4a6586d1b7406beea95ddfc7894cf0e13e72 (patch) | |
tree | 0d7f05366ca5e14c9fc74da5b27efc3c63d017a7 /util.c | |
parent | 9bcbc8f776ea637e411f3aeb122df01a4192c984 (diff) |
Add shortcut function for creating an array_list_t on the heap
darcs-hash:20051004134326-ac50b-91d5006f218f2f9370d239b38d8e88eddc7c0b96.gz
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -616,6 +616,16 @@ void pq_destroy( priority_queue_t *q ) } +array_list_t *al_new() +{ + array_list_t *res = malloc( sizeof( array_list_t ) ); + if( !res ) + die_mem(); + al_init( res ); + return res; +} + + void al_init( array_list_t *l ) { memset( l, 0, sizeof( array_list_t ) ); |