* file: small wrap over winapi for windows and stdio for posix
 * fs: small wrapper over stat
 * slice: slice macro type
modified:
 * str and strview are now slices
This commit is contained in:
snarmph 2021-10-06 00:13:10 +02:00
parent bb5cce33f0
commit c4d1ffe539
15 changed files with 451 additions and 88 deletions

34
fs.h Normal file
View file

@ -0,0 +1,34 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "file.h"
enum {
FS_MODE_FILE,
FS_MODE_DIR,
FS_MODE_CHARACTER_DEVICE,
FS_MODE_FIFO,
FS_MODE_UKNOWN,
};
typedef struct {
int type;
uint64_t size;
int64_t last_access;
int64_t last_modif;
} fs_stat_t;
typedef struct {
int year;
int month;
int day;
int hour;
int minutes;
int seconds;
bool daylight_saving;
} fs_time_t;
fs_stat_t fsStat(file_t fp);
fs_time_t fsAsTime(int64_t time);