libexplain
1.4.D001
|
#include <libexplain/ac/assert.h>
#include <libexplain/ac/dirent.h>
#include <libexplain/ac/errno.h>
#include <libexplain/ac/limits.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/ac/sys/param.h>
#include <libexplain/ac/sys/stat.h>
#include <libexplain/buffer/get_current_directory.h>
#include <libexplain/buffer/gettext.h>
#include <libexplain/buffer/errno/fstat.h>
#include <libexplain/buffer/errno/stat.h>
#include <libexplain/buffer/errno/path_resolution.h>
#include <libexplain/fileinfo.h>
#include <libexplain/is_same_inode.h>
#include <libexplain/name_max.h>
Go to the source code of this file.
Functions | |
static int | recursive_pwd (explain_string_buffer_t *sb, explain_string_buffer_t *dot, const struct stat *dot_st, explain_string_buffer_t *result) |
int | explain_buffer_get_current_directory (explain_string_buffer_t *sb, char *data, size_t data_size) |
int explain_buffer_get_current_directory | ( | explain_string_buffer_t * | sb, |
char * | data, | ||
size_t | data_size | ||
) |
The explain_buffer_get_current_directory function may be used to obtain the path of the current directory, printing errors as and when they are found.
sb | The string buffer to print into. |
data | The buffer to place the generated path into, once found |
data_size | The siz eof the buffer, in bytes. |
Definition at line 234 of file get_current_directory.c.
static int recursive_pwd | ( | explain_string_buffer_t * | sb, |
explain_string_buffer_t * | dot, | ||
const struct stat * | dot_st, | ||
explain_string_buffer_t * | result | ||
) | [static] |
The recursive_pwd function is used to recursively walk up the ".." chain until "/" is reached, and then glue on the discovered directory entry names as it unwinds.
sb | The string buffer to print error messages into. |
dot | The string buffer to build the ".." chain into. |
dot_st | The file status information of the drectory entry to search ".." for. |
result | The constructed pathname as parent names are discovered. |
Definition at line 56 of file get_current_directory.c.