Timer_q documentation -- constantsSection Constants for initialisation in debuging mode |
Constant: TIMER_Q_DEBUG_INIT_BASE |
Explanation: |
This is the value that static (Timer_q_base) structs need to be initialised to when in debugging mode. |
Note: |
In non-debugging mode this value is all 0's, so this won't do anything different from just declaring your structs as static. The library will also re-initialise the base back to it's correct form before returning from timer_q_del_base, so you just need to set it up correctly the first time. |
Constant: TIMER_Q_DEBUG_INIT_NODE |
Explanation: |
This is the value that static (Timer_q_node) structs need to be initialised to when in debugging mode. |
Note: |
In non-debugging mode this value is all 0's, so this won't do anything different from just declaring your structs as static. The library will also re-initialise the node back to it's correct form before calling your call back (either for a delete or a run), so you just need to set it up correctly the first time. |
Constant: TIMER_Q_DEBUG_INIT_DOUBLE_NODE |
Explanation: |
This is the value that static (Timer_q_double_node) structs need to be initialised to when in debugging mode. |
Note: |
In non-debugging mode this value is all 0's, so this won't do anything different from just declaring your structs as static. The library will also re-initialise the node back to it's correct form before calling your call back (either for a delete or a run), so you just need to set it up correctly the first time. |
Constant: TIMER_Q_DEBUG_INIT_DOUBLE_FUNC_NODE |
Explanation: |
This is the value that static (Timer_q_func_node) structs need to be initialised to when in debugging mode. |
Note: |
In non-debugging mode this value is all 0's, so this won't do anything different from just declaring your structs as static. The library will also re-initialise the node back to it's correct form before calling your call back (either for a delete or a run), so you just need to set it up correctly the first time. |
Constant: TIMER_Q_DEBUG_INIT_FUNC_NODE |
Explanation: |
This is the value that static (Timer_q_double_func_node) structs need to be initialised to when in debugging mode. |
Note: |
In non-debugging mode this value is all 0's, so this won't do anything different from just declaring your structs as static. The library will also re-initialise the node back to it's correct form before calling your call back (either for a delete or a run), so you just need to set it up correctly the first time. |
Constants passed to the timer_q call backs |
Constant: TIMER_Q_TYPE_CALL_RUN_NORM |
Explanation: |
This is the value passed to a (Timer_q_node) call back when it is called from timer_q_run_norm(). |
Constant: TIMER_Q_TYPE_CALL_DEL |
Explanation: |
This is the value passed to a (Timer_q_node) call back when it is called from timer_q_del_node(), timer_q_del_data() or timer_q_quick_del_node(). |
Constant: TIMER_Q_TYPE_CALL_RUN_ALL |
Explanation: |
This is the value passed to a (Timer_q_node) call back when it is called from timer_q_run_all(). |
Constants you pass to the timer_q_add_base() function |
Constant: TIMER_Q_FLAG_BASE_RUN_ALL |
Explanation: |
If this flag is set on a base then when you call timer_q_run_all() all the (Timer_q_node)s call backs for that base will be called. |
Constant: TIMER_Q_FLAG_BASE_INSERT_FROM_END |
Explanation: |
If this flag is set on a base then when you call timer_q_add_node() the (Timer_q_node) will try to be added from the end of the list. |
Note: |
Regardless of this flag an insert will never traverse the list if it should be added to the beginning or the end of the list. Also this flag does nothing unless you have (Timer_q_double_node)s as it is not possible to traverse the list backwards. |
Constant: TIMER_Q_FLAG_BASE_MALLOC_DOUBLE |
Explanation: |
If this flag is set on a base then when you call timer_q_add_node() without specifying at least one of _SINGLE, _DOUBLE or _FUNC then it will act like you specified _DOUBLE. |
Constant: TIMER_Q_FLAG_BASE_MALLOC_FUNC |
Explanation: |
If this flag is set on a base then when you call timer_q_add_node() without specifying at least one of _SINGLE, _DOUBLE or _FUNC then it will act like you specified _FUNC. |
Constant: TIMER_Q_FLAG_BASE_MOVE_WHEN_EMPTY |
Explanation: |
If this flag is set on a base then when it becaomes empty it will be moved to a non checked list and when a node is added to it again it will be moved back. This means that you will get close to 0 overheard for bases that are rarely used. |
Constant: TIMER_Q_FLAG_BASE_DEFAULT |
Explanation: |
This is a default set of flags to pass to timer_q_add_base(). |
Constants you pass to the timer_q_add_node() function |
Constant: TIMER_Q_FLAG_NODE_SINGLE |
Explanation: |
This flag allows you to override the _MALLOC_DOUBE and _MALLOC_FUNC flags in the base. If you just specify only this flag you will get a normal (Timer_q_node), combining this flag with either of the next 2 is useless. |
Note: |
This flag, or one of the next 2, _must_ be used when calling timer_q_add_static_node() this makes it clear what you have passed in as the first argument of that function. |
Constant: TIMER_Q_FLAG_NODE_DOUBLE |
Explanation: |
This flag allows you to override the _MALLOC_DOUBE and _MALLOC_FUNC flags in the base. If you just specify this flag you will get a (Timer_q_node) with a prev pointer as well allowing timer_q_del_node() to operate in O(1) and allowing timer_q_add_node() to use the base option _INSERT_FROM_END. This option can be combined with the next option. |
Note: |
This flag, or one of the previous or next, _must_ be used when calling timer_q_add_static_node() this makes it clear what you have passed in as the first argument of that function. |
Constant: TIMER_Q_FLAG_NODE_FUNC |
Explanation: |
This flag allows you to override the _MALLOC_DOUBE and _MALLOC_FUNC flags in the base. If you just specify this flag you will get a (Timer_q_node) with a func pointer as well allowing you to specify a different call back for this node compared with the other nodes in the same base. This option can be combined with the previous option. |
Note: |
This flag, or one of the previous 2, _must_ be used when calling timer_q_add_static_node() this makes it clear what you have passed in as the first argument of that function. |
Constant: TIMER_Q_FLAG_NODE_DEFAULT |
Explanation: |
This is a default set of flags to pass to timer_q_add_node(). |
Constants you pass to the timer_q_cntl_node() function |
Constant: TIMER_Q_CNTL_NODE_GET_DATA |
Parameter[1]: call back data holder Type[1]: struct Timer_q_cntl_ret_void_ptr * |
Explanation: |
This option will get the current function call back data for the node. |
Constant: TIMER_Q_CNTL_NODE_SET_DATA |
Parameter[1]: call back data Type[1]: void * |
Explanation: |
This option will get the current function call back data for the node. |
Constant: TIMER_Q_CNTL_NODE_GET_FUNC |
Parameter[1]: call back holder Type[1]: struct Timer_q_cntl_ret_func_ptr * |
Explanation: |
This option will get the current function call back for the node. |
Note: |
This only succeedes if the (timer_q_node) passed is actually a (Timer_q_func_node) or a (Timer_q_double_func_node). |
Constant: TIMER_Q_CNTL_NODE_SET_FUNC |
Parameter[1]: call back Type[1]: void (*)(int, void *) |
Explanation: |
This option will set the current function call back for the node. |
Note: |
This only succeedes if the (timer_q_node) passed is actually a (Timer_q_func_node) or a (Timer_q_double_func_node). |
Constant: TIMER_Q_CNTL_NODE_GET_TIMEVAL |
Parameter[1]: timestamp holder Type[1]: struct Timer_q_cntl_ret_timeval_ptr * |
Explanation: |
This option will get the current timestamp for the node. |
Note: |
The value returned cannot be altered manually, you will have to copy it first. |
Constant: TIMER_Q_CNTL_NODE_SET_TIMEVAL |
Parameter[1]: base object Type[1]: Timer_q_base * |
Parameter[2]: timestamp Type[2]: struct timeval * |
Explanation: |
This option will set the current timestamp for the node. |
Note: |
This cntl option is not currently implemented. |
Constants you pass to the timer_q_cntl_base() function |
Constant: TIMER_Q_CNTL_BASE_GET_FUNC |
Parameter[1]: call back holder Type[1]: struct Timer_q_cntl_ret_func_ptr * |
Explanation: |
This option will get the default function call back for the base. |
Constant: TIMER_Q_CNTL_BASE_SET_FUNC |
Parameter[1]: call back Type[1]: void (*)(int, void *) |
Explanation: |
This option will set the default function call back for the base. |
Constant: TIMER_Q_CNTL_BASE_GET_FLAG_RUN_ALL |
Parameter[1]: value holder Type[1]: struct Timer_q_cntl_ret_int * |
Explanation: |
This option will get the value of the flag _RUN_ALL on the base. |
Constant: TIMER_Q_CNTL_BASE_SET_FLAG_RUN_ALL |
Parameter[1]: value Type[1]: int |
Explanation: |
This option will set the value of the flag _RUN_ALL on the base. |
Constant: TIMER_Q_CNTL_BASE_GET_FLAG_INSERT_FROM_END |
Parameter[1]: value holder Type[1]: struct Timer_q_cntl_ret_int * |
Explanation: |
This option will get the value of the flag _INSERT_FROM_END on the base. |
Constant: TIMER_Q_CNTL_BASE_SET_FLAG_INSERT_FROM_END |
Parameter[1]: value Type[1]: int |
Explanation: |
This option will set the value of the flag _INSERT_FROM_END on the base. |
Constant: TIMER_Q_CNTL_BASE_GET_FLAG_MALLOC_DOUBLE |
Parameter[1]: value holder Type[1]: struct Timer_q_cntl_ret_int * |
Explanation: |
This option will get the value of the flag _MALLOC_DOUBLE on the base. |
Constant: TIMER_Q_CNTL_BASE_SET_FLAG_MALLOC_DOUBLE |
Parameter[1]: value Type[1]: int |
Explanation: |
This option will set the value of the flag _MALLOC_DOUBLE on the base. |
Constant: TIMER_Q_CNTL_BASE_GET_FLAG_MALLOC_FUNC |
Parameter[1]: value holder Type[1]: struct Timer_q_cntl_ret_int * |
Explanation: |
This option will get the value of the flag _MALLOC_FUNC on the base. |
Constant: TIMER_Q_CNTL_BASE_SET_FLAG_MALLOC_FUNC |
Parameter[1]: value Type[1]: int |
Explanation: |
This option will set the value of the flag _MALLOC_FUNC on the base. |
Constant: TIMER_Q_CNTL_BASE_GET_FLAG_MOVE_WHEN_EMPTY |
Parameter[1]: value holder Type[1]: struct Timer_q_cntl_ret_int * |
Explanation: |
This option will get the value of the flag _MOVE_WHEN_EMPTY on the base. |
Constant: TIMER_Q_CNTL_BASE_SET_FLAG_MOVE_WHEN_EMPTY |
Parameter[1]: value Type[1]: int |
Explanation: |
This option will set the value of the flag _MOVE_WHEN_EMPTY on the base. |
Constant: TIMER_Q_CNTL_BASE_GET_FLAG_HAVE_DELETED |
Parameter[1]: value holder Type[1]: struct Timer_q_cntl_ret_int * |
Explanation: |
This option will be TRUE when the base has been deleted, this is obviously only possible with a base that has been added via. _add_static_base(). |
Note: |
This makes it possible to use _quick_del_base() on static bases. |