libexplain  1.4.D001
Functions
libexplain/buffer/access_mode.h File Reference

Go to the source code of this file.

Functions

void explain_buffer_access_mode (struct explain_string_buffer_t *sb, int mode)
int explain_access_mode_parse (const char *text)
int explain_access_mode_parse_or_die (const char *text, const char *caption)

Function Documentation

int explain_access_mode_parse ( const char *  text)

The explain_access_mode_parse function may be used to parse a C-like expression string, into an access(2) mode argument.

Parameters:
textThe text to be parsed.
Returns:
int; access mode on success, -1 on failure

Definition at line 48 of file access_mode.c.

int explain_access_mode_parse_or_die ( const char *  text,
const char *  caption 
)

The explain_access_mode_parse_or_die function may be used to parse a C-like expression string, into an access(2) mode argument. If string is not valie, issues a diagnostic and exits EXIT_FAILURE.

Parameters:
textThe text to be parsed.
captionCaption for error message, or NULL for none.
Returns:
the access mode

Definition at line 59 of file access_mode.c.

void explain_buffer_access_mode ( struct explain_string_buffer_t sb,
int  mode 
)

The explain_buffer_access_mode function may be used to emit a human readable representation of an access mode.

Parameters:
sbThe string buffer to print into.
modeThe access(2) mode to encode.

Definition at line 38 of file access_mode.c.