summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-03-27 06:49:10 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-03-27 06:49:10 +0200
commitfc820c883938e7daa257820c818a5c6b609f755f (patch)
treeb92d88686307cfade76136878319b7b08f21d4b3 /source
parentbed962a7bc6de0afd3828d991d46525f6b346d32 (diff)
downloadkit-fc820c883938e7daa257820c818a5c6b609f755f.zip
Path delim macro
Diffstat (limited to 'source')
-rw-r--r--source/kit/file.c4
-rw-r--r--source/kit/file.h10
2 files changed, 10 insertions, 4 deletions
diff --git a/source/kit/file.c b/source/kit/file.c
index 9ad4f16..edec2bd 100644
--- a/source/kit/file.c
+++ b/source/kit/file.c
@@ -73,7 +73,7 @@ kit_string_t kit_path_norm(kit_str_t const path,
for (i = 0; i < norm.size; i++) {
if (norm.values[i] != '\0') {
if (is_delim(norm.values[i]))
- norm.values[size] = KIT_PATH_DELIM;
+ norm.values[size] = KIT_PATH_DELIM_C;
else
norm.values[size] = norm.values[i];
size++;
@@ -106,7 +106,7 @@ kit_string_t kit_path_join(kit_str_t const left,
return joined;
memcpy(joined.values, left.values, left_size);
- joined.values[left_size] = KIT_PATH_DELIM;
+ joined.values[left_size] = KIT_PATH_DELIM_C;
memcpy(joined.values + left_size + 1, right_values, right_size);
return joined;
diff --git a/source/kit/file.h b/source/kit/file.h
index a773e02..865e1b8 100644
--- a/source/kit/file.h
+++ b/source/kit/file.h
@@ -10,10 +10,12 @@ extern "C" {
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
-# define KIT_PATH_DELIM '\\'
+# define KIT_PATH_DELIM_C '\\'
+# define KIT_PATH_DELIM "\\"
# define KIT_ENV_HOME "USERPROFILE"
#else
-# define KIT_PATH_DELIM '/'
+# define KIT_PATH_DELIM_C '/'
+# define KIT_PATH_DELIM "/"
# define KIT_ENV_HOME "HOME"
#endif
@@ -89,6 +91,10 @@ void kit_path_list_destroy(kit_path_list_t list);
# define file_enum_folder kit_file_enum_folder
# define path_list_destroy kit_path_list_destroy
+# define PATH_DELIM_C KIT_PATH_DELIM_C
+# define PATH_DELIM KIT_PATH_DELIM
+# define ENV_HOME KIT_ENV_HOME
+
# define PATH_NONE KIT_PATH_NONE
# define PATH_FILE KIT_PATH_FILE
# define PATH_FOLDER KIT_PATH_FOLDER