modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / lib / uthash / libut / tests / test14.c
blobe442624bc5ffeee69bde5bfaf1b4e3dbc26474b2
1 #include <stdio.h>
2 #include "utvector.h"
4 int main() {
5 int i,*p=NULL;
6 UT_vector v;
7 utvector_init(&v, utmm_int);
8 for(i=0; i<16; i++) utvector_push(&v, &i);
10 p=NULL; while ( (p=(int*)utvector_next(&v,p))) printf("%d\n",*p);
13 p = (int*)utvector_head(&v);
14 printf("head: (%s) %d\n", p?"non-null":"null", p?*p:0);
16 p = (int*)utvector_tail(&v);
17 printf("tail: (%s) %d\n", p?"non-null":"null", p?*p:0);
19 printf("len: %d\n", utvector_len(&v));
20 printf("shift\n");
21 utvector_shift(&v);
22 printf("len: %d\n", utvector_len(&v));
24 p = (int*)utvector_head(&v);
25 printf("head: (%s) %d\n", p?"non-null":"null", p?*p:0);
27 printf("clear\n");
28 utvector_clear(&v);
29 printf("len: %d\n", utvector_len(&v));
31 utvector_fini(&v);
32 return 0;