libexplain  1.4.D001
Functions
libexplain/buffer/open_flags.h File Reference
#include <libexplain/ac/stddef.h>

Go to the source code of this file.

Functions

const char * explain_open_flags (int flags)
void explain_message_open_flags (char *message, size_t message_size, int flags)
void explain_buffer_open_flags (struct explain_string_buffer_t *sb, int flags)
int explain_parse_open_flags_or_die (const char *text, const char *caption)

Function Documentation

void explain_buffer_open_flags ( struct explain_string_buffer_t sb,
int  flags 
)

The explain_buffer_open_flags function may be used to decode the flags argument to the open(2) system call into a humnan readable string, which is one representation of how it would be written by a coder.

Parameters:
sbwhere to put the constructed text. This makes it thread safe, given a suitabley safe buffer.
flagsthe flags argument passed to the open(2) system call, second argument

Definition at line 158 of file open_flags.c.

void explain_message_open_flags ( char *  message,
size_t  message_size,
int  flags 
)

The explain_message_open_flags function may be used to decode the flags argument to the open(2) system call into a humnan readable string, which is one representation of how it would be written by a coder.

Parameters:
messagewhere to put the constructed text. This makes it thread safe, given a suitabley safe buffer.
message_sizethe size of the buffer receiving the message
flagsthe flags argument passed to the open(2) system call, second argument

Definition at line 25 of file open_flags.c.

const char* explain_open_flags ( int  flags)

The explain_open_flags function may be used to decode the flags argument to the open(2) system call into a humnan readable string, which is one representation of how it would be written by a coder.

Parameters:
flagsthe flags argument passed to the open(2) system call, second argument
Returns:
pointer to string constructed in shared buffer
Note:
not thread safe because of shared buffer
int explain_parse_open_flags_or_die ( const char *  text,
const char *  caption 
)

The explain_pare_open_flags_or_die function may be used to parse a strings containing a symbolic representation of open() flags, turning it into a open flags value.

Parameters:
textThe text to be parsed to extract an open flags value.
captionadditional text to add to start of error message
Returns:
open flags value
Note:
If there is a parse error, a fatal error message is printed, and exit(EXIT_FAILURE) is called. If there is an error, this function will not return.

Definition at line 220 of file open_flags.c.