diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-11-28 13:11:51 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-11-28 13:11:51 +0100 |
| commit | 9382f127ccebdd59917c97c61d008ed0e127cd75 (patch) | |
| tree | 0a48c8296199b343c76ef532eef014f908bc2e4d /common/strutils.h | |
| parent | 70eeaa4ec712895539ca6ecd60a42b93ec9b0904 (diff) | |
| download | tuxcmd-modules-0.6.72.tar.xz | |
Engine and VFS API cleanupv0.6.72
Also enable symlink resolving by default.
Diffstat (limited to 'common/strutils.h')
| -rw-r--r-- | common/strutils.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/common/strutils.h b/common/strutils.h index 84f6013..7fed4c5 100644 --- a/common/strutils.h +++ b/common/strutils.h @@ -20,32 +20,36 @@ #ifndef __STRUTILS_H__ #define __STRUTILS_H__ - - -#include <string.h> -#include <stdlib.h> +#ifdef __cplusplus + extern "C" { +#endif #ifdef __VERBOSE_DEBUG - #define log(msg...) printf(msg) + #define log(msg...) g_print(msg) #else #define log(msg...) { } #endif -#define IS_DIR_SEP(ch) ((ch) == '/') +/* path manipulating functions, all return newly allocated string */ +char * include_trailing_path_sep (const char *APath); +char * exclude_trailing_path_sep (const char *APath); +char * include_leading_path_sep (const char *APath); +char * exclude_leading_path_sep (const char *APath); + +char * resolve_relative (const char *source, const char *point_to); -// path manipulating functions, all return newly allocated string, you can then free them as you want -char* include_trailing_path_sep(const char *APath); -char* exclude_trailing_path_sep(const char *APath); -char* include_leading_path_sep(const char *APath); -char* exclude_leading_path_sep(const char *APath); -char* extract_file_name(const char *APath); -char* extract_file_path(const char *APath); -char* resolve_relative(const char *source, const char *point_to); -char* canonicalize_filename(const char *filename); +/* split the first path element (single level) and copy the rest (multiple levels) */ +void split_path (const char *path, char **first_part, char **last_part); -char* wide_to_utf8(const wchar_t *src); +char * canonicalize_filename (const char *filename); +char * wide_to_utf8 (const wchar_t *src); + + +#ifdef __cplusplus + } +#endif #endif /* __STRUTILS_H__ */ |
