#ifndef _TIME_H_239be863_ #define _TIME_H_239be863_ /* This file is in the public domain. */ #include "structs.h" /* * Time-related support code. */ /* * Parse a time interval, of the "2h15m" style. Arguments are the * string to parse and an error routine (which latter is required to * throw out). Return value is the interval - in nanoseconds, that * being the smallest time units used anywhere here. */ extern TIMEINTVL timeintvl_parse(const char *, void (*)(const char *, ...)); /* * Parse a TIMESTAMP from a protocol string. Arguments are the string, * an error function (which is required to throw out), and an optional * current-time function. If the current-time function pointer is * nil, the string must be a decimal number; this form is used when * fetching. If not, the magic strings listed in the protocol doc are * supported, with the function called to get the current time (in * nanoseconds since the epoch) for them. * * Return value is the resulting TIMESTAMP. These are uninterpreted * numbers as far as the rest of the code is concerned; this is the * only routine that treats them any other way, and even that only * when the magic strings are used. */ extern TIMESTAMP timestamp_parse(const char *, void (*)(const char *, ...), unsigned long long int (*)(void)); #endif