diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/th_file.h	Wed Jan 20 16:40:05 2016 +0200
@@ -0,0 +1,47 @@
+/*
+ * File, directory etc helper functions
+ * Programmed and designed by Matti 'ccr' Hamalainen
+ * (C) Copyright 2016 Tecnic Software productions (TNSP)
+ *
+ * Please read file 'COPYING' for information on license and distribution.
+ */
+#ifndef TH_FILE_H
+#define TH_FILE_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "th_util.h"
+
+
+// Platform specific defines
+#if defined(TH_PLAT_WINDOWS)
+#  define TH_DIR_SEPARATOR '\\'
+#else
+#  define TH_DIR_SEPARATOR '/'
+#endif
+
+
+// Flags for th_stat_path()
+enum
+{
+    TH_IS_DIR      = 0x1000,
+    TH_IS_SYMLINK  = 0x2000,
+
+    TH_IS_WRITABLE = 0x0002,
+    TH_IS_READABLE = 0x0004,
+};
+
+
+char *  th_get_home_dir();
+char *  th_get_config_dir();
+
+BOOL    th_stat_path(const char *path, int *flags);
+BOOL    th_mkdir_path(const char *cpath, int mode);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif // TH_FILE_H