libcpath(3)

πŸ“¦ in opensuse-leap 16.0

πŸ’– libcpath(3) β€” Library Functions Manual, bestie edition πŸ’–

okay so welcome to the libcpath(3) page, and it is literally all about libcpath.h, the library that supports cross-platform C path functions. It’s giving β€œmake paths behave across platforms” energy, and we’re obsessed. πŸ’…


✨ NAME ✨

libcpath.h β€” Library to support cross-platform C path functions. No cap, that’s the whole name section, and it ate. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

bestie, here is the entire function lineup, with every signature exactly as it appears. Do not come for me about the line breaks β€” this is the official shape of it:

#include <libcpath.h>

Support functions

const char *
libcpath_get_version(void);

int
libcpath_get_codepage(int *codepage, libcpath_error_t **error);

int
libcpath_set_codepage(int codepage, libcpath_error_t **error);

Error functions

void
libcpath_error_free(libcpath_error_t **error);

int
libcpath_error_fprint(libcpath_error_t *error, FILE *stream);

int
libcpath_error_sprint(libcpath_error_t *error, char *string,
    size_t size);

int
libcpath_error_backtrace_fprint(libcpath_error_t *error, FILE *stream);

int
libcpath_error_backtrace_sprint(libcpath_error_t *error, char *string,
    size_t size);

Path functions

int
libcpath_path_change_directory(const char *directory_name,
    libcpath_error_t **error);

int
libcpath_path_get_current_working_directory(char **current_working_directory,
    size_t *current_working_directory_size, libcpath_error_t **error);

int
libcpath_path_get_full_path(const char *path, size_t path_length,
    char **full_path, size_t *full_path_size, libcpath_error_t **error);

int
libcpath_path_get_sanitized_filename(const char *filename,
    size_t filename_length, char **sanitized_filename,
    size_t *sanitized_filename_size, libcpath_error_t **error);

int
libcpath_path_get_sanitized_path(const char *path, size_t path_length,
    char **sanitized_path, size_t *sanitized_path_size,
    libcpath_error_t **error);

int
libcpath_path_join(char **path, size_t *path_size,
    const char *directory_name, size_t directory_name_length,
    const char *filename, size_t filename_length,
    libcpath_error_t **error);

int
libcpath_path_make_directory(const char *directory_name,
    libcpath_error_t **error);

Available when compiled with wide character string support:

int
libcpath_path_change_directory_wide(const wchar_t *directory_name,
    libcpath_error_t **error);

int
libcpath_path_get_current_working_directory_wide(wchar_t **current_working_directory,
    size_t *current_working_directory_size, libcpath_error_t **error);

int
libcpath_path_get_full_path_wide(const wchar_t *path,
    size_t path_length, wchar_t **full_path, size_t *full_path_size,
    libcpath_error_t **error);

int
libcpath_path_get_sanitized_filename_wide(const wchar_t *filename,
    size_t filename_length, wchar_t **sanitized_filename,
    size_t *sanitized_filename_size, libcpath_error_t **error);

int
libcpath_path_get_sanitized_path_wide(const wchar_t *path,
    size_t path_length, wchar_t **sanitized_path,
    size_t *sanitized_path_size, libcpath_error_t **error);

int
libcpath_path_join_wide(wchar_t **path, size_t *path_size,
    const wchar_t *directory_name, size_t directory_name_length,
    const wchar_t *filename, size_t filename_length,
    libcpath_error_t **error);

int
libcpath_path_make_directory_wide(const wchar_t *directory_name,
    libcpath_error_t **error);

🌸 DESCRIPTION 🌸

The libcpath_get_version() function is used to retrieve the library version. That’s the description, and honestly? Minimalist queen behavior. πŸ‘‘


πŸ’€ RETURN VALUES πŸ’€

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libcpath.h". So yeah, check the header for the real receipts β€” this page is not finna guess for you. 🫢


🌈 ENVIRONMENT 🌈

None β€” literally no environment variables here, bestie. Clean, unbothered, moisturised. 🧚


πŸ“ FILES πŸ“

None β€” no files, no cap. πŸ¦‹


πŸ”₯ NOTES πŸ”₯

  • libcpath can be compiled with wide character support (wchar_t). That’s the wide-character vibe check.
  • To compile libcpath with wide character support use:
./configure --enable-wide-character-type=yes

or define _UNICODE or UNICODE during compilation. Pick your fighter. ✨

  • LIBCPATH_WIDE_CHARACTER_TYPE in libcpath/features.h can be used to determine if libcpath was compiled with wide character support. iykyk.

πŸ™ˆ BUGS πŸ™ˆ

Please report bugs of any kind on the project issue tracker:

https://github.com/libyal/libcpath/issues

Not me asking you to be normal about bug reports β€” please do report them, though. The tracker is right there. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

These man pages are generated from "libcpath.h". So the header is the main character here, fr fr. ⭐


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. That’s the legal vibe, and it is serious. πŸ’…


πŸ’œ SEE ALSO πŸ’œ

the libcpath.h include file β€” that’s the whole see-also, bestie. Short, sweet, iconic. πŸŽ€


Sign-off time: this page is from libcpath, dated March 15, 2019. Stay slay, read your headers, and may all your paths be cross-platform. Mwah. πŸ’‹πŸ’–