2020-06-05 09:17:17 +11:00
|
|
|
/*
|
|
|
|
tentatives de lecture des OBJ
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2023-03-30 14:39:36 +11:00
|
|
|
#include <libgen.h> // for basename(3)
|
2023-04-28 08:59:59 +11:00
|
|
|
#include <unistd.h>
|
2023-03-30 14:39:36 +11:00
|
|
|
|
2020-06-05 09:17:17 +11:00
|
|
|
#include "../bubulles.h"
|
2023-04-21 07:55:46 +11:00
|
|
|
#include "../edges.h"
|
2020-06-05 09:17:17 +11:00
|
|
|
|
2023-04-22 19:31:50 +11:00
|
|
|
#include "objtrucs.h"
|
2023-03-30 14:39:36 +11:00
|
|
|
|
|
|
|
int verbosity = 0;
|
2020-06-05 10:05:01 +11:00
|
|
|
|
2023-04-28 08:59:59 +11:00
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
void help(void)
|
|
|
|
{
|
|
|
|
printf("nothing to say...\n");
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
2020-06-05 09:17:17 +11:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2023-04-28 08:59:59 +11:00
|
|
|
int foo, opt;
|
|
|
|
// char *fname; /* see manpage basename(3) */
|
2020-06-05 09:17:17 +11:00
|
|
|
|
2023-04-21 07:33:46 +11:00
|
|
|
fprintf(stderr, "\n### READ_OBJ compiled %s at %s\n", __DATE__, __TIME__);
|
2023-04-03 09:52:09 +11:00
|
|
|
|
2023-04-28 08:59:59 +11:00
|
|
|
if (1 == argc) {
|
2020-06-05 09:17:17 +11:00
|
|
|
bubulles_version(1);
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2023-04-28 08:59:59 +11:00
|
|
|
while ((opt = getopt(argc, argv, "hv")) != -1) {
|
|
|
|
switch(opt) {
|
|
|
|
case 'h':
|
|
|
|
help(); break;
|
|
|
|
case 'v':
|
|
|
|
verbosity++; break;
|
|
|
|
default:
|
|
|
|
exit(1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-03-30 14:39:36 +11:00
|
|
|
|
2023-04-28 08:59:59 +11:00
|
|
|
|
|
|
|
if (optind < argc) {
|
|
|
|
// fprintf(stderr, "ARG = %s\n", argv[optind]);
|
|
|
|
foo = try_to_read_an_OBJ_file(argv[optind], 0);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "Error number %d on '%s'\n", foo, argv[optind]);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fprintf(stderr, "%s need a input filename\n", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
2020-06-05 09:17:17 +11:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|