libexplain  1.4.D001
Defines | Functions
libexplain/buffer/time_t/parse.c File Reference
#include <libexplain/ac/assert.h>
#include <libexplain/ac/ctype.h>
#include <libexplain/ac/stdio.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/buffer/time_t.h>
#include <libexplain/output.h>
#include <libexplain/sizeof.h>

Go to the source code of this file.

Defines

#define YEAR_BIT   (1 << 0)
#define MONTH_BIT   (1 << 1)
#define MDAY_BIT   (1 << 2)
#define HOUR_BIT   (1 << 3)
#define MIN_BIT   (1 << 4)
#define SEC_BIT   (1 << 5)

Functions

static int all_digits (const char *text)
static unsigned pull (const char *text, size_t len)
static int correct_year (const struct tm *build, int year)
static time_t explain_parse_time_t (const char *text)
static time_t explain_parse_time_t_on_error (const char *text, const char *caption)
time_t explain_parse_time_t_or_die (const char *text, const char *caption)

Define Documentation

#define HOUR_BIT   (1 << 3)

Definition at line 33 of file parse.c.

#define MDAY_BIT   (1 << 2)

Definition at line 32 of file parse.c.

#define MIN_BIT   (1 << 4)

Definition at line 34 of file parse.c.

#define MONTH_BIT   (1 << 1)

Definition at line 31 of file parse.c.

#define SEC_BIT   (1 << 5)

Definition at line 35 of file parse.c.

#define YEAR_BIT   (1 << 0)

Definition at line 30 of file parse.c.


Function Documentation

static int all_digits ( const char *  text) [static]

Definition at line 39 of file parse.c.

static int correct_year ( const struct tm *  build,
int  year 
) [static]

Definition at line 72 of file parse.c.

static time_t explain_parse_time_t ( const char *  text) [static]

Definition at line 89 of file parse.c.

static time_t explain_parse_time_t_on_error ( const char *  text,
const char *  caption 
) [static]

Definition at line 722 of file parse.c.

time_t explain_parse_time_t_or_die ( const char *  text,
const char *  caption 
)

The explain_parse_time_t_or_die function may be used to parse a string containing a symbolic representation of a time_t value.

Parameters:
textThe text to be parsed to extract a permission mode value.
captionadditional text to add to the start of the error message
Returns:
time_t 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 766 of file parse.c.

static unsigned pull ( const char *  text,
size_t  len 
) [static]

Definition at line 55 of file parse.c.