Waitrud Weber’s blog

things and reminders for memories

Analyzer: get_char (STRUCT_FILE sf): ensured the type of character.



we ennsure the set and decrease of index.
1. increasing
from 0 to 9.
2. decreasing
from 100 to 91.


//
//
//
//
//
int found_enter_001 (char* filename) {
	FILE *fp;
	char b_dummy[256];
	int i, j ;
	int file_end;
	STRUCT_FILE structure_fp;
	char c;

	printf("found_enter_001: starts\r\n");

	fp = fopen(filename, "rb");
	structure_fp.file_start = fp;
	structure_fp.fp = fp;

	file_end = filesize(fp);
	structure_fp.file_end_index = file_end;
	
	for ( i =0; i90; i-- ) {

		printf("i: %d loop starts. ", i );
		printf("struct_fp.fp |%d|\r\n", structure_fp.fp );

		structure_fp.index = i;
		dummy[0] = get_char( structure_fp );
		dummy[1] = '\0';


		printf("i: %d: |%s| \r\n", i, dummy);

	}


	printf("found_enter_001: ends\r\n");
	return 0;
}
PS C:\Users\abjmp_000\Documents\source\analyzer_20201126> .\winmain_001.exe
found_enter_001: starts
i: 0 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |0|
struct_fp.fp |1968282728|
get_char ends.
i: 0: |G|
i: 1 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |1|
struct_fp.fp |1968282728|
get_char ends.
i: 1: |u|
i: 2 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |2|
struct_fp.fp |1968282728|
get_char ends.
i: 2: |n|
i: 3 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |3|
struct_fp.fp |1968282728|
get_char ends.
i: 3: |d|
i: 4 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |4|
struct_fp.fp |1968282728|
get_char ends.
i: 4: |a|
i: 5 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |5|
struct_fp.fp |1968282728|
get_char ends.
i: 5: |m|
i: 6 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |6|
struct_fp.fp |1968282728|
get_char ends.
i: 6: |0|
i: 7 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |7|
struct_fp.fp |1968282728|
get_char ends.
i: 7: |0|
i: 8 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |8|
struct_fp.fp |1968282728|
get_char ends.
i: 8: | |
i: 9 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |9|
struct_fp.fp |1968282728|
get_char ends.
i: 9: |:|
i: 100 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |100|
struct_fp.fp |1968282728|
get_char ends.
i: 100: |2|
i: 99 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |99|
struct_fp.fp |1968282728|
get_char ends.
i: 99: |0|
i: 98 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |98|
struct_fp.fp |1968282728|
get_char ends.
i: 98: |0|
i: 97 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |97|
struct_fp.fp |1968282728|
get_char ends.
i: 97: | |
i: 96 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |96|
struct_fp.fp |1968282728|
get_char ends.
i: 96: |:|
i: 95 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |95|
struct_fp.fp |1968282728|
get_char ends.
i: 95: | |
i: 94 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |94|
struct_fp.fp |1968282728|
get_char ends.
i: 94: |"|
i: 93 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |93|
struct_fp.fp |1968282728|
get_char ends.
i: 93: |1|
i: 92 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |92|
struct_fp.fp |1968282728|
get_char ends.
i: 92: |0|
i: 91 loop starts. struct_fp.fp |1968282728|
get_char starts.
struct_fp.fp |1968282728| struct_fp.index |91|
struct_fp.fp |1968282728|
get_char ends.
i: 91: |0|
found_enter_001: ends