Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
strptime.c File Reference
#include "common/darktable.h"
#include <ctype.h>
#include <locale.h>
#include <string.h>
#include <time.h>
#include <stdint.h>
+ Include dependency graph for strptime.c:

Go to the source code of this file.

Macros

#define _ctloc(x)   (_CurrentTimeLocale->x)
 
#define ALT_E   0x01
 
#define ALT_O   0x02
 
#define LEGAL_ALT(x)
 
#define TIME_MAX   INT64_MAX
 

Typedefs

typedef unsigned char u_char
 
typedef unsigned int uint
 
typedef unsigned __int64 uint64_t
 

Functions

static const u_charconv_num (const unsigned char *, int *, uint, uint)
 
static const u_charfind_string (const u_char *, int *, const char *const *, const char *const *, int)
 
char * strptime (const char *buf, const char *fmt, struct tm *tm)
 

Variables

static int TM_YEAR_BASE = 1900
 
static char gmt [] = { "GMT" }
 
static char utc [] = { "UTC" }
 
static const char *const nast [5] = { "EST", "CST", "MST", "PST", "\0\0\0" }
 
static const char *const nadt [5] = { "EDT", "CDT", "MDT", "PDT", "\0\0\0" }
 
static const char *const am_pm [2] = { "am", "pm" }
 
static const char *const day [7] = { "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" }
 
static const char *const abday [7] = { "sun", "mon", "tue", "wed", "thu", "fri", "sat" }
 
static const char *const mon [12]
 
static const char *const abmon [12] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }
 

Macro Definition Documentation

◆ _ctloc

#define _ctloc (   x)    (_CurrentTimeLocale->x)

Definition at line 77 of file strptime.c.

◆ ALT_E

#define ALT_E   0x01

Definition at line 83 of file strptime.c.

◆ ALT_O

#define ALT_O   0x02

Definition at line 84 of file strptime.c.

◆ LEGAL_ALT

#define LEGAL_ALT (   x)
Value:
{ \
if(alt_format & ~(x)) return NULL; \
}
static const float x

Definition at line 85 of file strptime.c.

◆ TIME_MAX

#define TIME_MAX   INT64_MAX

Typedef Documentation

◆ u_char

typedef unsigned char u_char

Definition at line 73 of file strptime.c.

◆ uint

typedef unsigned int uint

Definition at line 74 of file strptime.c.

◆ uint64_t

typedef unsigned __int64 uint64_t

Definition at line 75 of file strptime.c.

Function Documentation

◆ conv_num()

static const u_char * conv_num ( const unsigned char *  buf,
int *  dest,
uint  llim,
uint  ulim 
)
static

Definition at line 560 of file strptime.c.

References ch.

Referenced by strptime().

◆ find_string()

static const u_char * find_string ( const u_char bp,
int *  tgt,
const char *const *  n1,
const char *const *  n2,
int  c 
)
static

Definition at line 585 of file strptime.c.

References i, and IS_NULL_PTR.

Referenced by strptime().

◆ strptime()

char * strptime ( const char *  buf,
const char *  fmt,
struct tm *  tm 
)

Definition at line 107 of file strptime.c.

References abday, abmon, ALT_E, ALT_O, am_pm, conv_num(), day, find_string(), gmt, i, IS_NULL_PTR, LEGAL_ALT, mon, nadt, nast, strptime(), TIME_MAX, TM_YEAR_BASE, and utc.

Referenced by strptime().

Variable Documentation

◆ abday

const char* const abday[7] = { "sun", "mon", "tue", "wed", "thu", "fri", "sat" }
static

Definition at line 98 of file strptime.c.

Referenced by strptime().

◆ abmon

const char* const abmon[12] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }
static

Definition at line 101 of file strptime.c.

Referenced by strptime().

◆ am_pm

const char* const am_pm[2] = { "am", "pm" }
static

Definition at line 96 of file strptime.c.

Referenced by strptime().

◆ day

const char* const day[7] = { "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" }
static

Definition at line 97 of file strptime.c.

Referenced by _db_snap_sort(), _read_datetime_entry(), _update_date(), easter(), gui_init(), and strptime().

◆ gmt

char gmt[] = { "GMT" }
static

Definition at line 91 of file strptime.c.

Referenced by dt_pdf_finish(), and strptime().

◆ mon

const char* const mon[12]
static
Initial value:
= { "january", "february", "march", "april", "may", "june",
"july", "august", "september", "october", "november", "december" }

Definition at line 99 of file strptime.c.

Referenced by enter(), and strptime().

◆ nadt

const char* const nadt[5] = { "EDT", "CDT", "MDT", "PDT", "\0\0\0" }
static

Definition at line 95 of file strptime.c.

Referenced by strptime().

◆ nast

const char* const nast[5] = { "EST", "CST", "MST", "PST", "\0\0\0" }
static

Definition at line 94 of file strptime.c.

Referenced by strptime().

◆ TM_YEAR_BASE

int TM_YEAR_BASE = 1900
static

Definition at line 90 of file strptime.c.

Referenced by strptime().

◆ utc

char utc[] = { "UTC" }
static

Definition at line 92 of file strptime.c.

Referenced by _lib_geotagging_get_timezones(), and strptime().