diff --git a/.gitignore b/.gitignore index 2ea0f84..e537f15 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ dummy-file tools/*.obj tools/read_obj tools/*.xyz +tools/*.asc diff --git a/bubulles.c b/bubulles.c index d74f9c3..29cb3bc 100644 --- a/bubulles.c +++ b/bubulles.c @@ -9,6 +9,7 @@ #include #include "bubulles.h" +#include "edges.h" /* --------------------------------------------------------------------- */ @@ -32,6 +33,8 @@ printf("%-15s %4lu\n", "XYZ", sizeof(XYZ)); printf("%-15s %4lu\n", "RGBA", sizeof(RGBA)); printf("%-15s %4lu\n", "Bubulle", sizeof(Bubulle)); printf("%-15s %4lu\n", "BBList", sizeof(BBList)); +printf("%-15s %4lu\n", "AnEdge", sizeof(AnEdge)); +printf("%-15s %4lu\n", "EdgeList", sizeof(EdgeList)); puts(""); } diff --git a/bubulles.h b/bubulles.h index bd1de60..cb175cf 100644 --- a/bubulles.h +++ b/bubulles.h @@ -4,7 +4,7 @@ /* --------------------------------------------------------------------- */ -#define LIBBB_VERSION 59 +#define LIBBB_VERSION 60 #define SZ_BUBULLE_TEXT 81 /* arbitrary value */ diff --git a/edges.c b/edges.c index a1171ac..3ee8758 100644 --- a/edges.c +++ b/edges.c @@ -4,8 +4,20 @@ #include +#include "bubulles.h" #include "edges.h" /* --------------------------------------------------------------------- */ +int print_edgelist_desc(EdgeList *list, int k) +{ +printf("edgelist addr: %p\n", list); +if (k) { + fprintf(stderr, "%s: k must be 0, was %d\n", __func__, k); + return k; + } + +return 0; +} +/* --------------------------------------------------------------------- */ diff --git a/edges.h b/edges.h index d6ca827..0a25548 100644 --- a/edges.h +++ b/edges.h @@ -3,3 +3,17 @@ */ /* --------------------------------------------------------------------- */ + +typedef struct { + int A, B; + } AnEdge; + +typedef struct { + char name[SZ_BUBULLE_TEXT+1]; + int size; /* max number of edges */ + int fidx; /* next free slot */ + AnEdge *edges; + unsigned long flags; + } EdgeList; + +/* --------------------------------------------------------------------- */ diff --git a/tools/importobj.c b/tools/importobj.c index e8bd662..f191007 100644 --- a/tools/importobj.c +++ b/tools/importobj.c @@ -89,7 +89,7 @@ if (NULL==(fpin=fopen(infname, "r"))) { exit(1); } -bublist = alloc_bubulles(infname, 150000, 0); +bublist = alloc_bubulles(infname, 800000, 0); if (NULL==bublist) { fprintf(stderr, "err in %s, aborting...\n", __func__); abort(); @@ -100,8 +100,10 @@ nbre = 0; while(NULL!=(cptr=fgets(line, LINE_SZ, fpin))) { if ('\n' != line[strlen(line)-1]) { - fprintf(stderr, "%s: short read, exiting...\n", __func__); - return -2; + fprintf(stderr, "%s: short read on %s...\n", + __func__, infname); + // return -2; + break; } line[strlen(line)-1] = '\0'; /* kill the newline */ if (verbosity>1) fprintf(stderr, "line read ===%s===\n", line); diff --git a/tools/read_obj.c b/tools/read_obj.c index a5f9253..4178ba1 100644 --- a/tools/read_obj.c +++ b/tools/read_obj.c @@ -20,8 +20,13 @@ if (2 != argc) { verbosity = 1; +<<<<<<< HEAD foo = try_to_read_an_OBJ_file(argv[1], "bulles.xyz", 0); fprintf(stderr, "try to read '%s' --> %d\n", argv[1], foo); +======= +foo = try_to_read_an_OBJ_file(argv[1], "bubulles.asc", 0); +fprintf(stderr, "try to read -> %d\n", foo); +>>>>>>> 457afac7c0a208413ff6a7f1d0932da76ecf685b return 0; }