IO functions
This commit is contained in:
22
include/io.h
Normal file
22
include/io.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef IO_H
|
||||
#define IO_H
|
||||
|
||||
#include "aliases.h"
|
||||
#include <linux/limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define STREQ(S1, S2) (strcmp(S1, S2) == 0)
|
||||
|
||||
typedef struct dirwalk dirwalk_t;
|
||||
typedef struct {
|
||||
FILE *fp;
|
||||
bool reading;
|
||||
char name[NAME_MAX + 1];
|
||||
} dirwalk_result_t;
|
||||
|
||||
u64 get_file_length(FILE *fp);
|
||||
void read_entire_file(void *dst, u64 length, FILE *fp);
|
||||
dirwalk_result_t walk_dir(dirwalk_t **dirwalk, const char *filepath);
|
||||
|
||||
#endif // !IO_H
|
Reference in New Issue
Block a user