From c4547fa8320dc31d55996df612f0c4e50f08b678 Mon Sep 17 00:00:00 2001 From: tTh Date: Sun, 2 Apr 2023 22:53:00 +0200 Subject: [PATCH] experiment --- tools/essai_faces.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/essai_faces.c diff --git a/tools/essai_faces.c b/tools/essai_faces.c new file mode 100644 index 0000000..f9688a8 --- /dev/null +++ b/tools/essai_faces.c @@ -0,0 +1,44 @@ +/* + */ + +#include +#include +#include + +int essai_lecture_face(char *str) +{ +char *buffer, *ptr; +int bar; +int A, B, C; + +printf("-------- '%s'\n", str); +buffer = ptr = strdup(str); +for (bar = 0;;) { + ptr = strtok(ptr, " \t"); + if (NULL != ptr) { + printf("\t%2d '%s'\n", bar, ptr); + ptr = NULL; + bar++; + } + else break; + } +/* + * so, here, we know the number of thing to decipher + */ + +free(buffer); +printf(" -> %d\n", bar); + +return 0; +} + +int main(int argc, char *argv[]) +{ +int foo, bar; + +foo = essai_lecture_face("3 14 159"); +foo = essai_lecture_face("2 4 6 8"); +foo = essai_lecture_face("0/10 1/11 2/12"); + +return 0; +}