Waitrud Weber’s blog

things and reminders for memories

Language Support: Windows-make: Reading Files: UTF-16( Unicode ): As your Language: Opposite side, we could find:

Opposite side means flip side:
We could find colon by use of a_compare:
And we can analyze on the level1, which is "tokenizer".
That was step back in my program list but using standard library in C is the most effective, we respect.
We appriciate their work.

 

---
main.cpp  Tue Aug 25 08:42:48 2020

  1 :#include 
  2 :#include 
  3 :
  4 :#include "Print.h"
  5 :#include "array_counter.h"
  6 :#include "parse.h"
  7 :
  8 :int filesize( FILE *fp ) ;
  9 :
 10 :char lines[10][10];
 11 :char dummy[256];
 12 :
 13 :int analyze_main () ;
 14 :int retrieve (char* filename) ;
 15 :int found_enter (char* filename) ;
 16 :
 17 :
 18 :int main () {
 19 :	char* filename = ".\\001-specification-003.txt";
 20 ://	char b_dummy[256];
 21 :
 22 :	int result = found_enter (filename);
 23 :
 24 :	return 0;
 25 :}
 26 :
 27 ://
 28 ://
 29 ://
 30 ://
 31 ://
 32 :int found_enter (char* filename) {
 33 :	FILE *fp;
 34 :	char b_dummy[256];
 35 :	int i, j ;
 36 :	int file_end;
 37 :
 38 :	printf("found_enter: starts\r\n");
 39 :
 40 :	fp = fopen(filename, "rb");
 41 :	file_end = filesize(fp);
 42 :
 43 :	for ( i =0; i<file_end; i++ ) {
 44 :
 45 :		printf("i: %d loop starts.\r\n", i );
 46 :
 47 :		for ( j=0; j<255; j++ ) {
 48 :			b_dummy[ j + 1 ] = b_dummy[ j ];
 49 :		}
 50 :
 51 :		fread ( dummy, 1, 1, fp);
 52 :		b_dummy[ 0 ] = dummy[0];
 53 :
 54 :		if ( m_compare( (char*)b_dummy, (char*)"\r\n" ) == 1 ) {
 55 :			printf("We found Eenter %s\r\n", b_dummy);
 56 :			exit( -1 );
 57 :		}
 58 :
 59 :		printf("i: %d: |%d|%d|%d|%d| loop ends.\r\n", i, b_dummy[0], b_dummy[1], '\r', '\n' );
 60 :
 61 :		// We could find flip side:
 62 :		//
 63 :		//
 64 :		if ( b_dummy[0] == 13 && b_dummy[1] == 10 ) {
 65 :			b_dummy[2] = '\0';
 66 :			printf("We found Eenter oposite side: |%s|\r\n", b_dummy);
 67 :			exit(-1);
 68 :		}
 69 :	}
 70 :
 71 :	printf("found_enter: ends\r\n");
 72 :	return 0;
 73 :}
 74 :
---
case sep=2
a_compare ends
a_compare|t||:| 003
case sep=2
a_compare ends
i: 18: |116|0|13|10| loop ends.
i: 19 loop starts.
a_compare|:t||
| 003
case sep=2
a_compare ends
a_compare|:||:| 003
case sep=2
a_compare ends
We found colon |:|
---