pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJLIB Reference

Time Data Type and Manipulation.
[Operating System Dependent Functionality.Miscelaneous]


Detailed Description

This module provides API for manipulating time.

Examples

For examples, please see:


Data Structures

struct  pj_time_val
struct  pj_parsed_time

Defines

#define PJ_TIME_VAL_MSEC(t)
#define PJ_TIME_VAL_EQ(t1, t2)
#define PJ_TIME_VAL_GT(t1, t2)
#define PJ_TIME_VAL_GTE(t1, t2)
#define PJ_TIME_VAL_LT(t1, t2)
#define PJ_TIME_VAL_LTE(t1, t2)
#define PJ_TIME_VAL_ADD(t1, t2)
#define PJ_TIME_VAL_SUB(t1, t2)

Functions

pj_status_t pj_gettimeofday (pj_time_val *tv)
pj_status_t pj_time_decode (const pj_time_val *tv, pj_parsed_time *pt)
pj_status_t pj_time_encode (const pj_parsed_time *pt, pj_time_val *tv)
pj_status_t pj_time_local_to_gmt (pj_time_val *tv)
pj_status_t pj_time_gmt_to_local (pj_time_val *tv)
void pj_time_val_normalize (pj_time_val *t)


Define Documentation

#define PJ_TIME_VAL_ADD ( t1,
t2   ) 

Add t2 to t1 and store the result in t1. Effectively

this macro will expand as: (t1 += t2).

Parameters:
t1 The time value to add.
t2 The time value to be added to t1.

#define PJ_TIME_VAL_EQ ( t1,
t2   ) 

This macro will check if t1 is equal to t2.

Parameters:
t1 The first time value to compare.
t2 The second time value to compare.
Returns:
Non-zero if both time values are equal.

#define PJ_TIME_VAL_GT ( t1,
t2   ) 

This macro will check if t1 is greater than t2

Parameters:
t1 The first time value to compare.
t2 The second time value to compare.
Returns:
Non-zero if t1 is greater than t2.

#define PJ_TIME_VAL_GTE ( t1,
t2   ) 

This macro will check if t1 is greater than or equal to t2

Parameters:
t1 The first time value to compare.
t2 The second time value to compare.
Returns:
Non-zero if t1 is greater than or equal to t2.

#define PJ_TIME_VAL_LT ( t1,
t2   ) 

This macro will check if t1 is less than t2

Parameters:
t1 The first time value to compare.
t2 The second time value to compare.
Returns:
Non-zero if t1 is less than t2.

#define PJ_TIME_VAL_LTE ( t1,
t2   ) 

This macro will check if t1 is less than or equal to t2.

Parameters:
t1 The first time value to compare.
t2 The second time value to compare.
Returns:
Non-zero if t1 is less than or equal to t2.

#define PJ_TIME_VAL_MSEC (  ) 

Get the total time value in miliseconds. This is the same as multiplying the second part with 1000 and then add the miliseconds part to the result.

Parameters:
t The time value.
Returns:
Total time in miliseconds.

#define PJ_TIME_VAL_SUB ( t1,
t2   ) 

Substract t2 from t1 and store the result in t1. Effectively this macro will expand as (t1 -= t2).

Parameters:
t1 The time value to subsctract.
t2 The time value to be substracted from t1.


Function Documentation

pj_status_t pj_gettimeofday ( pj_time_val tv  ) 

Get current time of day in local representation.

Parameters:
tv Variable to store the result.
Returns:
zero if successfull.

pj_status_t pj_time_decode ( const pj_time_val tv,
pj_parsed_time pt 
)

Parse time value into date/time representation.

Parameters:
tv The time.
pt Variable to store the date time result.
Returns:
zero if successfull.

pj_status_t pj_time_encode ( const pj_parsed_time pt,
pj_time_val tv 
)

Encode date/time to time value.

Parameters:
pt The date/time.
tv Variable to store time value result.
Returns:
zero if successfull.

pj_status_t pj_time_gmt_to_local ( pj_time_val tv  ) 

Convert GMT to local time.

Parameters:
tv Time to convert.
Returns:
zero if successfull.

pj_status_t pj_time_local_to_gmt ( pj_time_val tv  ) 

Convert local time to GMT.

Parameters:
tv Time to convert.
Returns:
zero if successfull.

void pj_time_val_normalize ( pj_time_val t  ) 

Normalize the value in time value.

Parameters:
t Time value to be normalized.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
(C)2001-2008 Benny Prijono