annotate th_file.h @ 457:85fa3d333556

Actually, revert the boolean changes .. meh.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Jan 2018 23:09:29 +0200
parents 347bfd3e017e
children 7fca448847a3
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
454
347bfd3e017e Bump copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 453
diff changeset
4 * (C) Copyright 2016-2018 Tecnic Software productions (TNSP)
184
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 */
436
9148bc3fa838 Begin adding Doxygen documentation for some things. Very rudimentary, and
Matti Hamalainen <ccr@tnsp.org>
parents: 432
diff changeset
8 /// @file
9148bc3fa838 Begin adding Doxygen documentation for some things. Very rudimentary, and
Matti Hamalainen <ccr@tnsp.org>
parents: 432
diff changeset
9 /// @brief File, path, etc. related helper functions
184
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #ifndef TH_FILE_H
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #define TH_FILE_H
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 #ifdef HAVE_CONFIG_H
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 #include "config.h"
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #endif
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 #include "th_util.h"
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 // Platform specific defines
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 #if defined(TH_PLAT_WINDOWS)
198
5a31e1f766be Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 196
diff changeset
22 # define TH_DIR_SEPARATOR '\\'
184
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #else
198
5a31e1f766be Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 196
diff changeset
24 # define TH_DIR_SEPARATOR '/'
184
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #endif
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 // Flags for th_stat_path()
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 enum
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 {
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 TH_IS_DIR = 0x1000,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 TH_IS_SYMLINK = 0x2000,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 TH_IS_WRITABLE = 0x0002,
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 TH_IS_READABLE = 0x0004,
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
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 char * th_get_home_dir();
207
75dbac8f2f59 Actually make th_get_config_dir() work.
Matti Hamalainen <ccr@tnsp.org>
parents: 201
diff changeset
40 char * th_get_config_dir(const char *name);
184
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
457
85fa3d333556 Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
42 BOOL th_stat_path(const char *path, int *flags);
85fa3d333556 Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents: 454
diff changeset
43 BOOL th_mkdir_path(const char *cpath, int mode);
184
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44
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 #ifdef __cplusplus
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 }
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 #endif
b256db93cf25 Initial import of th_file module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 #endif // TH_FILE_H