Papageno
An Advanced Pattern Matching Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Functions
ppg_time.h File Reference
#include "ppg_settings.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  PPG_Time_Manager
 A collection of functions for time handling. More...
 

Typedefs

typedef void(* PPG_Time_Fun )(PPG_Time *time)
 Function type of a callback that computes the current time. More...
 
typedef void(* PPG_Time_Difference_Fun )(PPG_Time time1, PPG_Time time2, PPG_Time *delta)
 Function type of a callback that computes differences between time values. More...
 
typedef
PPG_Time_Comparison_Result_Type(* 
PPG_Time_Comparison_Fun )(PPG_Time time1, PPG_Time time2)
 Function type for time comparisons. More...
 

Functions

void ppg_time_manager_init (PPG_Time_Manager *time_manager)
 Initializes a time manager.
 
PPG_Time_Manager ppg_global_set_time_manager (PPG_Time_Manager time_manager)
 Sets a new global time manager. More...
 
PPG_Time_Manager ppg_global_get_time_manager (void)
 Retreives the currently active global time manager. More...
 

Typedef Documentation

typedef PPG_Time_Comparison_Result_Type(* PPG_Time_Comparison_Fun)(PPG_Time time1, PPG_Time time2)

Function type for time comparisons.

The function is expected to return a positive value when time1 is greater time2, a negative value it time 1 is less time 2 and zero if both are equal.

Parameters
time1The first time value
time2The second time value
typedef void(* PPG_Time_Difference_Fun)(PPG_Time time1, PPG_Time time2, PPG_Time *delta)

Function type of a callback that computes differences between time values.

The result is expected as time2 - time1.

Parameters
time1The first time value
time2The second time value
deltaPointer to the result of the difference computation
typedef void(* PPG_Time_Fun)(PPG_Time *time)

Function type of a callback that computes the current time.

Parameters
Thepointer to the time value to receive current time

Function Documentation

PPG_Time_Manager ppg_global_get_time_manager ( void  )

Retreives the currently active global time manager.

Returns
The currently active global time manager
PPG_Time_Manager ppg_global_set_time_manager ( PPG_Time_Manager  time_manager)

Sets a new global time manager.

Parameters
time_managerThe new time manager
Returns
The previously used time manager