Get a handle to an action in a condition in an entity
#include <ha/ham.h> ham_action_t *ham_action_handle(int nd, const char *ename, const char *cname, const char *aname, unsigned flags); ham_action_t *ham_action_handle_node(int nd, const char *nodename, const char *ename, const char *cname, const char *aname, unsigned flags);
libham
The ham_action_handle() function returns a handle to an action (aname) in a condition (cname) in an entity (ename).
You can pass the handle obtained from this function to other functions that expect a handle (e.g. ham_action_remove() or ham_action_handle_free()).
The handle returned is opaque — its contents are internal to the library.
If a node (nd) is specified, the handle is to an entity/condition/action combination that refers to a process on that remote node. The ham_action_handle_node() function is used when a nodename is used to specify a remote HAM instead of a node identifier (nd).
There are no flags defined at this time.
A valid ham_action_t or NULL if an error occurred (errno is set).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
A call to ham_action_handle() and a subsequent use of the handle returned in a call such as ham_action_remove() are completely asynchronous. Therefore, a valid action/condition/entity may no longer exist when the handle is used at a later time.
In such an event, the ham_action*() functions will return an error (ENOENT) that the action in the condition doesn't exist in the given entity.
ham_action_execute(), ham_action_handle_free(), ham_action_notify_pulse(), ham_action_notify_signal(), ham_action_remove(), ham_action_restart(), ham_action_waitfor(), ham_condition_handle(), ham_condition_handle_free(), ham_entity_handle(), ham_entity_handle_free()