aura  0.1
 All Data Structures Functions Variables Modules Pages
The basics

Functions

struct aura_node * aura_open (const char *name, const char *opts)
 
void aura_close (struct aura_node *node)
 
static void aura_set_userdata (struct aura_node *node, void *udata)
 
static void * aura_get_userdata (struct aura_node *node)
 
static int aura_get_status (struct aura_node *node)
 

Detailed Description

This documentation describes only the C API and aura's internal stuff. If you are looking for documentation on lua bindings - it's not here. See luadoc.

TODO: Describe that we need to include <aura/aura.h>, pkg-config and the rest of the stuff

You start working with aura by opening a node using aura_open() or aura_vopen(). struct aura_node represents a remote device connected via some transport. The transport layer is irrelevant here. Opening a node does NOT mean that the node is immediately ready to accept calls - opening only starts the process of connecting to a node which may take a little time depending on the transport. Even more, a node can go offline and online multiple times and normally this doesn't cause an application to terminate (although, you can always do so).

You can associate your own data with a node using aura_set_userdata() and retrieve the pointer with aura_get_userdata()

When you are done working with the node, you just call aura_close() and all the memory is freed. Simple, huh? Get over to to the next section to learn how to do something useful with a node apart from opening and closing.

Function Documentation

void aura_close ( struct aura_node *  node)

Close the node and free memory.

Parameters
node

Definition at line 102 of file aura.c.

References aura_eventloop_del(), aura_eventloop_destroy(), and aura_eventloop_get_data().

static int aura_get_status ( struct aura_node *  node)
inlinestatic

Retrieve current node status.

Parameters
node
Returns

Definition at line 41 of file inlines.h.

static void* aura_get_userdata ( struct aura_node *  node)
inlinestatic

Get user data associated with this node. See aura_set_userdata()

Parameters
node

Definition at line 28 of file inlines.h.

struct aura_node* aura_open ( const char *  name,
const char *  opts 
)

Open a remote node. Transport arguments are passed in a variadic fasion. The number and format is transport-dependent.

Parameters
nametransport name
optstransport-specific options. Refer to transport docs for details
Returns
node instance or NULL

Definition at line 34 of file aura.c.

static void aura_set_userdata ( struct aura_node *  node,
void *  udata 
)
inlinestatic

Set user data associated with this node. Just a convenient way to attach an arbitary pointer to this node. See aura_get_userdata()

Parameters
node
udata

Definition at line 17 of file inlines.h.