ELinks 0.18.0
date.c File Reference
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "elinks.h"
#include "protocol/date.h"
#include "util/conv.h"
Include dependency graph for date.c:

Macros

#define check_time(tm)    ((tm)->tm_hour <= 23 && (tm)->tm_min <= 59 && (tm)->tm_sec <= 59)
 
#define skip_time_sep(date, end)
 

Functions

int parse_year (const char **date_p, char *end)
 
int parse_month (const char **buf, char *end)
 
int parse_day (const char **date_p, char *end)
 
int parse_time (const char **time, struct tm *tm, char *end)
 
static time_t my_timegm (struct tm *tm)
 
time_t parse_date (char **date_pos, char *end, int update_pos, int skip_week_day)
 

Macro Definition Documentation

◆ check_time

#define check_time ( tm)     ((tm)->tm_hour <= 23 && (tm)->tm_min <= 59 && (tm)->tm_sec <= 59)

◆ skip_time_sep

#define skip_time_sep ( date,
end )
Value:
do { \
const char *start = (date); \
while ((!(end) || (date) < (end)) \
&& (*(date) == ' ' || *(date) == '-')) \
(date)++; \
if (date == start) return 0; \
} while (0)

Function Documentation

◆ my_timegm()

static time_t my_timegm ( struct tm * tm)
static

◆ parse_date()

time_t parse_date ( char ** date_pos,
char * end,
int update_pos,
int skip_week_day )

◆ parse_day()

int parse_day ( const char ** date_p,
char * end )

◆ parse_month()

int parse_month ( const char ** buf,
char * end )

◆ parse_time()

int parse_time ( const char ** time,
struct tm * tm,
char * end )

◆ parse_year()

int parse_year ( const char ** date_p,
char * end )