diff --git a/bubulles.c b/bubulles.c index 873c940..129c49d 100644 --- a/bubulles.c +++ b/bubulles.c @@ -112,14 +112,14 @@ return ( &where->bbs[idx] ); } /* --------------------------------------------------------------------- */ -int print_bublist_desc(BBList *bbl, int flags) +int print_bublist_desc(BBList *bbl, int opts) { printf("------- bblist at %p\n", bbl); printf("\tname \t'%s'\n", bbl->name); printf("\tsize\t%6d\n\tfidx\t%6d\n", bbl->size, bbl->fidx); -if (flags & 0x01) { +if (opts & 0x01) { printf("\txyz\t%f %f %f\n", bbl->position.x, bbl->position.y, bbl->position.z); } @@ -207,7 +207,7 @@ return 0; * 0x0001 print diameter * 0x0002 print graylevel */ -int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int flags) +int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int opts) { int idx; Bubulle *ar; @@ -230,8 +230,8 @@ for (idx=0; idxfidx; idx++) { fprintf(fp, "%12.6f %12.6f %12.6f", ar[idx].p.x, ar[idx].p.y, ar[idx].p.z); - if (flags & 0x01) fprintf(fp, " %12.6f", ar[idx].d); - if (flags & 0x02) fprintf(fp, " %6d", ar[idx].gray); + if (opts & 0x01) fprintf(fp, " %12.6f", ar[idx].d); + if (opts & 0x02) fprintf(fp, " %6d", ar[idx].gray); fputs("\n", fp); } diff --git a/bubulles.h b/bubulles.h index 89e99b7..eb41a68 100644 --- a/bubulles.h +++ b/bubulles.h @@ -20,6 +20,10 @@ typedef struct { unsigned long reserved; } RGBA; +/* + this is our main entity : the bubulle. + 'bubulle' is a slang french word for 'friendly bubble'. +*/ typedef struct { XYZ p; /* position */ double d; /* diameter */ @@ -29,15 +33,19 @@ typedef struct { double kvalue; /* wtf ? */ } Bubulle; +/* + this is the bubulles list descriptor. +*/ typedef struct { char name[SZ_BUBULLE_TEXT+1]; int size; /* max number of bubulles */ int fidx; /* next free slot */ - XYZ position; + XYZ position; /* global position */ unsigned long flags; - Bubulle *bbs; + Bubulle *bbs; /* ptr to a movable array */ } BBList; + BBList * alloc_bubulles(char *name, int nbre, int k); int free_bubulles(BBList *bbl, int k); int print_bublist_desc(BBList *bbl, int k); diff --git a/tbb.c b/tbb.c index 388ebcd..d3f7be6 100644 --- a/tbb.c +++ b/tbb.c @@ -119,10 +119,9 @@ int foo; printf("*** Bubulles Testing -- %s %s\n\n", __DATE__, __TIME__); bubulles_version(1); -print_sizeof(); test_alloc_free(5); -test_push_pop(2000); +test_push_pop(20000); test_cleanfill_my_bublist(999); foo = test_peek_poke(5000);