libcsplit(3)
π libcsplit(3) β the cross-platform C split-string library, bestie edition π
okay so you're reading the libcsplit(3) page from the Library Functions Manual and honestly? iconic choice. this is libcsplit.h, a whole little library that does split string stuff for you, cross-platform, in C. let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <libcsplit.h>
πΈ Support functions
const char *
libcsplit_get_version(void);
π Error functions
void
libcsplit_error_free(libcsplit_error_t **error);
int
libcsplit_error_fprint(libcsplit_error_t *error, FILE *stream);
int
libcsplit_error_sprint(libcsplit_error_t *error, char *string,
size_t size);
int
libcsplit_error_backtrace_fprint(libcsplit_error_t *error,
FILE *stream);
int
libcsplit_error_backtrace_sprint(libcsplit_error_t *error, char *string,
size_t size);
π¦ Narrow string functions
int
libcsplit_narrow_string_split(const char *string, size_t string_size,
char delimiter, libcsplit_narrow_split_string_t **split_string,
libcsplit_error_t **error);
π Narrow split string functions
int
libcsplit_narrow_split_string_free(libcsplit_narrow_split_string_t **split_string,
libcsplit_error_t **error);
int
libcsplit_narrow_split_string_get_string(libcsplit_narrow_split_string_t *split_string,
char **string, size_t *string_size, libcsplit_error_t **error);
int
libcsplit_narrow_split_string_get_number_of_segments(libcsplit_narrow_split_string_t *split_string,
int *number_of_segments, libcsplit_error_t **error);
int
libcsplit_narrow_split_string_get_segment_by_index(libcsplit_narrow_split_string_t *split_string,
int segment_index, char **string_segment,
size_t *string_segment_size, libcsplit_error_t **error);
int
libcsplit_narrow_split_string_set_segment_by_index(libcsplit_narrow_split_string_t *split_string,
int segment_index, char *string_segment, size_t string_segment_size,
libcsplit_error_t **error);
π Wide string functions
int
libcsplit_wide_string_split(const wchar_t *string, size_t string_size,
wchar_t delimiter, libcsplit_wide_split_string_t **split_string,
libcsplit_error_t **error);
β Wide split string functions
int
libcsplit_wide_split_string_free(libcsplit_wide_split_string_t **split_string,
libcsplit_error_t **error);
int
libcsplit_wide_split_string_get_string(libcsplit_wide_split_string_t *split_string,
wchar_t **string, size_t *string_size, libcsplit_error_t **error);
int
libcsplit_wide_split_string_get_number_of_segments(libcsplit_wide_split_string_t *split_string,
int *number_of_segments, libcsplit_error_t **error);
int
libcsplit_wide_split_string_get_segment_by_index(libcsplit_wide_split_string_t *split_string,
int segment_index, wchar_t **string_segment,
size_t *string_segment_size, libcsplit_error_t **error);
int
libcsplit_wide_split_string_set_segment_by_index(libcsplit_wide_split_string_t *split_string,
int segment_index, wchar_t *string_segment,
size_t *string_segment_size, libcsplit_error_t **error);
π§ DESCRIPTION π§
so the one function that gets called out here is libcsplit_get_version() β that's your girl when you need to retrieve the library version. that's it, that's the description section. short and slay π
π RETURN VALUES π
okay so most of these functions return NULL or -1 on error β it depends on the return type, so like, don't quote me on which one, check the type. for the actual, real, no-cap return values, go look at "libcsplit.h". that's the source of truth, periodt.
π ENVIRONMENT π
None
like literally none. nothing here. β¨
π FILES π
None
also nothing. we love a low-maintenance library.
π₯ NOTES π₯
libcsplit can be compiled with wide character support (wchar_t). fancy.
to compile libcsplit with wide character support, use:
./configure --enable-wide-character-type=yes
or define:
_UNICODE
or:
UNICODE
during compilation.
and LIBCSPLIT_WIDE_CHARACTER_TYPE in libcsplit/features.h can be used to determine if libcsplit was compiled with wide character support. iykyk π
π BUGS π
please report bugs of any kind on the project issue tracker:
https://github.com/libyal/libcsplit/issues
fr fr, any kind. they want to hear it.
π AUTHOR π
these man pages are generated from "libcsplit.h". yeah, generated. no handwritten prose here (well... until now π
).
πΈ COPYRIGHT πΈ
Copyright (C) 2008-2024, Joachim Metz <joachim.metz@gmail.com>.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
like, none. zero. don't come for them if it breaks, bestie π«Ά
π SEE ALSO π
- the
libcsplit.hinclude file
and that's the whole page!! this one came from libcsplit, dated March 15, 2019 β mwah, go split some strings πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: libcsplit-devel 20240414-bp160.1.11 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: libcsplit-devel 20240414-bp160.1.11 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: libcsplit-devel 20240414-bp160.1.11 Β· LGPL-3.0-or-later
- opensuse-leap 16.0: libcsplit-devel 20240414-bp160.1.11 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms