wilde@146: #ifndef PORTPATH_H wilde@146: #define PORTPATH_H wilde@146: wilde@168: #include wilde@168: wilde@146: /** wilde@146: * @file portpath.h wilde@146: * @brief Platform independent functions for file and path handling. wilde@146: * @details portpath contains functions to handle file and path names wilde@146: * in a platform independent way. The code unsing this functions wilde@146: * should be protable between GNU/Linux and Windows32 systems. wilde@146: */ wilde@146: wilde@146: /** wilde@146: * @brief portable version of dirname wilde@146: * @details return the directory component of the given path. wilde@146: * The argument path may be altered by the function. wilde@146: * @param[inout] path the pathname wilde@146: * @returns a pointer to the string containing the directory component wilde@146: */ wilde@146: char *port_dirname(char *path); wilde@146: wilde@146: /** wilde@146: * @brief portable version of realpath wilde@146: * @details return the expanded absolute pathname for the given path. wilde@146: * The buffer for the resolved path is allocated by this function and wilde@146: * should be freed by the caller. wilde@146: * @param[in] path the original pathname wilde@146: * @returns a pointer to the resolved path or NULL on error wilde@146: */ wilde@146: char *port_realpath(char *path); wilde@146: wilde@168: /** wilde@168: * @brief test if a file exists wilde@168: * @details uses a platform specific stat call to test if the given wilde@168: * file exists. wilde@168: * @param[in] path the path to the file wilde@168: * @returns true if the file exists and false otherwise wilde@168: */ wilde@168: bool port_fileexits(char *path); wilde@168: wilde@176: /** wilde@176: * @brief test if a file is a directory wilde@176: * @details uses a platform specific stat call to test if the given wilde@176: * file is an directory. wilde@176: * @param[in] path the path to the file wilde@176: * @returns true if the file is an directory and false otherwise wilde@176: */ wilde@176: bool port_isdir(char *path); wilde@176: wilde@146: #endif