Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

Time Routines


Data Structures

struct  apr_time_exp_t

Defines

#define APR_TIME_C(val)   APR_INT64_C(val)
#define APR_TIME_T_FMT   APR_INT64_T_FMT
#define APR_USEC_PER_SEC   APR_TIME_C(1000000)
#define apr_time_sec(time)   ((time) / APR_USEC_PER_SEC)
#define apr_time_usec(time)   ((time) % APR_USEC_PER_SEC)
#define apr_time_msec(time)   (((time) / 1000) % 1000)
#define apr_time_as_msec(time)   ((time) / 1000)
#define apr_time_from_sec(sec)   ((apr_time_t)(sec) * APR_USEC_PER_SEC)
#define apr_time_make(sec, usec)
#define APR_RFC822_DATE_LEN   (30)
#define APR_CTIME_LEN   (25)

Typedefs

typedef apr_int64_t apr_time_t
typedef apr_int64_t apr_interval_time_t
typedef apr_int32_t apr_short_interval_time_t
typedef apr_time_exp_t apr_time_exp_t

Functions

 APR_DECLARE (apr_time_t) apr_time_now(void)
 APR_DECLARE (apr_status_t) apr_time_ansi_put(apr_time_t *result
 APR_DECLARE (void) apr_sleep(apr_interval_time_t t)

Variables

APR_DECLARE_DATA const char apr_month_snames [12][4]
APR_DECLARE_DATA const char apr_day_snames [7][4]
time_t input
apr_time_t apr_int32_t offs
apr_time_t t
apr_size_t * retsize
apr_size_t apr_size_t max
apr_size_t apr_size_t const
char * 
format
apr_size_t apr_size_t const
char apr_time_exp_t
tm
const char * input

Define Documentation

#define APR_CTIME_LEN   (25)
 

length of a CTIME date

Definition at line 206 of file apr_time.h.

Referenced by child_errfn(), log_error_core(), log_script(), log_scripterror(), and mprint().

#define APR_RFC822_DATE_LEN   (30)
 

length of a RFC822 Date

Definition at line 194 of file apr_time.h.

Referenced by add_auth_info(), AP_CORE_DECLARE_NONSTD(), ap_proxy_ftp_handler(), basic_http_header(), file_cache_handler(), and set_expiration_fields().

#define apr_time_as_msec time   )     ((time) / 1000)
 

Returns:
apr_time_t as a msec

Definition at line 73 of file apr_time.h.

Referenced by APR_DECLARE().

#define APR_TIME_C val   )     APR_INT64_C(val)
 

mechanism to properly type apr_time_t literals

Definition at line 50 of file apr_time.h.

Referenced by get_system_time().

#define apr_time_from_sec sec   )     ((apr_time_t)(sec) * APR_USEC_PER_SEC)
 

Returns:
a second as an apr_time_t

Definition at line 76 of file apr_time.h.

Referenced by add_cookie(), AP_DECLARE(), CACHE_DECLARE(), child_main(), cleanup_nonchild_process(), connect_to_daemon(), create_listener_thread(), do_write(), init_server_config(), main(), make_child(), make_cookie(), mprint(), read_write(), rfc1413_connect(), set_expiration_fields(), set_keep_alive_timeout(), set_nonce_lifetime(), set_proxy_timeout(), set_timeout(), sleep_one(), start_threads(), test_pipe_writefull(), and unique_id_global_init().

#define apr_time_make sec,
usec   ) 
 

Value:

((apr_time_t)(sec) * APR_USEC_PER_SEC \
                                + (apr_time_t)(usec))
Returns:
a second and usec combination as an apr_time_t

Definition at line 79 of file apr_time.h.

Referenced by join_workers().

#define apr_time_msec time   )     (((time) / 1000) % 1000)
 

Returns:
apr_time_t as a msec

Definition at line 70 of file apr_time.h.

#define apr_time_sec time   )     ((time) / APR_USEC_PER_SEC)
 

Returns:
apr_time_t as a second

Definition at line 64 of file apr_time.h.

Referenced by AP_DECLARE(), APR_DECLARE(), APR_HOOK_STRUCT(), CACHE_DECLARE(), cached_explode(), check_nonce(), display_info(), log_request_duration(), log_request_time(), main(), output_html_results(), output_results(), set_expiration_fields(), status_handler(), test(), test_ctime(), and test_exp_lt().

#define APR_TIME_T_FMT   APR_INT64_T_FMT
 

mechanism to properly print apr_time_t values

Definition at line 53 of file apr_time.h.

Referenced by header_request_duration(), header_request_time(), log_request_duration(), log_request_duration_microseconds(), main(), make_cookie(), MDTimeTrial(), output_html_results(), output_results(), and set_expiration_fields().

#define apr_time_usec time   )     ((time) % APR_USEC_PER_SEC)
 

Returns:
apr_time_t as a usec

Definition at line 67 of file apr_time.h.

Referenced by APR_DECLARE(), cached_explode(), output_html_results(), output_results(), unique_id_child_init(), and unique_id_global_init().

#define APR_USEC_PER_SEC   APR_TIME_C(1000000)
 

number of microseconds per second

Definition at line 61 of file apr_time.h.

Referenced by AP_DECLARE(), ap_proxy_ftp_handler(), APR_DECLARE(), apr_wait_for_io_or_timeout(), child_main(), clear_all_signalled(), create_listener_thread(), explode_time(), join_workers(), main(), make_child(), nomessage(), recv_1_send_0(), recv_2_send_1(), recv_large_pollarray(), send_2(), send_2_signaled_1(), send_large_pollarray(), ssl_pphrase_Handle(), start_threads(), test_exp_get_gmt(), test_exp_get_lt(), and test_now().


Typedef Documentation

typedef apr_int64_t apr_interval_time_t
 

intervals for I/O timeouts, in microseconds

Definition at line 56 of file apr_time.h.

typedef apr_int32_t apr_short_interval_time_t
 

short interval for I/O timeouts, in microseconds

Definition at line 58 of file apr_time.h.

typedef struct apr_time_exp_t apr_time_exp_t
 

See also:
apr_time_exp_t

Definition at line 88 of file apr_time.h.

typedef apr_int64_t apr_time_t
 

number of microseconds since 00:00:00 january 1, 1970 UTC

Definition at line 46 of file apr_time.h.


Function Documentation

APR_DECLARE void   ) 
 

Register an other_child -- a child associated to its registered maintence callback. This callback is invoked when the process dies, is disconnected or disappears.

Parameters:
proc The child process to register.
maintenance maintenance is a function that is invoked with a reason and the data pointer passed here.
data Opaque context data passed to the maintenance function.
write_fd An fd that is probed for writing. If it is ever unwritable then the maintenance is invoked with reason OC_REASON_UNWRITABLE.
p The pool to use for allocating memory.
Bug:
write_fd duplicates the proc->out stream, it's really redundant and should be replaced in the APR 1.0 API with a bitflag of which proc->in/out/err handles should be health checked.

no platform currently tests the pipes health.

Definition at line 131 of file apr_pools.c.

APR_DECLARE apr_status_t   ) 
 

convert an ansi time_t to an apr_time_t

Parameters:
result the resulting apr_time_t
input the time_t to convert

Definition at line 24 of file netware/dso.c.

References apr_pcalloc, and APR_SUCCESS.

APR_DECLARE apr_time_t   ) 
 

Returns:
the current time

Definition at line 73 of file unix/time.c.


Variable Documentation

APR_DECLARE_DATA const char apr_day_snames[7][4]
 

day names

Definition at line 37 of file unix/timestr.c.

Referenced by ap_proxy_date_canon(), apr_ctime(), APR_DECLARE(), apr_rfc822_date(), dav_format_time(), make_cookie(), and print_time().

APR_DECLARE_DATA const char apr_month_snames[12][4]
 

month names

Definition at line 33 of file unix/timestr.c.

Referenced by ap_proxy_date_canon(), apr_ctime(), APR_DECLARE(), apr_rfc822_date(), dav_format_time(), log_request_time(), and make_cookie().

apr_size_t apr_size_t const char* format
 

Definition at line 227 of file apr_time.h.

const unsigned char * input
 

Definition at line 106 of file apr_sha1.h.

Referenced by apply_rewrite_cond(), child_main(), imap_handler_internal(), read_write_notimeout(), and test_strtok().

apr_time_exp_t* input
 

Definition at line 184 of file apr_time.h.

apr_size_t apr_size_t max
 

Definition at line 227 of file apr_time.h.

apr_time_t apr_int32_t offs
 

Definition at line 141 of file apr_time.h.

apr_size_t* retsize
 

Definition at line 227 of file apr_time.h.

apr_time_t t
 

Definition at line 217 of file apr_time.h.

apr_size_t apr_size_t const char apr_time_exp_t* tm
 

Definition at line 227 of file apr_time.h.

Referenced by ap_proxy_ftp_handler(), apr_strftime(), err_output(), explode_time(), gm_timestr_822(), gm_timestr_850(), gm_timestr_ccc(), lookup_variable(), main(), ServiceDlgProc(), ssl_var_lookup(), and test_exp_lt().