libexplain  1.4.D001
Data Structures | Defines | Typedefs | Functions
libexplain/buffer/errno/path_resolution.h File Reference
#include <libexplain/have_permission.h>
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Data Structures

struct  explain_final_t

Defines

#define must_be_a_directory(fcp)   (fcp->must_be_a_st_mode && fcp->st_mode == S_IFDIR)

Typedefs

typedef struct explain_final_t explain_final_t

Functions

void explain_final_init (explain_final_t *final_component)
int explain_buffer_errno_path_resolution (explain_string_buffer_t *sb, int errnum, const char *pathname, const char *pathname_caption, const explain_final_t *final_component)
int explain_buffer_errno_path_resolution_at (explain_string_buffer_t *sb, int errnum, int fildes, const char *pathname, const char *pathname_caption, const explain_final_t *final_component)

Define Documentation

#define must_be_a_directory (   fcp)    (fcp->must_be_a_st_mode && fcp->st_mode == S_IFDIR)

Definition at line 122 of file path_resolution.h.


Typedef Documentation

Definition at line 26 of file path_resolution.h.


Function Documentation

int explain_buffer_errno_path_resolution ( explain_string_buffer_t sb,
int  errnum,
const char *  pathname,
const char *  pathname_caption,
const explain_final_t final_component 
)

The explain_buffer_errno_path_resolution function may be used to check a path for problems.

Parameters:
sbThe string buffer to write the error to, once it is found
errnumThe error number expected.
pathnameThe path being checked.
pathname_captionThe name of the argument being checked in the function arguments of the system call being deciphered.
final_componentFlags controlling the final component
Returns:
0 on success, meaning it found an error and wrote it to sb; -1 on failure, meaning it didn't find an error or it didn't find the expected error.

Definition at line 952 of file path_resolution.c.

int explain_buffer_errno_path_resolution_at ( explain_string_buffer_t sb,
int  errnum,
int  fildes,
const char *  pathname,
const char *  pathname_caption,
const explain_final_t final_component 
)

The explain_buffer_errno_path_resolution_at function may be used to check a path for problems.

Parameters:
sbThe string buffer to write the error to, once it is found
errnumThe error number expected.
fildesThe directory file descriptor that relative file names are relative to.
pathnameThe path being checked.
pathname_captionThe name of the argument being checked in the function arguments of the system call being deciphered.
final_componentFlags controlling the final component
Returns:
0 on success, meaning it found an error and wrote it to sb; -1 on failure, meaning it didn't find an error or it didn't find the expected error.

Definition at line 28 of file path_resolution_at.c.

void explain_final_init ( explain_final_t final_component)

The explain_final_init function is used to initialise all of the members of a explain_final_t struct to their defaults (usually 0).

Parameters:
final_componentPointer to struct to be initialised.

Definition at line 1992 of file path_resolution.c.