timedate.c File Reference

#include "frontier.h"
#include "standard.h"
#include "error.h"
#include "memory.h"
#include "strings.h"
#include "ops.h"
#include "langinternal.h"
#include "shell.h"
#include "timedate.h"

Include dependency graph for timedate.c:

Go to the source code of this file.

Data Structures

struct  tyValidationOrder
struct  tyvalidationtoken
struct  tydaterec
struct  tyvalidationerror

Defines

#define DateTimeSet_kDayOfWeek   0x0100
#define DateTimeSet_kYear   0x0040
#define DateTimeSet_kMonth   0x0020
#define DateTimeSet_kDay   0x0010
#define DateTimeSet_kHour   0x0008
#define DateTimeSet_kMinute   0x0004
#define DateTimeSet_kSecond   0x0002
#define DateTimeSet_kHundredth   0x0001
#define DurationUnit_kDays   0x0010
#define err_kTooManyNumberFields   20000
#define err_kTooFewValues   20001
#define err_kOutOfOrder   20002
#define err_kItemUsed   20003
#define err_kInvalidPunctuation   20004
#define err_kHundredthValueInvalid   20005
#define err_kSecondValueInvalid   20006
#define err_kMinuteValueInvalid   20007
#define err_kHourValueInvalid   20008
#define err_kAMorPMon24HourClock   20009
#define CharAttr_kShortDate   0x00000001
#define CharAttr_kLongDate   0x00000002
#define CharAttr_kTime   0x00000004
#define SCAN_DOW   1
#define SCAN_MONTH   2
#define SCAN_YEAR   4
#define VALTYPE_NONE   0
#define VALTYPE_KEYMONTHNAME1   1
#define VALTYPE_KEYMONTHNAME2   2
#define VALTYPE_KEYDAYNAME1   3
#define VALTYPE_KEYDAYNAME2   4
#define VALTYPE_KEYYEARNAME   5
#define VALTYPE_KEYTIMEAM   6
#define VALTYPE_KEYTIMEPM   7
#define VALTYPE_KEYTIME24   8
#define VALTYPE_CURRENCY   9
#define VALTYPE_BLANK   10
#define VALTYPE_NUMERIC   11
#define VALTYPE_PUNC   12
#define VALTYPE_NONNUMERIC   13
#define VALORDER_NUMERIC   1
#define VALORDER_FIXEDNUMERIC   2
#define VALORDER_KEYWORD   3
#define VALFLAG_ISDOLLARS   (0x1000)
#define VALFLAG_ISCENTS   (0x2000)

Typedefs

typedef tyValidationOrdertyValidationOrderPtr
typedef unsigned long tyCharacterAttributes
typedef tyvalidationtokentyvalidationtokenptr
typedef tydaterectydaterecptr
typedef tyvalidationerrortyvalidationerrorptr

Functions

boolean isLeapYear (short year)
short daysInMonth (short month, short year)
void timestamp (long *ptime)
unsigned long timenow (void)
boolean setsystemclock (unsigned long secs)
static void adjustforcurrenttimezone (unsigned long *ptime)
boolean timegreaterthan (unsigned long time1, unsigned long time2)
boolean timelessthan (unsigned long time1, unsigned long time2)
boolean timetotimestring (unsigned long ptime, bigstring bstime, boolean flwantseconds)
boolean timetodatestring (unsigned long ptime, bigstring bsdate, boolean flabbreviate)
boolean stringtotime (bigstring bsdate, unsigned long *ptime)
long datetimetoseconds (short day, short month, short year, short hour, short minute, short second)
void secondstodatetime (long secs, short *day, short *month, short *year, short *hour, short *minute, short *second)
void secondstodayofweek (long secs, short *dayofweek)
static void fixdate (tydate *date)
unsigned long nextmonth (unsigned long date)
unsigned long nextyear (unsigned long date)
unsigned long prevmonth (unsigned long date)
unsigned long prevyear (unsigned long date)
unsigned long firstofmonth (unsigned long date)
unsigned long lastofmonth (unsigned long date)
void shortdatestring (unsigned long date, bigstring bs)
void longdatestring (unsigned long date, bigstring bs)
void abbrevdatestring (unsigned long date, bigstring bs)
void getdaystring (short dayofweek, bigstring bs, boolean flFullname)
long getcurrenttimezonebias (void)

Variables

static short daysInMonthsArray [] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}


Define Documentation

#define CharAttr_kLongDate   0x00000002
 

Definition at line 82 of file timedate.c.

#define CharAttr_kShortDate   0x00000001
 

Definition at line 81 of file timedate.c.

#define CharAttr_kTime   0x00000004
 

Definition at line 83 of file timedate.c.

#define DateTimeSet_kDay   0x0010
 

Definition at line 62 of file timedate.c.

#define DateTimeSet_kDayOfWeek   0x0100
 

Definition at line 59 of file timedate.c.

#define DateTimeSet_kHour   0x0008
 

Definition at line 63 of file timedate.c.

#define DateTimeSet_kHundredth   0x0001
 

Definition at line 66 of file timedate.c.

#define DateTimeSet_kMinute   0x0004
 

Definition at line 64 of file timedate.c.

#define DateTimeSet_kMonth   0x0020
 

Definition at line 61 of file timedate.c.

#define DateTimeSet_kSecond   0x0002
 

Definition at line 65 of file timedate.c.

#define DateTimeSet_kYear   0x0040
 

Definition at line 60 of file timedate.c.

#define DurationUnit_kDays   0x0010
 

Definition at line 68 of file timedate.c.

#define err_kAMorPMon24HourClock   20009
 

Definition at line 79 of file timedate.c.

#define err_kHourValueInvalid   20008
 

Definition at line 78 of file timedate.c.

#define err_kHundredthValueInvalid   20005
 

Definition at line 75 of file timedate.c.

#define err_kInvalidPunctuation   20004
 

Definition at line 74 of file timedate.c.

Referenced by stringtotime().

#define err_kItemUsed   20003
 

Definition at line 73 of file timedate.c.

#define err_kMinuteValueInvalid   20007
 

Definition at line 77 of file timedate.c.

#define err_kOutOfOrder   20002
 

Definition at line 72 of file timedate.c.

#define err_kSecondValueInvalid   20006
 

Definition at line 76 of file timedate.c.

#define err_kTooFewValues   20001
 

Definition at line 71 of file timedate.c.

#define err_kTooManyNumberFields   20000
 

Definition at line 70 of file timedate.c.

#define SCAN_DOW   1
 

Definition at line 85 of file timedate.c.

#define SCAN_MONTH   2
 

Definition at line 86 of file timedate.c.

#define SCAN_YEAR   4
 

Definition at line 87 of file timedate.c.

#define VALFLAG_ISCENTS   (0x2000)
 

Definition at line 109 of file timedate.c.

#define VALFLAG_ISDOLLARS   (0x1000)
 

Definition at line 108 of file timedate.c.

#define VALORDER_FIXEDNUMERIC   2
 

Definition at line 105 of file timedate.c.

#define VALORDER_KEYWORD   3
 

Definition at line 106 of file timedate.c.

#define VALORDER_NUMERIC   1
 

Definition at line 104 of file timedate.c.

#define VALTYPE_BLANK   10
 

Definition at line 99 of file timedate.c.

#define VALTYPE_CURRENCY   9
 

Definition at line 98 of file timedate.c.

#define VALTYPE_KEYDAYNAME1   3
 

Definition at line 92 of file timedate.c.

#define VALTYPE_KEYDAYNAME2   4
 

Definition at line 93 of file timedate.c.

#define VALTYPE_KEYMONTHNAME1   1
 

Definition at line 90 of file timedate.c.

#define VALTYPE_KEYMONTHNAME2   2
 

Definition at line 91 of file timedate.c.

#define VALTYPE_KEYTIME24   8
 

Definition at line 97 of file timedate.c.

#define VALTYPE_KEYTIMEAM   6
 

Definition at line 95 of file timedate.c.

#define VALTYPE_KEYTIMEPM   7
 

Definition at line 96 of file timedate.c.

#define VALTYPE_KEYYEARNAME   5
 

Definition at line 94 of file timedate.c.

#define VALTYPE_NONE   0
 

Definition at line 89 of file timedate.c.

#define VALTYPE_NONNUMERIC   13
 

Definition at line 102 of file timedate.c.

#define VALTYPE_NUMERIC   11
 

Definition at line 100 of file timedate.c.

#define VALTYPE_PUNC   12
 

Definition at line 101 of file timedate.c.


Typedef Documentation

typedef unsigned long tyCharacterAttributes
 

Definition at line 54 of file timedate.c.

typedef struct tydaterec * tydaterecptr
 

typedef struct tyvalidationerror * tyvalidationerrorptr
 

typedef struct tyValidationOrder * tyValidationOrderPtr
 

typedef struct tyvalidationtoken * tyvalidationtokenptr
 


Function Documentation

void abbrevdatestring unsigned long  date,
bigstring  bs
 

Definition at line 1441 of file timedate.c.

References nil, and timetodatestring().

Referenced by langfunctionvalue().

Here is the call graph for this function:

static void adjustforcurrenttimezone unsigned long ptime  )  [static]
 

Definition at line 579 of file timedate.c.

References getcurrenttimezonebias(), and sgn.

Referenced by stringtotime().

Here is the call graph for this function:

long datetimetoseconds short  day,
short  month,
short  year,
short  hour,
short  minute,
short  second
 

Definition at line 893 of file timedate.c.

References clearbytes(), and daysInMonth().

Referenced by adddayrows(), langfunctionvalue(), mrcalendargetaddressday(), mrcalendargetfirstday(), mrcalendargetlastday(), mrcalendargetmostrecentdayverb(), mrcalendargetnextdayverb(), setiso8601datetimestring(), and stringtotime().

Here is the call graph for this function:

short daysInMonth short  month,
short  year
 

Definition at line 453 of file timedate.c.

References daysInMonthsArray, and isLeapYear().

Referenced by adddayrows(), datetimetoseconds(), fixdate(), langfunctionvalue(), lastofmonth(), nextmonth(), and prevmonth().

Here is the call graph for this function:

unsigned long firstofmonth unsigned long  date  ) 
 

Definition at line 1336 of file timedate.c.

Referenced by langfunctionvalue().

static void fixdate tydate date  )  [static]
 

Definition at line 1084 of file timedate.c.

References daysInMonth().

Referenced by nextmonth(), nextyear(), prevmonth(), and prevyear().

Here is the call graph for this function:

long getcurrenttimezonebias void   ) 
 

Definition at line 1517 of file timedate.c.

Referenced by adjustforcurrenttimezone(), datenetstandardstring(), and langfunctionvalue().

void getdaystring short  dayofweek,
bigstring  bs,
boolean  flFullname
 

Definition at line 1453 of file timedate.c.

References copyctopstring(), copystring(), tyinternationalinfo::longDaysOfWeek, NULL, setstringlength, and tyinternationalinfo::shortDaysOfWeek.

Referenced by langfunctionvalue().

Here is the call graph for this function:

boolean isLeapYear short  year  ) 
 

Definition at line 427 of file timedate.c.

Referenced by daysInMonth().

unsigned long lastofmonth unsigned long  date  ) 
 

Definition at line 1376 of file timedate.c.

References daysInMonth().

Referenced by langfunctionvalue().

Here is the call graph for this function:

void longdatestring unsigned long  date,
bigstring  bs
 

Definition at line 1429 of file timedate.c.

References nil, and timetodatestring().

Referenced by langfunctionvalue().

Here is the call graph for this function:

unsigned long nextmonth unsigned long  date  ) 
 

Definition at line 1138 of file timedate.c.

References daysInMonth(), and fixdate().

Referenced by langfunctionvalue().

Here is the call graph for this function:

unsigned long nextyear unsigned long  date  ) 
 

Definition at line 1202 of file timedate.c.

References fixdate().

Referenced by langfunctionvalue().

Here is the call graph for this function:

unsigned long prevmonth unsigned long  date  ) 
 

Definition at line 1237 of file timedate.c.

References daysInMonth(), and fixdate().

Referenced by langfunctionvalue().

Here is the call graph for this function:

unsigned long prevyear unsigned long  date  ) 
 

Definition at line 1301 of file timedate.c.

References fixdate().

Referenced by langfunctionvalue().

Here is the call graph for this function:

void secondstodatetime long  secs,
short day,
short month,
short year,
short hour,
short minute,
short second
 

Definition at line 1013 of file timedate.c.

Referenced by adddayrows(), addmonthyearrow(), datenetstandardstring(), getiso8601datetimestring(), getmonthurl(), langfunctionvalue(), mrcalendargetdayaddress(), mrcalendargetmostrecentdayverb(), and mrcalendargetnextdayverb().

void secondstodayofweek long  secs,
short dayofweek
 

Definition at line 1058 of file timedate.c.

Referenced by adddayrows(), datenetstandardstring(), and langfunctionvalue().

boolean setsystemclock unsigned long  secs  ) 
 

Definition at line 547 of file timedate.c.

References oserror().

Referenced by langfunctionvalue().

Here is the call graph for this function:

void shortdatestring unsigned long  date,
bigstring  bs
 

Definition at line 1417 of file timedate.c.

References nil, and timetodatestring().

Referenced by langfunctionvalue().

Here is the call graph for this function:

boolean stringtotime bigstring  bsdate,
unsigned long ptime
 

Definition at line 667 of file timedate.c.

boolean timegreaterthan unsigned long  time1,
unsigned long  time2
 

Definition at line 593 of file timedate.c.

Referenced by GTvalue(), and mathfunctionvalue().

boolean timelessthan unsigned long  time1,
unsigned long  time2
 

Definition at line 602 of file timedate.c.

Referenced by LTvalue().

unsigned long timenow void   ) 
 

Definition at line 533 of file timedate.c.

References now.

Referenced by agentscheduler(), coercetodate(), dirtyhashtable(), filetouchparentfolder(), fwsNetEventCloseStream(), hashunpacktable(), langdialogsleepexpired(), langfunctionvalue(), langinitbuiltins(), locksemaphoreverb(), mrcalendargetmostrecentaddressverb(), mrcalendargetmostrecentdayverb(), mrcalendargetnextaddressverb(), mrcalendargetnextdayverb(), newhashtable(), newoutlinerecord(), odbtabledirty(), opdirtyoutline(), osacomponentshutdown(), pictdirty(), pictnewrecord(), processagentsleep(), ProcessWaitingEndpoints(), stringfunctionvalue(), tabledirty(), tablenewtable(), webserverbuildresponse(), wpdirty(), and wpnewbuffer().

void timestamp long ptime  ) 
 

Definition at line 527 of file timedate.c.

boolean timetodatestring unsigned long  ptime,
bigstring  bsdate,
boolean  flabbreviate
 

Definition at line 639 of file timedate.c.

References nil, NULL, and setstringlength.

Referenced by abbrevdatestring(), getfatdatestring(), longdatestring(), shortdatestring(), stringfunctionvalue(), and timedatestring().

boolean timetotimestring unsigned long  ptime,
bigstring  bstime,
boolean  flwantseconds
 

Definition at line 610 of file timedate.c.

References nil, NULL, and setstringlength.

Referenced by getfattimestring(), stringfunctionvalue(), and timedatestring().


Variable Documentation

short daysInMonthsArray[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} [static]
 

Definition at line 57 of file timedate.c.

Referenced by daysInMonth().


Generated on Wed Jun 14 04:23:36 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6