From 6961e4237f24306ab2475f4f527a7c802134c4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20L=2E=20=C5=A0ijanec?= Date: Fri, 1 May 2020 15:18:12 +0200 Subject: added working inline command tag detector, more constants ability to change inline command tag characters, variable length and count and buffer size from define headers. TODO: line-commands (lines, starting with ?) comments (lines, starting with #) --- test/ftell-test.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/ftell-test.c (limited to 'test/ftell-test.c') diff --git a/test/ftell-test.c b/test/ftell-test.c new file mode 100644 index 0000000..e0dd374 --- /dev/null +++ b/test/ftell-test.c @@ -0,0 +1,17 @@ +#include +#include + +extern int main(int argc, char* argv[]) { + if(argc != 2) { + printf("usage: %s filename-to-read\n", argv[0]); + return 1; + } + FILE * temp_input_file = fopen(argv[1], "r"); + char char_buffer = fgetc(temp_input_file); + while(char_buffer != EOF) { + printf("I have character %c on position %ld\n", char_buffer, ftell(temp_input_file)-1); + char_buffer = fgetc(temp_input_file); + } + printf("reached EOF!\n"); + return 0; +} -- cgit v1.2.3