Atrinik Server  4.0
Functions
connection.c File Reference
#include <global.h>
#include <plugin.h>
#include <object.h>
#include <object_methods.h>

Go to the source code of this file.

Functions

void connection_object_add (object *op, mapstruct *map, int connected)
 
void connection_object_remove (object *op)
 
int connection_object_get_value (const object *op)
 
static objectlinkconnection_object_links (object *op, mapstruct *map)
 
static int64_t connection_trigger_do (object *op, int state, bool button)
 
void connection_trigger (object *op, int state)
 
void connection_trigger_button (object *op, int state)
 

Detailed Description

Connection system handling.

Definition in file connection.c.

Function Documentation

void connection_object_add ( object op,
mapstruct map,
int  connected 
)

Creates a new connection.

Parameters
opObject to connect.
mapMap to create the connection on.
connectedConnection ID of the object.

Definition at line 44 of file connection.c.

int connection_object_get_value ( const object op)

Acquire the connection ID of the specified object.

Parameters
opObject to get the connection ID of.
Returns
Connection ID, or 0 if not connected.

Definition at line 125 of file connection.c.

static objectlink* connection_object_links ( object op,
mapstruct map 
)
static

Return the first objectlink in the objects linked to this one.

Parameters
opObject to get the link for.
mapMap to look at.
Returns
::objectlink for this object, or NULL.

Definition at line 145 of file connection.c.

void connection_object_remove ( object op)

Remove a connection.

Parameters
opObject to remove. Must be on a map, and connected.

Definition at line 91 of file connection.c.

void connection_trigger ( object op,
int  state 
)

Trigger an object.

Parameters
opThe object.
stateThe trigger state.

Definition at line 258 of file connection.c.

void connection_trigger_button ( object op,
int  state 
)

Trigger a button-like object.

Parameters
opThe button-like object.
stateThe trigger state.

Definition at line 272 of file connection.c.

static int64_t connection_trigger_do ( object op,
int  state,
bool  button 
)
static

Actually does the logic behind triggering a connection.

Parameters
opThe object.
stateTrigger state.
buttonIf true, we're triggering a button (called from connection_trigger_button())
Returns
If button is true, returns new state of the button, otherwise 0 is returned.

Definition at line 177 of file connection.c.