ajtime.c

Datatypes:
AjPTime Time object
none time internals


Datatype: AjPTime

Sections:
constructorsConstructors
destructorsDestructors
get timeGeneral use
get reference to internalsMiscellaneous
set timeModifiers
comparisonGeneral use
debugGeneral use
exitMiscellaneous


AjPTime: constructors

Functions for constructing time objects.

Functions:
ajTimeNewConstructor for AjPTime object.
ajTimeNewDayFmtConstructor for user specification of an arbitrary AjPTime object. Except for 'timefmt', the arguments are based upon the UNIX 'tm' time structure defined in the time.h header file. The range validity of numbers given are not checked.
ajTimeNewTimeConstructor for AjPTime object, making a copy of an existing time object
ajTimeNewTodayAJAX function to return today's time as an AjPTime object
ajTimeNewTodayFmtAJAX function to return today's time as an AjPTime object with a specified output format


Function ajTimeNew

Constructor for AjPTime object.

Prototype

AjPTime ajTimeNew (
      void
);

TypeNameRead/WriteDescription
AjPTime RETURNAn AjPTime object

From EMBOSS 2.8.0


Function ajTimeNewDayFmt

Constructor for user specification of an arbitrary AjPTime object. Except for 'timefmt', the arguments are based upon the UNIX 'tm' time structure defined in the time.h header file. The range validity of numbers given are not checked.

Prototype

AjPTime ajTimeNewDayFmt (
      const char* timefmt,
      ajint mday,
      ajint mon,
      ajint year
);

TypeNameRead/WriteDescription
const char*timefmtInputTime format to use
ajintmdayInputDay of the month [1-31]
ajintmonInputMonth [1-12]
ajintyearInputFour digit year
AjPTime RETURNAn AjPTime object

From EMBOSS 5.0.0


Function ajTimeNewTime

Constructor for AjPTime object, making a copy of an existing time object

Prototype

AjPTime ajTimeNewTime (
      const AjPTime src
);

TypeNameRead/WriteDescription
const AjPTimesrcInputTime object to be copied
AjPTime RETURNAn AjPTime object

From EMBOSS 5.0.0


Function ajTimeNewToday

AJAX function to return today's time as an AjPTime object

Prototype

AjPTime ajTimeNewToday (
      void
);

TypeNameRead/WriteDescription
AjPTime RETURNPointer to time object containing today's date/time

From EMBOSS 5.0.0


Function ajTimeNewTodayFmt

AJAX function to return today's time as an AjPTime object with a specified output format

Prototype

AjPTime ajTimeNewTodayFmt (
      const char* timefmt
);

TypeNameRead/WriteDescription
const char*timefmtInputA controlled vocabulary of time formats
AjPTime RETURNPointer to time object containing today's date/time

From EMBOSS 5.0.0


AjPTime: destructors

Functions for destroying time objects.

Functions:
ajTimeDelDestructor for AjPTime object.


Function ajTimeDel

Destructor for AjPTime object.

Prototype

void ajTimeDel (
      AjPTime* Ptime
);

TypeNameRead/WriteDescription
AjPTime*PtimeOutputTime object pointer
void RETURN

From EMBOSS 2.8.0


AjPTime: get time

Functions for retrieving elements of a time object

Functions:
ajTimeGetTimetypeAn AjPTime object version of the mktime function that returns a standard time_t value


Function ajTimeGetTimetype

An AjPTime object version of the mktime function that returns a standard time_t value

Prototype

time_t ajTimeGetTimetype (
      const AjPTime thys
);

TypeNameRead/WriteDescription
const AjPTimethysInputTime object
time_t RETURNStandard time value

From EMBOSS 5.0.0


AjPTime: get reference to internals

Functions for retrieving references to time internals

Functions:
ajTimeRefTodayAJAX function to return today's time as an AjPTime object reference
ajTimeRefTodayFmtAJAX function to return today's time as a static AjPTime object with a specified output format


Function ajTimeRefToday

AJAX function to return today's time as an AjPTime object reference

Prototype

const AjPTime ajTimeRefToday (
      void
);

TypeNameRead/WriteDescription
const AjPTime RETURNPointer to static time object containing today's date/time

From EMBOSS 5.0.0


Function ajTimeRefTodayFmt

AJAX function to return today's time as a static AjPTime object with a specified output format

Prototype

const AjPTime ajTimeRefTodayFmt (
      const char* timefmt
);

TypeNameRead/WriteDescription
const char*timefmtInputA controlled vocabulary of time formats
const AjPTime RETURNPointer to static time object containing today's date/time

From EMBOSS 5.0.0


AjPTime: set time

Functions for setting the time.

Functions:
ajTimeSetCConstructor for user specification of an AjPTime object. using the time set as a string in format yyyy-mm-dd hh:mm:ss
ajTimeSetSConstructor for user specification of an AjPTime object. using the time set as a string in format yyyy-mm-dd hh:mm:ss
ajTimeSetLocalA localtime()/localtime_r() replacement for AjPTime objects


Function ajTimeSetC

Constructor for user specification of an AjPTime object. using the time set as a string in format yyyy-mm-dd hh:mm:ss

Prototype

AjBool ajTimeSetC (
      AjPTime thys,
      const char* timestr
);

TypeNameRead/WriteDescription
AjPTimethysOutputTime object
const char*timestrInputTime in format yyyy-mm-dd hh:mm:ss
AjBool RETURNajTrue on success

From EMBOSS 5.0.0


Function ajTimeSetS

Constructor for user specification of an AjPTime object. using the time set as a string in format yyyy-mm-dd hh:mm:ss

Prototype

AjBool ajTimeSetS (
      AjPTime thys,
      const AjPStr timestr
);

TypeNameRead/WriteDescription
AjPTimethysOutputTime object
const AjPStrtimestrInputTime in format yyyy-mm-dd hh:mm:ss
AjBool RETURNajTrue on success

From EMBOSS 3.0.0


Function ajTimeSetLocal

A localtime()/localtime_r() replacement for AjPTime objects

Prototype

AjBool ajTimeSetLocal (
      AjPTime thys,
      const time_t timer
);

TypeNameRead/WriteDescription
AjPTimethysOutputTime object
const time_ttimerInputPopulated standard C time structure
AjBool RETURNtrue if successful

From EMBOSS 5.0.0


AjPTime: comparison

Functions for comparing time objects.

Functions:
ajTimeDiffDifference between two time objects


Function ajTimeDiff

Difference between two time objects

Prototype

double ajTimeDiff (
      const AjPTime thys,
      const AjPTime newtime
);

TypeNameRead/WriteDescription
const AjPTimethysInputOriginal time object
const AjPTimenewtimeInputLater time object
double RETURNDifference in seconds

From EMBOSS 6.0.0


AjPTime: debug

Functions for debugging time objects.

Functions:
ajTimeTraceDebug report on the contents of an AjPTime object


Function ajTimeTrace

Debug report on the contents of an AjPTime object

Prototype

void ajTimeTrace (
      const AjPTime thys
);

TypeNameRead/WriteDescription
const AjPTimethysInputTime object
void RETURN

From EMBOSS 1.0.0


AjPTime: exit

Functions called on exit from the program by ajExit to do any necessary cleanup and to report internal statistics to the debug file

Functions:
ajTimeExitCleans up time processing internal memory


Function ajTimeExit

Cleans up time processing internal memory

Prototype

void ajTimeExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 4.0.0


Datatype: none

Function is for processing time internals.

Sections:
resetMiscellaneous


Section: reset

Functions for memory cleanup

Functions:
ajTimeResetResets the clock time to zero


Function ajTimeReset

Resets the clock time to zero

Prototype

void ajTimeReset (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 6.1.0


Section: get cpu time

Functions for retrieving CPU time

Functions:
ajClockDiffReturns the cpu time in seconds between two clock values
ajClockNowReturns the clock time as a long even for systems where the clock_t type is 4 bytes
ajClockSecondsReturns the cpu time in seconds since the start


Function ajClockDiff

Returns the cpu time in seconds between two clock values

Prototype

double ajClockDiff (
      ajlong starttime,
      ajlong nowtime
);

TypeNameRead/WriteDescription
ajlongstarttimeInputstart time
ajlongnowtimeInputcurrent time
double RETURNTotal cpu clock time in seconds

From EMBOSS 6.1.0


Function ajClockNow

Returns the clock time as a long even for systems where the clock_t type is 4 bytes

Prototype

ajlong ajClockNow (
      void
);

TypeNameRead/WriteDescription
ajlong RETURNTotal clock ticks

From EMBOSS 6.1.0


Function ajClockSeconds

Returns the cpu time in seconds since the start

Prototype

double ajClockSeconds (
      void
);

TypeNameRead/WriteDescription
double RETURNTotal cpu clock time in seconds

From EMBOSS 6.1.0


Section: reset

Functions for CPU time memory cleanup

Functions:
ajClockResetResets the clock time to zero


Function ajClockReset

Resets the clock time to zero

Prototype

void ajClockReset (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 6.1.0