2024-07-07 03:18:23 +05:30
|
|
|
#ifndef _FILE_TYPE_H
|
|
|
|
#define _FILE_TYPE_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include "ends_with.h"
|
|
|
|
|
|
|
|
/* enums */
|
|
|
|
enum file_types {
|
|
|
|
FILE_TYPE_AUTO, // default value
|
|
|
|
FILE_TYPE_BINARY,
|
|
|
|
FILE_TYPE_TEXT,
|
|
|
|
FILE_TYPE_BMP,
|
|
|
|
FILE_TYPE_WAV
|
|
|
|
};
|
|
|
|
|
|
|
|
/* typedefs */
|
|
|
|
typedef enum file_types file_type_t;
|
|
|
|
|
|
|
|
/* function definitions */
|
2024-07-11 23:13:23 +05:30
|
|
|
file_type_t determine_file_type(FILE* file, const char* file_name);
|
2024-07-07 03:18:23 +05:30
|
|
|
const char* file_type_to_string(file_type_t type);
|
|
|
|
|
|
|
|
#endif /* _FILE_TYPE_H */
|