34 |
#include <time.h> |
#include <time.h> |
35 |
#include <windows.h> |
#include <windows.h> |
36 |
|
|
|
|
|
37 |
#define FCMIOF_HORIZONTAL_BAR_SEP_CHAR ('-') |
#define FCMIOF_HORIZONTAL_BAR_SEP_CHAR ('-') |
38 |
#define FCMIOF_LINE_LEN (78) |
#define FCMIOF_LINE_LEN (78) |
39 |
|
|
49 |
|
|
50 |
const char * const license_text[] = |
const char * const license_text[] = |
51 |
{ |
{ |
52 |
"Permission is hereby granted, free of charge, to any person obtaining a copy", |
"Permission is hereby granted, free of charge, to any person obtaining a copy", |
53 |
"of this software and associated documentation files(the \"Software\"), to deal", |
"of this software and associated documentation files(the \"Software\"), to deal", |
54 |
"in the Software without restriction, including without limitation the rights", |
"in the Software without restriction, including without limitation the rights", |
55 |
"to use, copy, modify, merge, publish, distribute, sublicense, and / or sell", |
"to use, copy, modify, merge, publish, distribute, sublicense, and / or sell", |
56 |
"copies of the Software, and to permit persons to whom the Software is", |
"copies of the Software, and to permit persons to whom the Software is", |
57 |
"furnished to do so, subject to the following conditions:", |
"furnished to do so, subject to the following conditions:", |
58 |
"", |
"", |
59 |
"The above copyright notice and this permission notice shall be included in", |
"The above copyright notice and this permission notice shall be included in", |
60 |
"all copies or substantial portions of the Software.", |
"all copies or substantial portions of the Software.", |
61 |
"", |
"", |
62 |
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", |
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", |
63 |
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", |
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", |
64 |
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", |
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", |
65 |
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", |
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", |
66 |
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", |
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", |
67 |
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", |
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", |
68 |
"SOFTWARE." |
"SOFTWARE." |
69 |
}; |
}; |
70 |
|
|
71 |
const char * const prog_desc_text[] = |
const char * const prog_desc_text[] = |
72 |
{ |
{ |
73 |
"ifsfscan (mnemonic: Ill-Formed Source File SCAN) is a program for detecting", |
"ifsfscan (mnemonic: Ill-Formed Source File SCAN) is a program for detecting", |
74 |
"gross formatting errors in source files (Windows/ASCII text files only). The", |
"gross formatting errors in source files (Windows/ASCII text files only). The", |
75 |
"errors detected are non-ASCII characters, tab characters, abnormal", |
"errors detected are non-ASCII characters, tab characters, abnormal", |
76 |
"end-of-line characters, and trailing whitespace on lines.", |
"end-of-line characters, and trailing whitespace on lines.", |
77 |
}; |
}; |
78 |
|
|
79 |
const char * const prog_help_text[] = |
const char * const prog_help_text[] = |
80 |
{ |
{ |
81 |
"Usage: ifsfscan [filename_or_wildcard [filename_or_wildcard [...]]]", |
"Usage: ifsfscan [filename_or_wildcard [filename_or_wildcard [...]]]", |
82 |
"", |
"", |
83 |
"Notes:", |
"Notes:", |
84 |
" (1) : Wildcards (\"*\", \"?\") are processed by Windows, so Windows is", |
" (1) : Wildcards (\"*\", \"?\") are processed by Windows, so Windows is", |
85 |
" the arbiter of which wildcards are accepted and how they expand.", |
" the arbiter of which wildcards are accepted and how they expand.", |
86 |
" (2) : This program never writes to a file, so it cannot destroy data", |
" (2) : This program never writes to a file, so it cannot destroy data", |
87 |
" (except, possibly, by stdout output redirected to a file).", |
" (except, possibly, by stdout output redirected to a file).", |
88 |
" (3) : This program accepts no options (like \"-help\" or \"-verbose\").", |
" (3) : This program accepts no options (like \"-help\" or \"-verbose\").", |
89 |
" (4) : This program accepts only Windows line endings (13-10).", |
" (4) : This program accepts only Windows line endings (13-10).", |
90 |
" This program is incompatible with *nix and *nix files.", |
" This program is incompatible with *nix and *nix files.", |
91 |
" (5) : This program accepts only the ASCII character set (it will not", |
" (5) : This program accepts only the ASCII character set (it will not", |
92 |
" process UTF-8 or any other encodings).", |
" process UTF-8 or any other encodings).", |
93 |
}; |
}; |
98 |
void CCMFATAL_fatal(const char *desc, const char *file, size_t line) |
void CCMFATAL_fatal(const char *desc, const char *file, size_t line) |
99 |
{ |
{ |
100 |
printf("\n"); |
printf("\n"); |
101 |
printf("Fatal error. Must terminate execution.\n"); |
printf("Fatal error. Must terminate execution.\n"); |
102 |
printf("File: %s, Line: %zu.\n", file, line); |
printf("File: %s, Line: %zu.\n", file, line); |
103 |
printf("Error description: %s\n", desc); |
printf("Error description: %s\n", desc); |
104 |
exit(4); //Error code 4 for error termination. |
exit(4); //Error code 4 for error termination. |
105 |
} |
} |
106 |
|
|
107 |
//-------------------------------------------------------------------------------- |
//-------------------------------------------------------------------------------- |
119 |
} |
} |
120 |
} |
} |
121 |
|
|
|
//-------------------------------------------------------------------------------- |
|
|
// M E M O R Y A L L O C A T I O N F U N C T I O N S |
|
|
//-------------------------------------------------------------------------------- |
|
|
//These functions form a layer over the standard library so that conditions of |
|
|
//concern can be more easily trapped. |
|
|
//-------------------------------------------------------------------------------- |
|
|
void *CCMALLOC_malloc(size_t size) |
|
|
{ |
|
|
void *rv; |
|
|
|
|
|
rv = malloc(size); |
|
|
|
|
|
if (!rv) |
|
|
{ |
|
|
CCMFATAL_fatal("NULL pointer from malloc()--probable out of memory.", |
|
|
__FILE__, |
|
|
__LINE__); |
|
|
} |
|
|
|
|
|
memset(rv, 0, size); |
|
|
|
|
|
return(rv); |
|
|
} |
|
|
|
|
|
void *CCMALLOC_calloc(size_t num, size_t size) |
|
|
{ |
|
|
void *rv; |
|
|
|
|
|
rv = calloc(num, size); |
|
|
|
|
|
if (!rv) |
|
|
{ |
|
|
CCMFATAL_fatal("NULL pointer from calloc()--probable out of memory.", |
|
|
__FILE__, |
|
|
__LINE__); |
|
|
} |
|
|
|
|
|
memset(rv, 0, size); |
|
|
|
|
|
return(rv); |
|
|
} |
|
|
|
|
|
void *CCMALLOC_realloc(void *memblock, size_t size) |
|
|
{ |
|
|
void *rv; |
|
|
|
|
|
rv = realloc(memblock, size); |
|
|
|
|
|
if ((!rv) && (size)) |
|
|
{ |
|
|
CCMFATAL_fatal("NULL pointer from realloc()--probable out of memory.", |
|
|
__FILE__, |
|
|
__LINE__); |
|
|
} |
|
|
|
|
|
return(rv); |
|
|
} |
|
|
|
|
|
|
|
|
void CCMALLOC_free(void *memblock) |
|
|
{ |
|
|
free(memblock); |
|
|
} |
|
|
|
|
|
//-------------------------------------------------------------------------------- |
|
|
// C H A R A C T E R F U N C T I O N S |
|
|
//-------------------------------------------------------------------------------- |
|
|
int CHARFUNC_digit_to_val(char digit) |
|
|
{ |
|
|
switch (digit) |
|
|
{ |
|
|
case '0': return(0); |
|
|
break; |
|
|
case '1': return(1); |
|
|
break; |
|
|
case '2': return(2); |
|
|
break; |
|
|
case '3': return(3); |
|
|
break; |
|
|
case '4': return(4); |
|
|
break; |
|
|
case '5': return(5); |
|
|
break; |
|
|
case '6': return(6); |
|
|
break; |
|
|
case '7': return(7); |
|
|
break; |
|
|
case '8': return(8); |
|
|
break; |
|
|
case '9': return(9); |
|
|
break; |
|
|
default: return(-1); |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
char CHARFUNC_nibble_to_lc_hex_digit(int nibble) |
|
|
{ |
|
|
switch (nibble & 0x0F) |
|
|
{ |
|
|
case 0: |
|
|
return('0'); |
|
|
break; |
|
|
case 1: |
|
|
return('1'); |
|
|
break; |
|
|
case 2: |
|
|
return('2'); |
|
|
break; |
|
|
case 3: |
|
|
return('3'); |
|
|
break; |
|
|
case 4: |
|
|
return('4'); |
|
|
break; |
|
|
case 5: |
|
|
return('5'); |
|
|
break; |
|
|
case 6: |
|
|
return('6'); |
|
|
break; |
|
|
case 7: |
|
|
return('7'); |
|
|
break; |
|
|
case 8: |
|
|
return('8'); |
|
|
break; |
|
|
case 9: |
|
|
return('9'); |
|
|
break; |
|
|
case 10: |
|
|
return('a'); |
|
|
break; |
|
|
case 11: |
|
|
return('b'); |
|
|
break; |
|
|
case 12: |
|
|
return('c'); |
|
|
break; |
|
|
case 13: |
|
|
return('d'); |
|
|
break; |
|
|
case 14: |
|
|
return('e'); |
|
|
break; |
|
|
case 15: |
|
|
return('f'); |
|
|
break; |
|
|
default: |
|
|
USERASSERT_assert(0, __FILE__, __LINE__); |
|
|
return('?'); |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
void CHARFUNC_int_to_lc_hex_rev(int arg, char *s) |
|
|
{ |
|
|
int i; |
|
|
|
|
|
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
|
|
|
|
|
for (i = 0; i<8; i++) |
|
|
{ |
|
|
s[i] = CHARFUNC_nibble_to_lc_hex_digit(arg); |
|
|
arg >>= 4; |
|
|
} |
|
|
} |
|
122 |
|
|
123 |
//-------------------------------------------------------------------------------- |
//-------------------------------------------------------------------------------- |
124 |
// S T R I N G A N D C H A R A C T E R A R R A Y F U N C T I O N S |
// S T R I N G A N D C H A R A C T E R A R R A Y F U N C T I O N S |
191 |
//-------------------------------------------------------------------------------- |
//-------------------------------------------------------------------------------- |
192 |
int FCMIOF_get_line_len(void) |
int FCMIOF_get_line_len(void) |
193 |
{ |
{ |
194 |
return(FCMIOF_LINE_LEN); |
return(FCMIOF_LINE_LEN); |
195 |
} |
} |
196 |
|
|
197 |
void FCMIOF_stream_repchar(FILE *s, char c, unsigned n) |
void FCMIOF_stream_repchar(FILE *s, char c, unsigned n) |
198 |
{ |
{ |
199 |
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
200 |
|
|
201 |
while (n--) |
while (n--) |
202 |
fprintf(s, "%c", c); |
fprintf(s, "%c", c); |
203 |
} |
} |
204 |
|
|
205 |
void FCMIOF_repchar(char c, unsigned n) |
void FCMIOF_repchar(char c, unsigned n) |
206 |
{ |
{ |
207 |
while (n--) |
while (n--) |
208 |
printf("%c", c); |
printf("%c", c); |
209 |
} |
} |
210 |
|
|
211 |
void FCMIOF_hline(void) |
void FCMIOF_hline(void) |
212 |
{ |
{ |
213 |
FCMIOF_repchar(FCMIOF_HORIZONTAL_BAR_SEP_CHAR, FCMIOF_LINE_LEN); |
FCMIOF_repchar(FCMIOF_HORIZONTAL_BAR_SEP_CHAR, FCMIOF_LINE_LEN); |
214 |
printf("\n"); |
printf("\n"); |
215 |
} |
} |
216 |
|
|
217 |
void FCMIOF_stream_hline(FILE *s) |
void FCMIOF_stream_hline(FILE *s) |
218 |
{ |
{ |
219 |
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
220 |
|
|
221 |
FCMIOF_stream_repchar(s, FCMIOF_HORIZONTAL_BAR_SEP_CHAR, FCMIOF_LINE_LEN); |
FCMIOF_stream_repchar(s, FCMIOF_HORIZONTAL_BAR_SEP_CHAR, FCMIOF_LINE_LEN); |
222 |
fprintf(s, "\n"); |
fprintf(s, "\n"); |
|
} |
|
|
|
|
|
void FCMIOF_stream_bannerheading(FILE *f, |
|
|
char *s, |
|
|
int n_extra_lines) |
|
|
{ |
|
|
const int lr_padding = 3; |
|
|
/* The number of spaces on each side of what is printed. |
|
|
*/ |
|
|
int i; |
|
|
/* General iteration variable. |
|
|
*/ |
|
|
|
|
|
int n_asterisks; |
|
|
int input_arg_len; |
|
|
int n_left_spaces; |
|
|
int n_right_spaces; |
|
|
|
|
|
/* Check the file pointer, string pointer, and other par. |
|
|
*/ |
|
|
USERASSERT_assert(f != NULL, __FILE__, __LINE__); |
|
|
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
|
|
USERASSERT_assert(n_extra_lines >= 0, __FILE__, __LINE__); |
|
|
|
|
|
/* Print the right number of solid lines of asterisks to the |
|
|
** standard output. |
|
|
*/ |
|
|
for (i = 0; i<n_extra_lines; i++) |
|
|
{ |
|
|
FCMIOF_stream_repchar(f, '*', FCMIOF_LINE_LEN); |
|
|
fprintf(f, "\n"); |
|
|
} |
|
|
|
|
|
/* Figure out how many asterisks to print on each side of the |
|
|
** argument, and how many spaces. We also need to figure out |
|
|
** how many characters of the input argument to print--if there |
|
|
** are too many characters, we need to truncate. |
|
|
*/ |
|
|
input_arg_len = strlen(s); |
|
|
if (input_arg_len > (FCMIOF_LINE_LEN - 2 * lr_padding - 2)) |
|
|
input_arg_len = FCMIOF_LINE_LEN - 2 * lr_padding - 2; |
|
|
|
|
|
n_asterisks = (FCMIOF_LINE_LEN - 2 * lr_padding - input_arg_len) / 2; |
|
|
|
|
|
n_left_spaces = lr_padding; |
|
|
|
|
|
if ((FCMIOF_LINE_LEN - 2 * lr_padding - input_arg_len) % 2) |
|
|
{ |
|
|
/* Odd, need to pad the right by one. */ |
|
|
n_right_spaces = lr_padding + 1; |
|
|
} |
|
|
else |
|
|
{ |
|
|
n_right_spaces = lr_padding; |
|
|
} |
|
|
|
|
|
/* Print the text. */ |
|
|
FCMIOF_stream_repchar(f, '*', n_asterisks); |
|
|
FCMIOF_stream_repchar(f, ' ', n_left_spaces); |
|
|
for (i = 0; i<input_arg_len; i++) |
|
|
fprintf(f, "%c", s[i]); |
|
|
FCMIOF_stream_repchar(f, ' ', n_right_spaces); |
|
|
FCMIOF_stream_repchar(f, '*', n_asterisks); |
|
|
fprintf(f, "\n"); |
|
|
|
|
|
/* Print the right number of solid lines of asterisks to the |
|
|
** standard output. |
|
|
*/ |
|
|
for (i = 0; i<n_extra_lines; i++) |
|
|
{ |
|
|
FCMIOF_stream_repchar(f, '*', FCMIOF_LINE_LEN); |
|
|
fprintf(f, "\n"); |
|
|
} |
|
|
} |
|
|
|
|
|
void FCMIOF_bannerheading(char *s, int n_extra_lines) |
|
|
{ |
|
|
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
|
|
USERASSERT_assert(n_extra_lines >= 0, __FILE__, __LINE__); |
|
|
|
|
|
FCMIOF_stream_bannerheading(stdout, s, n_extra_lines); |
|
|
} |
|
|
|
|
|
void FCMIOF_time_stream(FILE *s, time_t ltime) |
|
|
{ |
|
|
char *p; |
|
|
|
|
|
USERASSERT_assert(s != NULL, __FILE__, __LINE__); |
|
|
|
|
|
time(<ime); |
|
|
|
|
|
p = ctime(<ime); |
|
|
|
|
|
if (p) |
|
|
{ |
|
|
int i; |
|
|
|
|
|
for (i = 11; i<19; i++) |
|
|
fprintf(s, "%c", p[i]); |
|
|
fprintf(s, " "); |
|
|
for (i = 0; i<10; i++) |
|
|
fprintf(s, "%c", p[i]); |
|
|
fprintf(s, " "); |
|
|
for (i = 20; i<24; i++) |
|
|
fprintf(s, "%c", p[i]); |
|
|
} |
|
|
else |
|
|
{ |
|
|
fprintf(s, "??? ??? ?? ??:??:?? ????"); |
|
|
} |
|
223 |
} |
} |
224 |
|
|
225 |
int is_legal_non_eol_character(char c) |
int is_legal_non_eol_character(char c) |
264 |
|
|
265 |
void emit_human_friendly_llu(unsigned long long arg) |
void emit_human_friendly_llu(unsigned long long arg) |
266 |
{ |
{ |
267 |
printf("%llu", arg); |
size_t i, len; |
268 |
|
char buffer[100]; |
269 |
|
|
270 |
|
sprintf_s(buffer, sizeof(buffer)/sizeof(buffer[0]), "%llu", arg); |
271 |
|
len = strlen(buffer); |
272 |
|
|
273 |
|
for (i = 0; i < len; i++) |
274 |
|
{ |
275 |
|
printf("%c", buffer[i]); |
276 |
|
if (((len-i-1) != 0) && (((len - i - 1) % 3) == 0)) |
277 |
|
printf(","); |
278 |
|
} |
279 |
} |
} |
280 |
|
|
281 |
void emit_file_pos_3tuple(unsigned long long line, unsigned long long col, unsigned long long offset) |
void emit_file_pos_3tuple(unsigned long long line, unsigned long long col, unsigned long long offset) |
299 |
char in_c, prev_c; |
char in_c, prev_c; |
300 |
unsigned char in_uc; |
unsigned char in_uc; |
301 |
int in_i; |
int in_i; |
302 |
|
|
303 |
in_i = fgetc(f); |
in_i = fgetc(f); |
304 |
|
|
305 |
if (in_i == EOF) |
if (in_i == EOF) |
313 |
char_no = 0; |
char_no = 0; |
314 |
line_no = 1; |
line_no = 1; |
315 |
col_no = 1; |
col_no = 1; |
316 |
in_c = in_i & 0xFF; |
in_c = in_i & 0xff; |
317 |
in_uc = in_i & 0xFF; |
in_uc = in_i & 0xff; |
318 |
|
|
319 |
do |
do |
320 |
{ |
{ |
325 |
printf(" Illegal character: 0x%02x.\n", ((unsigned)in_uc)); |
printf(" Illegal character: 0x%02x.\n", ((unsigned)in_uc)); |
326 |
} |
} |
327 |
|
|
328 |
|
//printf("Character: %02x State: %u\n", in_c, (unsigned)state); |
329 |
|
|
330 |
//Run through the state machine, which would look for bad EOL sequences. |
//Run through the state machine, which would look for bad EOL sequences. |
331 |
switch (state) |
switch (state) |
332 |
{ |
{ |
333 |
case PST_LINE: |
case PST_LINE: |
334 |
|
//Processing non-EOL characters. |
335 |
if (is_lf(in_c)) |
if (is_lf(in_c)) |
336 |
{ |
{ |
337 |
|
if ((char_no != 0) && (prev_c == ' ')) |
338 |
|
{ |
339 |
|
emit_file_pos_3tuple(line_no, col_no, char_no); |
340 |
|
printf(" Line contains trailing whitespace.\n"); |
341 |
|
} |
342 |
|
|
343 |
//Line feeds not allowed without preceding carriage return. |
//Line feeds not allowed without preceding carriage return. |
344 |
emit_file_pos_3tuple(line_no, col_no, char_no); |
emit_file_pos_3tuple(line_no, col_no, char_no); |
345 |
printf(" Out of sequence line feed character (0x0a)\n"); |
printf(" Out of sequence line feed character (0x0a).\n"); |
346 |
line_no++; |
line_no++; |
347 |
col_no = 1; |
col_no = 1; |
348 |
state = PST_LF_FOUND; |
state = PST_LF_FOUND; |
349 |
} |
} |
350 |
else if (is_cr(in_c)) |
else if (is_cr(in_c)) |
351 |
{ |
{ |
352 |
|
if ((char_no != 0) && (prev_c == ' ')) |
353 |
|
{ |
354 |
|
emit_file_pos_3tuple(line_no, col_no, char_no); |
355 |
|
printf(" Line contains trailing whitespace.\n"); |
356 |
|
} |
357 |
|
|
358 |
//Legal |
//Legal |
359 |
state = PST_CR_FOUND; |
state = PST_CR_FOUND; |
360 |
} |
} |
376 |
{ |
{ |
377 |
//Back-to-back carriage returns not allowed. |
//Back-to-back carriage returns not allowed. |
378 |
emit_file_pos_3tuple(line_no, col_no, char_no); |
emit_file_pos_3tuple(line_no, col_no, char_no); |
379 |
printf(" Out of sequence carriage return character (0x0D)\n"); |
printf(" Out of sequence carriage return character (0x0D).\n"); |
380 |
col_no++; |
col_no++; |
381 |
} |
} |
382 |
else |
else |
400 |
{ |
{ |
401 |
//Legal. Blank lines are fine. |
//Legal. Blank lines are fine. |
402 |
col_no++; |
col_no++; |
403 |
state = PST_LF_FOUND; |
state = PST_CR_FOUND; |
404 |
} |
} |
405 |
else |
else |
406 |
{ |
{ |
414 |
break; |
break; |
415 |
} |
} |
416 |
|
|
|
|
|
417 |
in_i = fgetc(f); |
in_i = fgetc(f); |
418 |
char_no++; |
prev_c = in_c; |
|
if (in_i == EOF) |
|
|
exit_flag = 1; |
|
419 |
in_c = in_i & 0xff; |
in_c = in_i & 0xff; |
420 |
in_uc = in_i & 0xff; |
in_uc = in_i & 0xff; |
421 |
|
char_no++; |
422 |
|
if (in_i == EOF) |
423 |
|
{ |
424 |
|
if (state != PST_LF_FOUND) |
425 |
|
{ |
426 |
|
emit_file_pos_3tuple(line_no, col_no, char_no-1); |
427 |
|
printf(" Final line of file does not have CR/LF sequence.\n"); |
428 |
|
} |
429 |
|
if ((state == PST_LINE) && (prev_c == ' ')) |
430 |
|
{ |
431 |
|
emit_file_pos_3tuple(line_no, col_no, char_no - 1); |
432 |
|
printf(" Final line contains trailing whitespace.\n"); |
433 |
|
} |
434 |
|
|
435 |
|
exit_flag = 1; |
436 |
|
} |
437 |
} while (!exit_flag); |
} while (!exit_flag); |
|
|
|
438 |
} |
} |
439 |
|
|
440 |
void process_file_by_name(const char *s) |
void process_file_by_name(const char *s) |
590 |
} |
} |
591 |
|
|
592 |
return 0; |
return 0; |
|
} |
|
593 |
|
} |