modified: diffout.py
[GalaxyCodeBases.git] / c_cpp / lib / uthash / libut / tests / test7.c
blobecd7abfd83e9ed5ebc0999bc8cf51f757389863b
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_vector v; utvector_init(&v, utstring_mm);
13 UT_vector *k;
15 UT_string s; utstring_init(&s);
16 for(i=0; i<10; i++) {
17 utstring_printf(&s, ".");
18 utvector_push(&v, &s);
20 dump(&v);
22 printf("clone\n");
23 k = utvector_clone(&v);
24 dump(k);
26 utvector_fini(&v);
27 utvector_free(k);
28 utstring_done(&s);
29 return 0;