|
|
@@ -235,19 +235,17 @@ int file_size (char * name) { |
|
|
|
} |
|
|
|
|
|
|
|
int file_type (char * name) { |
|
|
|
char * file_type_data [file_type_count] = { |
|
|
|
".txt", ".s", ".fasm", ".gasm", ".nasm", ".yasm", ".c", ".h", ".adb", ".ads", ".cpp", ".hpp", |
|
|
|
char * extensions [file_type_count] = { |
|
|
|
".txt", ".asm", ".fasm", ".gasm", ".nasm", ".yasm", ".c", ".h", ".adb", ".ads", ".cpp", ".hpp", |
|
|
|
".f90", ".x" |
|
|
|
}; |
|
|
|
|
|
|
|
int type = 0; |
|
|
|
|
|
|
|
while (* name != '.') { |
|
|
|
++name; |
|
|
|
} |
|
|
|
for (; * name != '.'; ++name); |
|
|
|
|
|
|
|
for (type = 0; type != file_type_count; ++type) { |
|
|
|
if (string_compare (name, file_type_data [type])) { |
|
|
|
if (string_compare_limit (name, extensions [type], string_length (extensions [type]))) { |
|
|
|
return (type); |
|
|
|
} |
|
|
|
} |
|
|
|