2015-09-30 12:03:46 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Header file for private *at functions *
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-06-18 17:19:23 +02:00
|
|
|
/**
|
2015-09-30 12:03:46 +02:00
|
|
|
* @file private_at_functions.h
|
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
2015-06-18 17:19:23 +02:00
|
|
|
* @date 15 June 2015
|
2015-09-30 12:03:46 +02:00
|
|
|
* @brief Header file for the private replacement functions for *at functions.
|
2015-06-18 17:19:23 +02:00
|
|
|
*/
|
|
|
|
|
2015-09-30 12:03:46 +02:00
|
|
|
|
2015-06-18 17:19:23 +02:00
|
|
|
#ifndef PRIVATE_OPENAT_H_
|
|
|
|
#define PRIVATE_OPENAT_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2016-03-21 11:33:06 +01:00
|
|
|
#include "obidms.h"
|
2015-06-18 17:19:23 +02:00
|
|
|
|
2015-09-30 12:03:46 +02:00
|
|
|
#define MAX_PATH_LEN 4096 /**< Maximum length for the character string defining a
|
|
|
|
file or directory path */
|
2015-06-18 17:19:23 +02:00
|
|
|
|
|
|
|
|
2015-06-23 17:55:00 +02:00
|
|
|
/**
|
2015-09-30 12:03:46 +02:00
|
|
|
* @brief Internal function getting the full path of a file or a directory from its
|
|
|
|
* path relative to a directory file descriptor.
|
2015-06-23 17:55:00 +02:00
|
|
|
*
|
|
|
|
* @warning The returned pointer has to be freed by the caller.
|
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @param directory_file_descriptor The file descriptor for the directory to which
|
|
|
|
* path_name is relative.
|
|
|
|
* @param path_name The path name for the file or directory, relative to directory_file_descriptor.
|
2015-06-23 17:55:00 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @returns A pointer to the full path.
|
2015-09-30 12:07:13 +02:00
|
|
|
* @retval NULL if an error occurred.
|
2015-06-23 17:55:00 +02:00
|
|
|
*
|
|
|
|
* @since June 2015
|
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
|
|
|
*/
|
2016-03-21 11:33:06 +01:00
|
|
|
char* get_full_path(OBIDMS_p dms, const char* path_name);
|
2015-06-23 17:55:00 +02:00
|
|
|
|
|
|
|
|
2015-06-18 17:19:23 +02:00
|
|
|
/**
|
|
|
|
* @brief Replacement function for opendirat() : open a directory relative to a directory file descriptor.
|
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @param directory_file_descriptor The file descriptor for the directory in which the directory should be opened.
|
|
|
|
* @param path_name The path name for the directory to be opened, relative to directory_file_descriptor.
|
2015-06-18 17:19:23 +02:00
|
|
|
*
|
2015-09-30 12:03:46 +02:00
|
|
|
* @returns The file descriptor of the opened directory.
|
|
|
|
* @retval NULL if an error occurred.
|
2015-06-18 17:19:23 +02:00
|
|
|
*
|
|
|
|
* @since June 2015
|
|
|
|
* @author Celine Mercier (celine.mercier@metabarcoding.org)
|
|
|
|
*/
|
2016-03-21 11:33:06 +01:00
|
|
|
DIR* opendir_in_dms(OBIDMS_p dms, const char* path_name);
|
2015-06-18 17:19:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* PRIVATEOPENAT_H_ */
|