OpenDNSSEC-enforcer  1.3.9
Macros | Functions
datetime.c File Reference
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include "compat.h"
#include "ksm/ksm.h"
#include "ksm/datetime.h"
#include "ksm/message.h"
#include "ksm/kmedef.h"
#include "ksm/string_util.h"
#include "ksm/string_util2.h"
Include dependency graph for datetime.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE   /* glibc2 needs this */
#define COPY1(src, srcidx, dst, dstidx)
#define COPY2(src, srcidx, dst, dstidx)
#define COPY3(src, srcidx, dst, dstidx)
#define COPY4(src, srcidx, dst, dstidx)

Functions

int DtNow (struct tm *datetime)
int DtNumeric (const char *string, struct tm *datetime)
int DtAppendTime (char *fulldt, const char *timepart)
int DtGeneral (const char *string, struct tm *datetime)
char * DtGeneralString (const char *string)
int DtParseDateTime (const char *string, struct tm *datetime)
char * DtParseDateTimeString (const char *string)
int DtIntervalSeconds (const char *text, int *interval)
void DtSecondsInterval (int interval, char *text, size_t textlen)
int DtDateDiff (const char *date1, const char *date2, int *result)
int DtXMLIntervalSeconds (const char *text, int *interval)

Macro Definition Documentation

#define _GNU_SOURCE   /* glibc2 needs this */

Definition at line 36 of file datetime.c.

#define COPY1 (   src,
  srcidx,
  dst,
  dstidx 
)
Value:
{ \
(dst)[(dstidx)] = (src)[(srcidx)];\
}

Definition at line 57 of file datetime.c.

#define COPY2 (   src,
  srcidx,
  dst,
  dstidx 
)
Value:
{ \
COPY1((src), (srcidx), (dst), (dstidx)); \
COPY1((src), (srcidx) + 1, (dst), (dstidx) + 1); \
}

Definition at line 61 of file datetime.c.

Referenced by DtGeneral(), and DtNumeric().

#define COPY3 (   src,
  srcidx,
  dst,
  dstidx 
)
Value:
{ \
COPY2((src), (srcidx), (dst), (dstidx)); \
COPY1((src), (srcidx) + 2, (dst), (dstidx) + 2); \
}

Definition at line 66 of file datetime.c.

Referenced by DtGeneral().

#define COPY4 (   src,
  srcidx,
  dst,
  dstidx 
)
Value:
{ \
COPY3((src), (srcidx), (dst), (dstidx)); \
COPY1((src), (srcidx) + 3, (dst), (dstidx) + 3); \
}

Definition at line 71 of file datetime.c.

Referenced by DtGeneral(), and DtNumeric().

Function Documentation

int DtAppendTime ( char *  fulldt,
const char *  timepart 
)

Definition at line 238 of file datetime.c.

Referenced by DtGeneral().

int DtDateDiff ( const char *  date1,
const char *  date2,
int *  result 
)

Definition at line 828 of file datetime.c.

Referenced by do_communication(), and KsmPolicyUpdateSalt().

int DtGeneral ( const char *  string,
struct tm *  datetime 
)

Definition at line 329 of file datetime.c.

References COPY2, COPY3, COPY4, DtAppendTime(), DtNumeric(), StrIsDigits(), and StrStrncpy().

Referenced by cmd_import(), DtGeneralString(), and DtParseDateTime().

char* DtGeneralString ( const char *  string)

Definition at line 480 of file datetime.c.

References DtGeneral(), KSM_TIME_LENGTH, and StrStrdup().

int DtIntervalSeconds ( const char *  text,
int *  interval 
)

Definition at line 678 of file datetime.c.

References StrStrtoi().

int DtNow ( struct tm *  datetime)

Definition at line 95 of file datetime.c.

References DtParseDateTime(), KME_TIMESHIFT, and MsgLog().

Referenced by DtParseDateTime().

int DtNumeric ( const char *  string,
struct tm *  datetime 
)

Definition at line 146 of file datetime.c.

References COPY2, and COPY4.

Referenced by DtGeneral().

int DtParseDateTime ( const char *  string,
struct tm *  datetime 
)

Definition at line 546 of file datetime.c.

References DtGeneral(), DtNow(), StrFree, StrStrdup(), StrToLower(), StrTrimL(), and StrTrimR().

Referenced by DtNow(), and DtParseDateTimeString().

char* DtParseDateTimeString ( const char *  string)
void DtSecondsInterval ( int  interval,
char *  text,
size_t  textlen 
)

Definition at line 777 of file datetime.c.

References StrStrncpy().

Referenced by KsmParameterShow().

int DtXMLIntervalSeconds ( const char *  text,
int *  interval 
)

Definition at line 928 of file datetime.c.

Referenced by cmd_genkeys(), get_conf_key_info(), ReadConfig(), and SetParamOnPolicy().