| 1 |
/* emtexdir.h -- written by Eberhard Mattes, donated to the public domain */ |
| 2 |
|
| 3 |
#if !defined (_EMTEXDIR_H) |
| 4 |
#define _EMTEXDIR_H |
| 5 |
|
| 6 |
#if defined (__cplusplus) |
| 7 |
extern "C" { |
| 8 |
#endif |
| 9 |
|
| 10 |
|
| 11 |
/* Flags for emtex_dir_setup */ |
| 12 |
|
| 13 |
#define EDS_ONESUBDIR 0x0001 |
| 14 |
#define EDS_ALLSUBDIR 0x0002 |
| 15 |
#define EDS_BANG 0x0004 |
| 16 |
|
| 17 |
/* Flags for emtex_dir_find */ |
| 18 |
|
| 19 |
#define EDF_CWD 0x0001 |
| 20 |
#define EDF_FSLASH 0x0002 |
| 21 |
#define EDF_TRACE 0x8000 |
| 22 |
|
| 23 |
/* Methods for emtex_dir_trunc */ |
| 24 |
|
| 25 |
#define EDT_5_PLUS_3 0 /* 5+3.3 */ |
| 26 |
#define EDT_8 1 /* 8.3 */ |
| 27 |
|
| 28 |
/* Return values for emtex_dir_trunc */ |
| 29 |
|
| 30 |
#define EDT_UNCHANGED 0 /* Path name not changed */ |
| 31 |
#define EDT_CHANGED 1 /* Path name truncated */ |
| 32 |
#define EDT_TOOLONG 2 /* Path name too long */ |
| 33 |
#define EDT_INVALID 3 /* Path name invalid */ |
| 34 |
|
| 35 |
struct emtex_dir |
| 36 |
{ |
| 37 |
char **list; |
| 38 |
int used; |
| 39 |
int alloc; |
| 40 |
}; |
| 41 |
|
| 42 |
extern void (*emtex_dir_find_callback)(const char *name, int ok); |
| 43 |
|
| 44 |
int emtex_dir_setup (struct emtex_dir *ed, const char *env, const char *dir, |
| 45 |
unsigned flags); |
| 46 |
|
| 47 |
int emtex_dir_find (char *path, size_t path_size, const struct emtex_dir *ed, |
| 48 |
const char *fname, unsigned flags); |
| 49 |
|
| 50 |
int emtex_dir_trunc (char *dst, size_t dst_size, const char *src, |
| 51 |
unsigned flags, int method); |
| 52 |
|
| 53 |
#if defined (__cplusplus) |
| 54 |
} |
| 55 |
#endif |
| 56 |
|
| 57 |
#endif /* !defined (_EMTEXDIR_H) */ |