diff --git a/.gitignore b/.gitignore index 62aaa6a..9efe977 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.o +libbubulles.a tbb gmon.out dummy-file diff --git a/Makefile b/Makefile index 3b46311..54ca637 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CC = gcc -OPT = -Wall -g -DDEBUG_LEVEL=1 -DMUST_ABORT +OPT = -Wall -g -DDEBUG_LEVEL=0 -DMUST_ABORT CC = gcc libbubulles.a: bubulles.o diff --git a/bubulles.c b/bubulles.c index 8b09c87..b988627 100644 --- a/bubulles.c +++ b/bubulles.c @@ -286,6 +286,9 @@ what->fidx = what->size - 1; return 0; } /* --------------------------------------------------------------------- */ +/* + * this is the WTF function * see tbb.c + */ int bubulles_to_data(char *fname, char *title, BBList *bbl, int k) { FILE *fp; diff --git a/bubulles.h b/bubulles.h index 40765ed..0921bc0 100644 --- a/bubulles.h +++ b/bubulles.h @@ -4,7 +4,7 @@ /* --------------------------------------------------------------------- */ -#define LIBBB_VERSION 50 +#define LIBBB_VERSION 51 #define SZ_BUBULLE_TEXT 51 /* arbitrary value */ @@ -59,8 +59,23 @@ void bubulles_sizeof(int k); Bubulle * bubulle_getaddr(BBList *where, int idx); -int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int k); +/* + * export functions + */ + +/* + * export Awk machinable. + * flags : + * 0x0001 print diameter + * 0x0002 print graylevel + * 0x0004 print RGB values + */ +int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int flags); + +/* only human readable */ int niceprint_bubulle(Bubulle *what, int unused); + +/* this is just a wtf function * see tbb.c */ int bubulles_to_data(char *fname, char *title, BBList *bbl, int k); /* --------------------------------------------------------------------- */ diff --git a/tbb.c b/tbb.c index 115d7b5..339bcaf 100644 --- a/tbb.c +++ b/tbb.c @@ -84,7 +84,7 @@ foo = peek_bubulle(bublist, &bubulle, in); fprintf(stderr, "peek 1 -> %7d\n", foo); foo = niceprint_bubulle(&bubulle, 0); -fprintf(stderr, "niceprint -> %7d\n", foo); +if (foo) fprintf(stderr, "niceprint -> %d\n", foo); foo = peek_bubulle(bublist, &bubulle, out); fprintf(stderr, "peek 2 -> %7d\n", foo); @@ -97,7 +97,7 @@ foo = peek_bubulle(bublist, &bubulle, in); fprintf(stderr, "peek 3 -> %7d\n", foo); foo = niceprint_bubulle(&bubulle, 0); -fprintf(stderr, "niceprint -> %7d\n", foo); +if (foo) fprintf(stderr, "niceprint -> %d\n", foo); free_bubulles(bublist, 0);