9#if defined(_WIN32) || defined(__CYGWIN__)
10#define CWK_EXPORT __declspec(dllexport)
11#define CWK_IMPORT __declspec(dllimport)
13#define CWK_EXPORT __attribute__((visibility("default")))
14#define CWK_IMPORT __attribute__((visibility("default")))
20#if defined(CWK_SHARED)
21#if defined(CWK_EXPORTS)
22#define CWK_PUBLIC CWK_EXPORT
24#define CWK_PUBLIC CWK_IMPORT
94 char *
buffer,
size_t buffer_size);
115 const char *path,
char *
buffer,
size_t buffer_size);
136 char *
buffer,
size_t buffer_size);
189 char *
buffer,
size_t buffer_size);
250 const char *new_basename,
char *
buffer,
size_t buffer_size);
316 const char *new_extension,
char *
buffer,
size_t buffer_size);
356 const char *path_other);
445 const char *value,
char *
buffer,
size_t buffer_size);
char const int length
Definition cJSON.h:169
char * buffer
Definition cJSON.h:169
CWK_PUBLIC size_t cwk_path_get_absolute(const char *base, const char *path, char *buffer, size_t buffer_size)
Generates an absolute path based on a base.
Definition cwalk.c:681
CWK_PUBLIC size_t cwk_path_change_basename(const char *path, const char *new_basename, char *buffer, size_t buffer_size)
Changes the basename of a file path.
Definition cwalk.c:972
#define CWK_PUBLIC
Definition cwalk.h:27
CWK_PUBLIC bool cwk_path_is_separator(const char *str)
Checks whether the submitted pointer points to a separator.
Definition cwalk.c:1344
CWK_PUBLIC size_t cwk_path_join(const char *path_a, const char *path_b, char *buffer, size_t buffer_size)
Joins two paths together.
Definition cwalk.c:860
CWK_PUBLIC enum cwk_path_style cwk_path_get_style(void)
Gets the path style configuration.
Definition cwalk.c:1475
CWK_PUBLIC size_t cwk_path_change_segment(struct cwk_segment *segment, const char *value, char *buffer, size_t buffer_size)
Changes the content of a segment.
Definition cwalk.c:1361
CWK_PUBLIC size_t cwk_path_get_relative(const char *base_directory, const char *path, char *buffer, size_t buffer_size)
Generates a relative path based on a base.
Definition cwalk.c:753
CWK_PUBLIC void cwk_path_set_style(enum cwk_path_style style)
Configures which path style is used.
Definition cwalk.c:1467
CWK_PUBLIC enum cwk_segment_type cwk_path_get_segment_type(const struct cwk_segment *segment)
Gets the type of the submitted path segment.
Definition cwalk.c:1330
CWK_PUBLIC bool cwk_path_get_next_segment(struct cwk_segment *segment)
Advances to the next segment.
Definition cwalk.c:1261
cwk_segment_type
Definition cwalk.h:58
@ CWK_CURRENT
Definition cwalk.h:60
@ CWK_BACK
Definition cwalk.h:61
@ CWK_NORMAL
Definition cwalk.h:59
CWK_PUBLIC bool cwk_path_get_previous_segment(struct cwk_segment *segment)
Moves to the previous segment.
Definition cwalk.c:1299
CWK_PUBLIC size_t cwk_path_normalize(const char *path, char *buffer, size_t buffer_size)
Creates a normalized version of the path.
Definition cwalk.c:1146
CWK_PUBLIC size_t cwk_path_change_root(const char *path, const char *new_root, char *buffer, size_t buffer_size)
Changes the root of a path.
Definition cwalk.c:895
CWK_PUBLIC bool cwk_path_get_first_segment(const char *path, struct cwk_segment *segment)
Gets the first segment of a path.
Definition cwalk.c:1227
CWK_PUBLIC enum cwk_path_style cwk_path_guess_style(const char *path)
Guesses the path style.
Definition cwalk.c:1414
CWK_PUBLIC void cwk_path_get_basename(const char *path, const char **basename, size_t *length)
Gets the basename of a file path.
Definition cwalk.c:947
CWK_PUBLIC bool cwk_path_has_extension(const char *path)
Determines whether the file path has an extension.
Definition cwalk.c:1066
CWK_PUBLIC size_t cwk_path_change_extension(const char *path, const char *new_extension, char *buffer, size_t buffer_size)
Changes the extension of a file path.
Definition cwalk.c:1075
CWK_PUBLIC bool cwk_path_is_absolute(const char *path)
Determine whether the path is absolute or not.
Definition cwalk.c:929
CWK_PUBLIC size_t cwk_path_get_intersection(const char *path_base, const char *path_other)
Finds common portions in two paths.
Definition cwalk.c:1158
CWK_PUBLIC bool cwk_path_get_extension(const char *path, const char **extension, size_t *length)
Gets the extension of a file path.
Definition cwalk.c:1038
CWK_PUBLIC bool cwk_path_is_relative(const char *path)
Determine whether the path is relative or not.
Definition cwalk.c:941
CWK_PUBLIC size_t cwk_path_join_multiple(const char **paths, char *buffer, size_t buffer_size)
Joins multiple paths together.
Definition cwalk.c:876
CWK_PUBLIC bool cwk_path_get_last_segment(const char *path, struct cwk_segment *segment)
Gets the last segment of the path.
Definition cwalk.c:1242
CWK_PUBLIC void cwk_path_get_root(const char *path, size_t *length)
Determines the root of a path.
Definition cwalk.c:884
CWK_PUBLIC void cwk_path_get_dirname(const char *path, size_t *length)
Gets the dirname of a file path.
Definition cwalk.c:1021
cwk_path_style
Determines the style which is used for the path parsing and generation.
Definition cwalk.h:69
@ CWK_STYLE_WINDOWS
Definition cwalk.h:70
@ CWK_STYLE_UNIX
Definition cwalk.h:71
const char * segments
Definition cwalk.h:43
const char * path
Definition cwalk.h:42
const char * begin
Definition cwalk.h:44
const char * end
Definition cwalk.h:45
size_t size
Definition cwalk.h:46