annotate th_file.h @ 184:b256db93cf25

Initial import of th_file module.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 20 Jan 2016 16:40:05 +0200
parents
children 5c7de25666e7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
184
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * File, directory etc helper functions
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * Programmed and designed by Matti 'ccr' Hamalainen
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 * (C) Copyright 2016 Tecnic Software productions (TNSP)
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 *
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 * Please read file 'COPYING' for information on license and distribution.
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 */
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 #ifndef TH_FILE_H
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #define TH_FILE_H
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #ifdef HAVE_CONFIG_H
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 #include "config.h"
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 #endif
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #include "th_util.h"
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 // Platform specific defines
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 #if defined(TH_PLAT_WINDOWS)
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 # define TH_DIR_SEPARATOR '\\'
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 #else
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 # define TH_DIR_SEPARATOR '/'
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #endif
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 // Flags for th_stat_path()
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 enum
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 {
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 TH_IS_DIR = 0x1000,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 TH_IS_SYMLINK = 0x2000,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 TH_IS_WRITABLE = 0x0002,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 TH_IS_READABLE = 0x0004,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 };
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 char * th_get_home_dir();
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 char * th_get_config_dir();
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 BOOL th_stat_path(const char *path, int *flags);
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 BOOL th_mkdir_path(const char *cpath, int mode);
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 #ifdef __cplusplus
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 }
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 #endif
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 #endif // TH_FILE_H