joeylib2/include/joey/file.h

21 lines
842 B
C

// JoeyLib data-file access.
//
// Every game's runtime data lives under a single DATA/ directory that
// sits next to the executable (staged there by the per-platform disk /
// directory packagers). jlDataOpen forces that prefix so callers pass a
// bare name relative to DATA/ and never hard-code the prefix themselves --
// e.g. jlDataOpen("levels/title.dat", "rb") opens DATA/levels/title.dat.
#ifndef JOEYLIB_FILE_H
#define JOEYLIB_FILE_H
#include <stdio.h>
// Open a data file by its name relative to the DATA/ directory. The
// DATA/ prefix is prepended automatically; pass "levels/title.dat", not
// "DATA/levels/title.dat". mode is a standard fopen mode string. Returns
// NULL if the resulting path would overflow the internal buffer or the
// file cannot be opened.
FILE *jlDataOpen(const char *name, const char *mode);
#endif