libexplain  1.4.D001
Functions
libexplain/buffer/timespec.h File Reference
#include <libexplain/string_buffer.h>

Go to the source code of this file.

Functions

void explain_buffer_timespec (explain_string_buffer_t *sb, const struct timespec *data)
void explain_buffer_timespec_array (explain_string_buffer_t *sb, const struct timespec *data, unsigned data_size)
void explain_parse_timespec_or_die (const char *text, const char *caption, struct timespec *result)

Function Documentation

void explain_buffer_timespec ( explain_string_buffer_t sb,
const struct timespec *  data 
)

The explain_buffer_timespec function may be used to print a representation of a timespec structure.

Parameters:
sbThe string buffer to print into.
dataThe timespec structure to be printed.

Definition at line 132 of file timespec.c.

void explain_buffer_timespec_array ( explain_string_buffer_t sb,
const struct timespec *  data,
unsigned  data_size 
)

The explain_buffer_timespec_array function may be used to print a representation of a timespec structure.

Parameters:
sbThe string buffer to print into.
dataThe timespec structure to be printed.
data_sizeThe number of elements in the array.

Definition at line 143 of file timespec.c.

void explain_parse_timespec_or_die ( const char *  text,
const char *  caption,
struct timespec *  result 
)

The explain_parse_timespec_or_die function is used to parse some text, to extract a timespec value. It could be a floating point number of seconds, it coule be one of the UTIME_* values, it could be free text as permitted by explain_parse_time_t

On error, ithis function does not return, but errors out using the usual libexplain error handling.

Parameters:
textThe text string to be parsed.
captionadditionl context for fatal error message, if necessary
resultwhere to put the answer on success

Definition at line 165 of file timespec.c.