libexplain  1.4.D001
Defines | Functions | Variables
libexplain/buffer/open_flags.c File Reference
#include <libexplain/ac/fcntl.h>
#include <libexplain/buffer/open_flags.h>
#include <libexplain/parse_bits.h>
#include <libexplain/sizeof.h>
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Defines

#define O_DIRECT   0
#define O_DIRECTORY   0
#define O_NOFOLLOW   0
#define O_NOATIME   0
#define O_CLOEXEC   0
#define O_LARGEFILE   0

Functions

void explain_buffer_open_flags (explain_string_buffer_t *sb, int flags)
int explain_parse_open_flags_or_die (const char *text, const char *caption)

Variables

static const
explain_parse_bits_table_t 
table []

Define Documentation

#define O_CLOEXEC   0

Definition at line 40 of file open_flags.c.

#define O_DIRECT   0

Definition at line 28 of file open_flags.c.

#define O_DIRECTORY   0

Definition at line 31 of file open_flags.c.

#define O_LARGEFILE   0

Definition at line 51 of file open_flags.c.

#define O_NOATIME   0

Definition at line 37 of file open_flags.c.

#define O_NOFOLLOW   0

Definition at line 34 of file open_flags.c.


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.

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.


Variable Documentation

Definition at line 55 of file open_flags.c.