Scroll to navigation

LIBCPATH(3) Library Functions Manual LIBCPATH(3)

NAME

libcpath.hLibrary to support cross-platform C path functions

SYNOPSIS

#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 () function is used to retrieve the library version.

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>.

ENVIRONMENT

None

FILES

None

NOTES

libcpath can be compiled with wide character support (wchar_t).

To compile libcpath with wide character support use: ./configure --enable-wide-character-type
or define: _UNICODE
or UNICODE
during compilation.

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

SEE ALSO

<libcpath.h>

AUTHORS

Joachim Metz <joachim.metz@gmail.com>

BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libcpath/issues

COPYRIGHT

Copyright (C) 2008-2026, 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.

June 24, 2026 Linux 6.4.0-150700.53.73-default