2021-11-30 21:29:18 -06:00
|
|
|
#ifndef RESOURCES_H
|
|
|
|
#define RESOURCES_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2023-12-18 06:45:27 -06:00
|
|
|
#include "stb_ds.h"
|
|
|
|
#include "string.h"
|
2024-03-15 10:51:04 -05:00
|
|
|
#include <time.h>
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2023-10-09 18:10:10 -05:00
|
|
|
extern char *DATA_PATH;
|
2024-03-04 11:15:55 -06:00
|
|
|
extern int LOADED_GAME;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
|
|
|
void resources_init();
|
|
|
|
char *get_filename_from_path(char *path, int extension);
|
2024-04-28 13:33:37 -05:00
|
|
|
char *dirname(const char *path);
|
|
|
|
char *makepath(char *dir, char *file);
|
2022-08-24 12:24:21 -05:00
|
|
|
char *str_replace_ext(const char *s, const char *newext);
|
2021-11-30 21:29:18 -06:00
|
|
|
FILE *res_open(char *path, const char *tag);
|
2023-12-21 17:21:01 -06:00
|
|
|
char **ls(const char *path);
|
|
|
|
int cp(const char *p1, const char *p2);
|
|
|
|
int fexists(const char *path);
|
2024-03-15 10:51:04 -05:00
|
|
|
time_t file_mod_secs(const char *file);
|
2024-04-17 06:32:25 -05:00
|
|
|
void pack_start(const char *name);
|
|
|
|
void pack_add(const char *path);
|
|
|
|
void pack_end();
|
2023-12-21 17:21:01 -06:00
|
|
|
|
2023-09-18 12:35:40 -05:00
|
|
|
void *slurp_file(const char *filename, size_t *size);
|
2023-09-07 16:46:35 -05:00
|
|
|
char *slurp_text(const char *filename, size_t *size);
|
2024-01-31 02:42:15 -06:00
|
|
|
int slurp_write(const char *txt, const char *filename, size_t len);
|
2023-09-04 09:48:44 -05:00
|
|
|
|
2023-09-18 07:36:07 -05:00
|
|
|
char *seprint(char *fmt, ...);
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
#endif
|