This commit is contained in:
tTh 2023-03-24 15:32:13 +01:00
commit ce2154d9c1
7 changed files with 41 additions and 4 deletions

1
.gitignore vendored
View File

@ -9,4 +9,5 @@ dummy-file
tools/*.obj
tools/read_obj
tools/*.xyz
tools/*.asc

View File

@ -9,6 +9,7 @@
#include <string.h>
#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("");
}

View File

@ -4,7 +4,7 @@
/* --------------------------------------------------------------------- */
#define LIBBB_VERSION 59
#define LIBBB_VERSION 60
#define SZ_BUBULLE_TEXT 81 /* arbitrary value */

12
edges.c
View File

@ -4,8 +4,20 @@
#include <stdio.h>
#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;
}
/* --------------------------------------------------------------------- */

14
edges.h
View File

@ -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;
/* --------------------------------------------------------------------- */

View File

@ -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);

View File

@ -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;
}