sampClient.c File Reference

Client callable methods. More...

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "samp.h"

Functions

void samp_notify (handle_t handle, String recipId, Map msg)
 Make a notify() call to the Hub.
List samp_notifyAll (handle_t handle, Map msg)
 Make a notifyAll() call to the Hub.
String samp_call (handle_t handle, String recipId, String msg_tag, Map msg)
 Make a call() call to the Hub.
int samp_callAll (handle_t handle, String msg_tag, Map msg)
 Make a callAll() call to the Hub.
int samp_callAndWait (handle_t handle, String recipId, String msg_tag, Map msg)
 Make a callAndWait() call to the Hub.
int samp_Reply (handle_t handle, String msg_id, Map response)
 Reply to a message.
String samp_clientName (handle_t handle, String pubId)
 Get the Client name from a pubic-id.
int samp_setErr (handle_t handle, Map resp)
 Set the error response string.
String samp_getErr (handle_t handle)
 Get the error response string.


Detailed Description

Client callable methods.

SAMPCLIENT.C -- Client callable methods.

samp_notify (handle, recipId, msg_map) list = samp_notifyAll (handle, msg_map) str = samp_call (handle, recipId, tag, msg_map) map = samp_callAll (handle, msg_tag, msg_map) map = samp_callAndWait (handle, recipId, msg_tag, msg_map) stat = samp_Reply (handle, msg_id, resp_map)

str = samp_clientName (handle, pubId) stat = samp_setErr (handle, resp_map) str = samp_getErr (handle)

Author:
Mike Fitzpatrick
Date:
7/10/11

Function Documentation

String samp_call ( handle_t  handle,
String  recipId,
String  msg_tag,
Map  msg 
)

Make a call() call to the Hub.

SAMP_CALL -- Make a call() call to the Hub

Parameters:
handle samp struct handle
recipId recipient ID
msg_tag message tag
msg message map
Returns:
message ID

References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), and Samp::trace.

Referenced by samp_sendMsg().

int samp_callAll ( handle_t  handle,
String  msg_tag,
Map  msg 
)

Make a callAll() call to the Hub.

SAMP_CALLALL -- Make a callAll() call to the Hub

Parameters:
handle samp struct handle
msg_tag message tag
msg message map
Returns:
SAMP_OK or SAMP_ERR

References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_setErr(), and Samp::trace.

Referenced by samp_Ping(), and samp_sendMsg().

int samp_callAndWait ( handle_t  handle,
String  recipId,
String  msg_tag,
Map  msg 
)

Make a callAndWait() call to the Hub.

SAMP_CALLANDWAIT -- Make a callAndWait() call to the Hub

Parameters:
handle samp struct handle
recipId recipient ID
msg_tag message tag
msg message map
Returns:
SAMP_OK or SAMP_ERR

References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), samp_setErr(), Hub::timeout, and Samp::trace.

Referenced by samp_Ping(), and samp_sendMsg().

String samp_clientName ( handle_t  handle,
String  pubId 
)

Get the Client name from a pubic-id.

SAMP_CLIENTNAME -- Get the Client name from a pubic-id.

Parameters:
handle samp struct handle
pubId public ID
Returns:
declared application name

String samp_getErr ( handle_t  handle  ) 

Get the error response string.

SAMP_GETERR -- Get the error response string.

Parameters:
handle samp struct handle
Returns:
Error text string

References Samp::errortxt.

void samp_notify ( handle_t  handle,
String  recipId,
Map  msg 
)

Make a notify() call to the Hub.

SAMP_NOTIFY -- Make a notify() call to the Hub

Parameters:
handle samp struct handle
recipId recipient ID
msg message map
Returns:
nothing

References Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), and samp_nullResponse().

Referenced by samp_sendMsg().

List samp_notifyAll ( handle_t  handle,
Map  msg 
)

Make a notifyAll() call to the Hub.

SAMP_NOTIFYALL -- Make a notifyAll() call to the Hub

Parameters:
handle samp struct handle
msg message map
Returns:
nothing

References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, and Samp::trace.

Referenced by samp_sendMsg().

int samp_Reply ( handle_t  handle,
String  msg_id,
Map  response 
)

Reply to a message.

SAMP_REPLY -- Reply to a message. All we do here is send the reply message, we require that the response Map already be defined.

Parameters:
handle samp struct handle
msg_id message ID
response response map
Returns:
SAMP_OK or SAMP_ERR

References Samp::hub, hub, Hub::id, Hub::privateKey, and samp_nullResponse().

Referenced by samp_receiveCall().

int samp_setErr ( handle_t  handle,
Map  resp 
)

Set the error response string.

SAMP_SETERR -- Set the error response string/code.

Parameters:
handle samp struct handle
resp Response map
Returns:
SAMP_OK or SAMP_ERR

References Samp::errortxt.

Referenced by samp_callAll(), samp_callAndWait(), samp_Ping(), and samp_sendMsg().


Generated on Wed Feb 27 21:10:15 2013 for SAMP Client Library by  doxygen 1.5.9