Bienvenue sur le site de la LibLapin.
Jetez un coup d'oeil en bas de la page pour choisir votre niveau de documentation en fonction de votre niveau avec la LibLapin.
Pour l'instant, c'est réglé sur 'Manuel complet'. Si c'est votre première fois avec la LibLapin, il vaudrait mieux choisir 'Débutant'.
De même, n'oubliez pas de préciser une version de la bibliothèque.
Asynclock
The asynclock module header is lapin/asynclock.h
Description
  A timestamp in nanoseconds.
INDEX
Description
  Return the system time.
Return value
The system time under the form of a timestamp with nanosecond precision.
INDEX
Description
  Wait until the sent delay expire. In microseconds.
Return value
The difference between the effectively wait time and the one that was
requested. This may happen if a signal interrupt the program. In most
case, 0 is returned.
INDEX
Description
  Wait until the sent delay expire. In nanoseconds.
Return value
The difference between the effectively wait time and the one that was
requested. This may happen if a signal interrupt the program. In most
case, 0 is returned.
INDEX
Description
  Return the difference between both time.
Return value
The difference between both time.
INDEX
typedef enum e_bunny_call_order
{
 
BCO_BEFORE_LOOP_MAIN_FUNCTION,
 
BCO_AFTER_LOOP_MAIN_FUNCTION
}
t_bunny_align;
INDEX
Description
  This function will be called when its matching trap occurs.
It will receive informations about the trap and also arbitrary value.
You can safely delete the sent trap with
bunny_delete_trap, it will
not cause any trouble: it will only be marked for suppression and
be deleted when it is possible.
INDEX
Description
  This structure is partially abstract. The only editable fields
are the function called when the trap happen and the arbitrary data
that is sent.
This structure represents a trap: an event that occurs under condition
of pace.
Attributes
-
const char _private[3 * sizeof(void*)]:
  A private field that you must not modify or it may make your program crash.
-
const double start_time:
  Start time is a date we must reach before the event can occurs.
There is some special features that are described in bunny_new_trap manual.
-
const double duration:
  Duration is a duration after start time during the event
can occur.
There is some special features that are described in bunny_new_trap manual.
-
t_bunny_trap_function function:
  The function that is called when the trap occurs.
It is defined when the trap is created.
-
void *additional_param:
  The third parameter sent to the function which is called when the trap occurs.
It is defined when the trap is created.
INDEX
Parameters
-
t_bunny_trap_function function:
  A function to call when the configured condition is fulfilled.
-
t_bunny_call_order order:
  Configure if the function is called before or after
the function set by bunny_set_loop_main_function.
-
double start_time:
  The parameter start_time is in second when the trap
can start to act, if it is positive.
  If start_time is negative or zero, then instead
of waiting a specific time to happen, the trap will wait
that any other trap before him made their business.
-
double duration:
  If start_time is positive, then the parameter act this way:
-
If duration is superior to 0, each loop if the current time
is between start_time and tart_time + duration, the
sent function is called.
-
If duration is 0 or really close, the function will be called
a single time after start_time and then never called again.
-
If duration is negative, then the function will be called
every -duration seconds if the curent time is greater than start_time.
  If $start_time is negative, it works the same way, except that
there is no other start_time than where there is no more trap awaiting.
-
void *param:
  A parameter that will be sent as third parameter of function.
Error values and logs
On error, bunny_errno is set to:
Logs written by this function are tagged with the "asynclock" label.
INDEX
Description
  Delete the sent trap from the system.
Actually, it does not delete it but mark it for deletion.
The function
bunny_asynclock will delete it itself when browsing
traps and seeing it is marked.
INDEX
Description
  Browse traps are call associated functions if matching conditions
are fulfilled.
Return value
Returns how my traps are still registered.
INDEX
Description
  Set the bunny clock (the inside time counter which is synchronised
with the event loop) to the current real time and return it.
Return value
Return the current real time in seconds.
INDEX
Description
  Return the bunny clock (the inside time counter which is synchronised
with the event loop).
Return value
Return the current bunny clock, in seconds.
INDEX