0010 /IF NOT DEFINED(RTK_RPGTIME) 0020 /DEFINE RTK_RPGTIME 0030 /COPY QCPYSRC,DATATYPE ** NOTE: OMIT EVERYTHING ABOVE THIS LINE IF THE ** OS/400 Release level is earlier than V3R7 ** *********************************************************************** ** Variables and structures for the C TIME interface prototypes *********************************************************************** 0040 D size_t S Like(int4) *********************************************************************** ** ASCTIME ** ** Returns the date/time as an ascii string (EBCDIC on AS/400) ** ** --------------------------------------------------------------- ** .....D*ame+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++++ 0050 D asctime PR * Extproc('asctime') 0060 D struct_tm const like(TM) *********************************************************************** ** MKTIME ** ** Converts a TM structure to a TIME_T value ** --------------------------------------------------------------- ** .....D*ame+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++++ 0070 D mktime PR 10I 0 Extproc('mktime') 0080 D struct_tm like(TM) *********************************************************************** ** STRFTIME ** ** Returns the date/time as an ascii string based on user-supplied ** ** format codes. These codes are case-sensitive and include: ** ** %a Abbreviated weekday name. 'Tue', 'Wed', etc. ** ** %A Full weekday name. ** ** %b Abbreviated month name. 'Jan', 'Feb', etc. ** ** %B Full month name. ** ** %c Date and time formatted for local environment. ** ** %d Day of month as a decimal number (01 to 31) ** ** %H Hour in 24-hour clock format (01 to 24). ** ** %I Hour in 12-hour clock format (01 12). ** ** %j Day of the year as a decimal number (001 to 366) ** ** %m Month number as a decimal number (01 to 12) ** %M Minute as a decimal number (00 to 59) ** %p AM/PM indicator for 12-hour clock. ** %S Second as a decimal number (00 to 59) ** %U Week as a decimal number with Sunday base (00 to 51) ** %w Weekday as a decimal number with Sunday base (1 to 6) ** %W Week as a decimal number with Monday base (00 to 51) ** %x Date editted for local location. ** %X Time editted for local location. ** %y Year without century as a decimal number (00 to 99) ** %Y Year with century as a decimal number ** %Z Time zone name or abbreviation. ** %% Embeds the percent sign into the string. ** --------------------------------------------------------------- ** 0090 D strFTime PR Extproc('strftime') like(int) 0100 D szTarget 256A options(*VARSIZE) 0110 D nTargetLen value Like(size_t) 0120 D szFormat * value options(*string) 0130 D struct_tm const like(tm) *********************************************************************** ** CTIME ** ** Returns time as a character string pointer. ** --------------------------------------------------------------- ** 0140 D ctime PR * Extproc('ctime') 0150 D timet const Like(time_t) *********************************************************************** ** LOCALTIME ** ** Returns the local time TM structure from a TIME_T structure ** --------------------------------------------------------------- ** 0160 D localtime PR * Extproc('localtime') 0170 D timet const Like(time_t) *********************************************************************** ** TIME ** Initializes the TIME_T structure with the current time ** --------------------------------------------------------------- ** 0180 D time PR 10I 0 Extproc('time') 0190 D timet Like(time_t) *********************************************************************** ** pTIME_T Pointer to TIME_T structure ** TIME_T Structure ** --------------------------------------------------------------- ** 0200 D pTime_t S * inz(%addr(time_t)) 0210 D time_t S 10I 0 *********************************************************************** ** pTM Pointer to TM structure ** TM Structure ** tm_sec Seconds (0 to 59) ** tm_min Minutes (0 to 59) ** tm_hour Hour (0 to 23) ** tm_mday Day of the month (1 to 31) ** tm_mon Month (0 to 11) ** tm_year Year minus 1900 e.g., 1999 = 99; 2001 = 1001 ** tm_wday Day of the week (0 to 6) Sunday = 0 ** tm_yday Day of the year (0 to 365) January 1 = 0 ** tm_isdst Daylight savings time is in effect 1 = Yes; 0 = No ** 1 = DST 0 = Not DST -1 = N/A ** --------------------------------------------------------------- ** .....D*ame+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++++ 0220 D pTM S Like(ptr) 0230 D tm DS based(pTM) 0240 D tm_sec Like(int4) 0250 D tm_min Like(int4) 0260 D tm_hour Like(int4) 0270 D tm_mday Like(int4) 0280 D tm_mon Like(int4) 0290 D tm_year Like(int4) 0300 D tm_wday Like(int4) 0310 D tm_yday Like(int4) 0320 D tm_isdst Like(int4) 0330 /ENDIF