libexplain  1.4.D001
Functions
libexplain/parse_bits/or_die.c File Reference
#include <libexplain/ac/stdio.h>
#include <libexplain/common_message_buffer.h>
#include <libexplain/parse_bits.h>
#include <libexplain/program_name.h>
#include <libexplain/string_buffer.h>
#include <libexplain/option.h>
#include <libexplain/output.h>

Go to the source code of this file.

Functions

int explain_parse_bits_or_die (const char *text, const explain_parse_bits_table_t *table, size_t table_size, const char *caption)

Function Documentation

int explain_parse_bits_or_die ( const char *  text,
const explain_parse_bits_table_t table,
size_t  table_size,
const char *  caption 
)

The explain_parse_bits_or_die function may be used to parse an input string against a table of bitfields. There may be symbols (from the bits table) or numeric conatsnts (using C notation) and there may be plus (+) or bit-wise-or (|) operators.

Parameters:
textThe text to be parsed.
tableThe table of symbols for the parser.
table_sizeThe lentgh of the table of symbols.
captionCaption to add to start of error message, or NULL for none
Returns:
The value of the expression. Does not return on error, but prints diagnostic and exits EXIT_FAILURE.
Note:
this function is not thread safe

Definition at line 31 of file or_die.c.