#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include "samp.h"
Functions | |
int | samp_Register (handle_t handle) |
Register with the Hub using the currently stored metadata. | |
int | samp_UnRegister (handle_t handle) |
Un-Register from the hub. | |
int | samp_DeclareMetadata (handle_t handle) |
(Re)Declare all of our metadata. | |
int | samp_Ping (handle_t handle, String appName) |
Ping the hub/app to see if it is alive (returns >0). | |
Map | samp_GetMetadata (handle_t handle, String pubId) |
Get the metadata for a specified app. | |
int | samp_DeclareSubscriptions (handle_t handle) |
Declare the messages we're interested in. | |
Map | samp_GetSubscriptions (handle_t handle, String pubId) |
List | samp_GetRegisteredClients (handle_t handle) |
Get public-ids of the registered clients. | |
List | samp_GetSubscribedClients (handle_t handle, String mtype) |
Get clients matching the mtype subscription. |
SAMPCOMMANDS.C -- SAMP commands used by app to send administrative messages.
stat = samp_Register (handle) stat = samp_UnRegister (handle) stat = samp_DeclareMetadata (handle) stat = samp_Ping (handle, appName) map = samp_GetMetadata (handle, pubId) samp_DeclareSubscriptions (handle) map = samp_GetSubscriptions (handle) list = samp_GetRegisteredClients (handle) list = samp_GetSubscribedClients (handle, mtype)
int samp_DeclareMetadata | ( | handle_t | handle | ) |
(Re)Declare all of our metadata.
SAMP_DECLAREMETATA -- (Re)Declare all of our metadata.
handle | samp struct handle |
References Samp::hub, hub, and samp_hubDeclareMetadata().
int samp_DeclareSubscriptions | ( | handle_t | handle | ) |
Declare the messages we're interested in.
SAMP_DECLARESUBSCRIPIONS -- Declare the messages we're interested in.
handle | samp struct handle |
References Samp::hub, hub, and samp_hubDeclareSubscriptions().
Referenced by samp_Unsubscribe().
Get the metadata for a specified app.
SAMP_GETMETADATA -- Get the metadata for a specified app.
handle | samp struct handle | |
pubId | App public-id |
References Samp::errortxt, Samp::hub, hub, Hub::id, and Hub::privateKey.
Referenced by samp_mapClients().
List samp_GetRegisteredClients | ( | handle_t | handle | ) |
Get public-ids of the registered clients.
SAMP_GETREGISTEREDCLIENTS -- Get public-ids of the registered clients.
handle | samp struct handle |
References Samp::hub, Hub::id, Hub::privateKey, samp_listLen(), samp_newList(), and samp_setStringInList().
Referenced by samp_mapClients().
Get clients matching the mtype subscription.
SAMP_GETSUBSCRIBEDCLIENTS -- Get clients matching the mtype subscription.
handle | samp struct handle | |
mtype | mtype string |
References Samp::hub, Hub::id, Hub::privateKey, samp_listLen(), samp_newList(), and samp_setStringInList().
int samp_Ping | ( | handle_t | handle, | |
String | appName | |||
) |
Ping the hub/app to see if it is alive (returns >0).
SAMP_PING -- Ping the hub/app to see if it is alive (returns >0).
handle | samp struct handle | |
appName | application name |
References Samp::hub, samp_app2id(), samp_callAll(), samp_callAndWait(), samp_freeMap(), samp_freeMsg(), samp_hubPing(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_setErr().
int samp_Register | ( | handle_t | handle | ) |
Register with the Hub using the currently stored metadata.
SAMP_REGISTER -- Register with the Hub using the currently stored metadata.
handle | samp struct handle |
References Samp::hub, hub, Hub::hubId, Hub::id, Hub::privateKey, samp_replyStatus(), Hub::secret, and Hub::selfId.
int samp_UnRegister | ( | handle_t | handle | ) |
Un-Register from the hub.
SAMP_UNREGISTER -- Un-Register from the hub.
handle | samp struct handle |
References Samp::hub, hub, and samp_hubUnRegister().