modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / lib / uthash / libut / tests / test9.c
blob74e8d6a70100b0bf628a5cd08b95fbcc29027ba8
1 #include <stdio.h>
2 #include "libut.h"
4 void dump(UT_vector *v) {
5 printf("len: %d\n", utvector_len(v));
6 UT_string *p=NULL;
7 while ( (p=(UT_string*)utvector_next(v,p))) printf("%s\n",utstring_body(p));
10 int main() {
11 int i;
12 UT_string *t;
13 UT_vector v; utvector_init(&v, utstring_mm);
14 UT_string s; utstring_init(&s);
16 for(i=0; i<16; i++) {
17 utstring_printf(&s, ".");
18 utvector_push(&v, &s);
20 dump(&v);
22 printf("extend\n");
23 t = (UT_string*)utvector_extend(&v);
24 utstring_bincpy(t, "hello", 5);
25 dump(&v);
27 utvector_fini(&v);
28 utstring_done(&s);
29 return 0;