#include <xmlrpc-c/base.h>
#include <xmlrpc-c/client.h>
#include <xmlrpc-c/server.h>
#include <xmlrpc-c/server_abyss.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "xrpc.h"
Go to the source code of this file.
Data Structures | |
| struct | appMD |
| struct | Subs |
| struct | Client |
| struct | Hub |
| struct | Samp |
Defines | |
| #define | SZ_NAME 256 |
| #define | SZ_LINE 256 |
| #define | SZ_SECRET 64 |
| #define | SZ_DESC 8192 |
| #define | SZ_URL 1024 |
| #define | SZ_CMD 1024 |
| #define | SZ_SBUF 65536 |
| #define | SZ_RESSTR 1024 |
| #define | DEF_PORT 9876 |
| #define | DEF_TIMEOUT "15" |
| #define | MAX_SAMPS 16 |
| #define | MAX_HUBS 16 |
| #define | MAX_MDATTRS 32 |
| #define | MAX_SUBS 256 |
| #define | MAX_CLIENTS 32 |
| #define | MAX_ROWS 256 |
| #define | SAMP_ERR -1 |
| #define | SAMP_PENDING 0 |
| #define | SAMP_OK 1 |
| #define | SAMP_CBR 0 |
| #define | SAMP_CBV 1 |
| #define | SAMP_SYNCH 0 |
| #define | SAMP_ASYNCH 1 |
| #define | SAMP_NOTIFY 2 |
| #define | SAMP_INT TY_INT |
| #define | SAMP_DOUBLE TY_DOUBLE |
| #define | SAMP_BOOL TY_BOOL |
| #define | SAMP_STRING TY_STRING |
| #define | SAMP_DATETIME TY_DATETIME |
| #define | SAMP_SAMPRUCT TY_STRUCT |
| #define | SAMP_ARRAY TY_ARRAY |
| #define | SAMP_TRACE 0 |
| #define | HUB_SHUTDOWN 0 |
| #define | HUB_REGISTER 1 |
| #define | HUB_UNREGISTER 2 |
| #define | HUB_SUBSCRIPTIONS 3 |
| #define | HUB_METADATA 4 |
| #define | HUB_DISCONNECT 5 |
| #define | LEN_DESC 32768 |
| #define | MAX_PARAMS 32 |
| #define | MSG_SYNC 0 |
| #define | MSG_ASYNC 1 |
| #define | MSG_NOTIFY 2 |
| #define | DEF_CALLMODE MSG_ASYNC |
Typedefs | |
| typedef long | handle_t |
| typedef int | Map |
| typedef int | List |
| typedef int | Msg |
| typedef int | Param |
| typedef char * | String |
| typedef struct appMD * | appMDP |
| typedef struct Subs * | SubsP |
| typedef struct Client * | ClientP |
| typedef struct Hub * | HubP |
| typedef struct Samp * | SampP |
Functions | |
| handle_t | sampInit (String appName, String description) |
| Initialize the SAMP interface. | |
| void | samp_Metadata (handle_t handle, String field, String value) |
| Set a metadata field value for the application. | |
| void | samp_Subscribe (handle_t handle, String mtype, void *func) |
| Subscribe to a given mtype. | |
| void | samp_Unsubscribe (handle_t handle, String mtype) |
| Unsubscribe to a given mtype. | |
| int | sampStartup (handle_t handle) |
| Startup the SAMP interface to send/receive messages. | |
| int | sampShutdown (handle_t handle) |
| Shut down the active SAMP interface. | |
| void | sampClose (handle_t handle) |
| Close the SAMP interface and free resources. | |
| void | samp_setSyncMode (handle_t handle) |
| Set the calling mode to use synchronous messaging. | |
| void | samp_setASyncMode (handle_t handle) |
| Set the calling mode to use asynchronous messaging. | |
| void | samp_setNotifyMode (handle_t handle) |
| Set the calling mode to use notification messaging. | |
| void | samp_setCallByRef (handle_t handle) |
| Have interface call user handlers by reference. | |
| void | samp_setCallMode (handle_t handle, int mode) |
| Set the default calling mode (synch or asynch). | |
| void | samp_setReplyCallback (handle_t handle, int *func) |
| Set the Reply callback. samp_setReplyCallback (handle_t handle, int *func). | |
| void | samp_setResponseCallback (handle_t handle, int *func) |
| Set the Response callback. samp_setResponseCallback (handle_t handle, int *func). | |
| void | samp_setTimeout (handle_t handle, int timeout) |
| Set the message timeout value (in seconds). | |
| void | samp_setAppName (handle_t handle, String name) |
| void | samp_setAppVersion (handle_t handle, String version) |
| Set the application name string. | |
| void | samp_defaultReplyHandler (handle_t handle) |
| The interface's default Reply handler. | |
| void | samp_deaultfResponseHandler (handle_t handle) |
| int | samp_replyStatus (handle_t handle) |
| Reply with the status of the last message sent. | |
| int | samp_mapClients (handle_t handle) |
| int | samp_listClients (handle_t handle) |
| int | samp_addClient (handle_t handle, String name, String id) |
| int | samp_removeClient (handle_t handle, String id) |
| Map | samp_getOKMap (void) |
| Map | samp_getNullMap (void) |
| 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. | |
| int | samp_tableLoadVOTable (handle_t handle, String recip, String url, String tableId, String name) |
| Tell an app to load a VOTable. | |
| int | samp_tableLoadFITS (handle_t handle, String recip, String url, String tableId, String name) |
| Tell an app to load a FITS table. | |
| int | samp_imageLoadFITS (handle_t handle, String recip, String url, String imageId, String name) |
| Tell an app to load a FITS image. | |
| int | samp_tableHighlightRow (handle_t handle, String recip, String tableId, String url, int row) |
| Tell an app to highlight a table row. | |
| int | samp_tableSelectRowList (handle_t handle, String recip, String tableId, String url, int rows[]) |
| Tell an app to select a list of table rows. | |
| int | samp_coordPointAtSky (handle_t handle, String recip, float ra, float dec) |
| Tell an app to point at an RA/Dec coordinate. | |
| int | samp_specLoadSSAGeneric (handle_t handle, String recip, String url, Map meta, String spectrumId, String name) |
| Load a generic spectrum from an SSA service. | |
| int | samp_cmdExec (handle_t handle, String recip, String cmd) |
| Execute a command in a remote application. | |
| char * | samp_envGet (handle_t handle, String recip, String name) |
| Get an environment variable in a remote application. | |
| int | samp_envSet (handle_t handle, String recip, String name, String value) |
| Set an environment variable in a remote application. | |
| char * | samp_paramGet (handle_t handle, String recip, String name) |
| Get an parameter variable in a remote application. | |
| int | samp_paramSet (handle_t handle, String recip, String name, String value) |
| Set an parameter variable in a remote application. | |
| int | samp_bibLoad (handle_t handle, String recip, String bibcode) |
| Exchange a bibcode. | |
| int | samp_resourceLoad (handle_t handle, String recip, String type, String name, Map resMap) |
| Exchange a resource list. | |
| int | samp_sendMsg (handle_t handle, String recip, Map msg) |
| Send the specified message. | |
| 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 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 resp) |
| 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. | |
| int | samp_receiveCall (void *data) |
| test.echo method | |
| int | samp_receiveNotification (void *data) |
| receiveNotification () client method. | |
| int | samp_receiveResponse (void *data) |
| receiveResponse () client method. | |
| void | samp_setUserHandler (handle_t handle, String mtype, void *func) |
| Set the user-interface handler for the mtype. | |
| void | samp_setSampHandler (handle_t handle, String mtype, void *func) |
| Set the SAMP interface handler for the mtype. | |
| void * | samp_getUserHandler (String mtype) |
| Get the User handler for the named mtype. | |
| void * | samp_getSampHandler (String mtype) |
| Get the Samphandler for the named mtype. | |
| void | samp_execUserHandler (String mtype, String sender, String msg_id, Map params) |
| Execute the user-defined handler for the mtype. | |
| int | samp_PingHandler (String sender, String msg_id, Map msg_map) |
| Is app alive and responding to messages? | |
| int | samp_StatusHandler (String sender, String msg_id, Map msg_map) |
| Return status of the task. | |
| int | samp_imLoadHandler (String sender, String msg_id, Map msg_map) |
| Handle an image.load.fits message. | |
| int | samp_tbLoadHandler (String sender, String msg_id, Map msg_map) |
| Handle a table.load.* message. | |
| int | samp_tbHighlightHandler (String sender, String msg_id, Map msg_map) |
| Handle a table.highlight.row message. | |
| int | samp_tbSelectHandler (String sender, String msg_id, Map msg_map) |
| Handle a table.select.rowList message. | |
| int | samp_pointAtHandler (String sender, String msg_id, Map msg_map) |
| Handle a coord.pointAt.sky message. | |
| int | samp_specLoadHandler (String sender, String msg_id, Map msg_map) |
| Handle a spectrum.load.* message. | |
| int | samp_cmdExecHandler (String sender, String msg_id, Map msg_map) |
| Handle a client.cmd.exec message. | |
| int | samp_envGetHandler (String sender, String msg_id, Map msg_map) |
| Handle a client.env.set message. | |
| int | samp_envSetHandler (String sender, String msg_id, Map msg_map) |
| Handle a client.env.set message. | |
| int | samp_paramGetHandler (String sender, String msg_id, Map msg_map) |
| Handle a client.param.set message. | |
| int | samp_paramSetHandler (String sender, String msg_id, Map msg_map) |
| Handle a client.param.set message. | |
| int | samp_bibcodeHandler (String sender, String msg_id, Map msg_map) |
| Handle a bibcode.load message. | |
| int | samp_resLoadHandler (String sender, String msg_id, Map msg_map) |
| handle a voresource.loadlist message | |
| void | samp_printMessage (String mtype, String sender, String msg_id, Map params) |
| Print a message contents in readable form. | |
| void | samp_printMap (String name, Map map) |
| int | samp_nullResponse (void *data) |
| int | samp_testEcho (void *data) |
| handle_t | samp_hubOpen (Samp *samp) |
| Discover and open a connection to the SAMP Hub. | |
| int | samp_hubClose (handle_t handle) |
| Close a connection to the Hub. | |
| List | samp_getAvailableHubs (handle_t handle) |
| Get a list of available Hubs. | |
| char * | samp_getActiveHubName (handle_t handle) |
| int | samp_getActiveHub (handle_t handle) |
| int | samp_hubInit (handle_t samp, char *appName, char *descr) |
| int | samp_processHubEvent (String mtype, Map params) |
| Determine the type of Hub event mtype. | |
| int | samp_hubEvent (String mtype) |
| Determine the type of Hub event mtype. | |
| int | samp_hubRegister (Hub *hub) |
| Send a Register message to the Hub. | |
| int | samp_hubUnRegister (Hub *hub) |
| Send a UnRegister message to the Hub. | |
| int | samp_hubSendShutdown (Hub *hub) |
| Send a samp.app.event.shutdown message to the Hub. | |
| int | samp_hubSetXmlrpcCallback (Hub *hub) |
| Set the client callback and send to Hub. | |
| int | samp_hubPing (Hub *hub) |
| Ping the Hub to see if it is alive. | |
| int | samp_hubDeclareMetadata (Hub *hub) |
| Declare "standard" metadata to the Hub. | |
| int | samp_hubDeclareSubscriptions (Hub *hub) |
| Declare mtype subscriptions to the Hub. | |
| handle_t | samp_newList () |
| Create a new List object. | |
| void | samp_freeList (List list) |
| Free the given List object. | |
| int | samp_listLen (List list) |
| Get number of elements in a List. | |
| void | samp_setStringInList (List list, char *value) |
| Set a string in a List (append). | |
| void | samp_setMapInList (List list, Map map) |
| Set a Map in a List (append). | |
| void | samp_setListInList (List list1, List list2) |
| Set a List in another List (append). | |
| void | samp_setIntInList (List list, int value) |
| Set an Int in a List (append). | |
| void | samp_setFloatInList (List list, float value) |
| Set a Float in a List (append). | |
| char * | samp_getStringFromList (List list, int index) |
| Get a string from the List. | |
| Map | samp_getMapFromList (List list, int index) |
| Get a Map from the List. | |
| List | samp_getListFromList (List list, int index) |
| Get a List from the List. | |
| int | samp_getIntFromList (List list, int index) |
| float | samp_getFloatFromList (List list, int index) |
| Get a Float from the List. | |
| handle_t | samp_newMap (void) |
| Create a new Map object. | |
| void | samp_freeMap (Map map) |
| Free the given Map object. | |
| void | samp_setStringInMap (Map map, char *key, char *value) |
| Set a string in a Map (append). | |
| void | samp_setMapInMap (Map map1, char *key, Map map2) |
| Set a Map in a Map (append). | |
| void | samp_setListInMap (Map map, char *key, List list) |
| Set a List in a Map (append). | |
| void | samp_setIntInMap (Map map, char *key, int value) |
| Set a Int in a Map (append). | |
| void | samp_setFloatInMap (Map map, char *key, float value) |
| Set a string in a Map (append). | |
| char * | samp_getStringFromMap (Map map, char *key) |
| Get a string from the Map. | |
| Map | samp_getMapFromMap (Map map, char *key) |
| Get a Map from the Map. | |
| List | samp_getListFromMap (Map map, char *key) |
| Get a LIST from the Map. | |
| int | samp_getIntFromMap (Map map, char *key) |
| Get a integer from the Map. | |
| float | samp_getFloatFromMap (Map map, char *key) |
| Get a float from the Map. | |
| Msg | samp_newMsg (void) |
| Create a new Msg object. | |
| void | samp_freeMsg (Msg msg) |
| Free the given Msg object. | |
| void | samp_msgMType (Msg msg, String mtype) |
| void | samp_msgParam (Msg msg, Param param) |
| Add a parameter to the Msg. | |
| char * | samp_msgTag (void) |
| Param | samp_newParam (void) |
| Create a new Param object. | |
| void | samp_freeParam (Param param) |
| Free the given Msg object. | |
| Param | samp_paramInit (Msg msg) |
| Get number of Params. | |
| void | samp_addStringParam (Msg msg, char *keyw, String val) |
| void | samp_addMapParam (Msg msg, char *keyw, Map val) |
| Add a parameter to the Param. | |
| void | samp_addListParam (Msg msg, char *keyw, List val) |
| Add a parameter to the Param. | |
| void | samp_addIntParam (Msg msg, char *keyw, int val) |
| Add a <SAMP int>=""> parameter to the Param. | |
| void | samp_addFloatParam (Msg msg, char *keyw, float val) |
| Add a <SAMP float>=""> parameter to the Param. | |
| int | samp_paramLen (Msg msg) |
| Get number of Params. | |
| void | sampLog (handle_t handle, char *format,...) |
| SAMP message logger. | |
| void | sampTrace (handle_t handle, char *format,...) |
| SAMP tracer. | |
| handle_t | samp_newHandle (void *ptr) |
| Get an unused object handle. | |
| void | samp_freeHandle (handle_t handle) |
| Free the handle for later re-use. | |
| handle_t | samp_P2H (void *ptr) |
| Convert a pointer to a handle. | |
| void * | samp_H2P (handle_t handle) |
| char * | samp_app2id (handle_t handle, char *appName) |
| Convert an application name to a public-ID. | |
| char * | samp_id2app (handle_t handle, char *pubId) |
| Convert a public-ID to the application name. | |
| int | samp_serverPort (void) |
| Return a unique port number for the server. | |
SAMP.H -- SAMP interface include file.
| #define HUB_SHUTDOWN 0 |
Special Hub events
Referenced by samp_hubEvent(), and samp_processHubEvent().
| #define MAX_PARAMS 32 |
Message map.
| typedef int List |
SAMP Map datatype
| typedef int Map |
generic object handle
| typedef int Msg |
SAMP List datatype
| typedef int Param |
SAMP Msg datatype
| typedef char* String |
SAMP Param datatype
SAMP_ADDCLIENT -- Add a newly registered client to the list of known apps so we can do the public-private name translation.
References Samp::clients, Client::name, and Samp::nclients.
Referenced by samp_processHubEvent().
| void samp_addFloatParam | ( | Msg | msg, | |
| char * | keyw, | |||
| float | val | |||
| ) |
Add a <SAMP float>=""> parameter to the Param.
SAMP_ADDFLOATPARAM -- Add a <SAMP float>=""> parameter to the Param.
| msg | handle to Msg object | |
| keyw | map keyword | |
| val | floating point value |
References samp_paramInit().
Referenced by samp_coordPointAtSky().
| void samp_addIntParam | ( | Msg | msg, | |
| char * | keyw, | |||
| int | val | |||
| ) |
Add a <SAMP int>=""> parameter to the Param.
SAMP_ADDINTPARAM -- Add a <SAMP int>=""> parameter to the Param.
| msg | handle to Msg object | |
| keyw | map keyword | |
| val | integer value |
References samp_paramInit().
Referenced by samp_tableHighlightRow().
Add a parameter to the Param.
SAMP_ADDLISTPARAM -- Add a List parameter to the Param.
| msg | handle to Msg object | |
| keyw | map keyword | |
| val | value list |
References samp_paramInit().
Add a parameter to the Param.
SAMP_ADDMAPPARAM -- Add a Map parameter to the Param.
| msg | handle to Msg object | |
| keyw | map keyword | |
| val | value map |
References samp_paramInit().
Referenced by samp_resourceLoad().
| pubId samp_app2id | ( | handle_t | handle, | |
| char * | appName | |||
| ) |
Convert an application name to a public-ID.
SAMP_APP2ID -- Convert an application name to a public-ID.
| handle | samp struct handle | |
| appName | name of registered application |
References Samp::clients, Client::name, and Samp::nclients.
Referenced by samp_call(), samp_callAndWait(), samp_envGet(), samp_notify(), samp_paramGet(), samp_Ping(), and samp_sendMsg().
Handle a bibcode.load message.
SAMP_BIBCODEHANDLER -- Handle a bibcode.load message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
Exchange a bibcode.
SAMP_BIBLOAD -- Exchange a bibcode.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| bibcode | Bibcode string |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Make a call() call to the Hub.
SAMP_CALL -- Make a call() call to the Hub
| handle | samp struct handle | |
| recipId | recipient ID | |
| msg_tag | message tag | |
| msg | message map |
References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), and Samp::trace.
Referenced by samp_sendMsg().
Make a callAll() call to the Hub.
SAMP_CALLALL -- Make a callAll() call to the Hub
| handle | samp struct handle | |
| msg_tag | message tag | |
| msg | message map |
References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_setErr(), and Samp::trace.
Referenced by samp_Ping(), and samp_sendMsg().
Make a callAndWait() call to the Hub.
SAMP_CALLANDWAIT -- Make a callAndWait() call to the Hub
| handle | samp struct handle | |
| recipId | recipient ID | |
| msg_tag | message tag | |
| msg | message map |
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().
| name samp_clientName | ( | handle_t | handle, | |
| String | pubId | |||
| ) |
Execute a command in a remote application.
SAMP_CMDEXEC -- Execute a command in a remote application.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| cmd | Command string |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Handle a client.cmd.exec message.
SAMP_CMDEXECHANDLER -- Handle a client.cmd.exec message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
| stat samp_coordPointAtSky | ( | handle_t | handle, | |
| String | recip, | |||
| float | ra, | |||
| float | dec | |||
| ) |
Tell an app to point at an RA/Dec coordinate.
SAMP_COORDPOINTATSKY -- Tell an app to point at an RA/Dec coordinate.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| ra | RA of coord in degrees | |
| dec | Dec of coord in degrees |
References Samp::hub, hub, samp_addFloatParam(), samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
| stat 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().
| stat 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().
| void samp_defaultReplyHandler | ( | handle_t | handle | ) |
The interface's default Reply handler.
SAMP_DEFAULTREPLYHANDLER -- The interface's default Reply handler.
| handle | samp handle |
Get an environment variable in a remote application.
SAMP_ENVGET -- Get an environment variable in a remote application.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| name | Name of variable in receiver's environment |
References Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and Hub::timeout.
Handle a client.env.set message.
SAMP_ENVGETHANDLER -- Handle a client.env.set message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_freeMap(), samp_getStringFromMap(), samp_getUserHandler(), samp_newMap(), samp_Reply(), samp_setMapInMap(), samp_setStringInMap(), and sampH.
Set an environment variable in a remote application.
SAMP_ENVSET -- Set an environment variable in a remote application.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| name | Name of variable in receiver's environment | |
| value | Value of variable or NULL |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Handle a client.env.set message.
SAMP_ENVSETHANDLER -- Handle a client.env.set message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
Execute the user-defined handler for the mtype.
SAMP_EXECUSERHANDLER -- Execute the user-defined handler for the mtype.
| mtype | mtype string | |
| sender | sender name | |
| msg_id | message-id string | |
| params | Mtype parameter Map |
References Samp::defaultUserFunc, Samp::handlerMode, samp_getFloatFromMap(), samp_getIntFromMap(), samp_getStringFromMap(), and samp_getUserHandler().
Referenced by samp_receiveCall(), samp_receiveNotification(), and samp_receiveResponse().
| void samp_freeHandle | ( | handle_t | handle | ) |
Free the handle for later re-use.
SAMP_FREEHANDLE -- Free the handle for later re-use.
| handle | object handle |
Referenced by samp_hubClose(), and sampClose().
| void samp_freeList | ( | List | list | ) |
Free the given List object.
SAMP_FREELIST -- Free the given List object
| list | List object handle |
Referenced by samp_mapClients().
| void samp_freeMap | ( | Map | map | ) |
Free the given Map object.
SAMP_FREEMAP -- Free the given Map object
| map | Map object to free |
Referenced by samp_envGetHandler(), samp_hubDeclareSubscriptions(), samp_paramGetHandler(), and samp_Ping().
| void samp_freeMsg | ( | Msg | msg | ) |
Free the given Msg object.
SAMP_FREEMSG -- Free the given Msg object
| msg | Msg object to free |
Referenced by samp_bibLoad(), samp_cmdExec(), samp_coordPointAtSky(), samp_envGet(), samp_envSet(), samp_imageLoadFITS(), samp_paramGet(), samp_paramSet(), samp_Ping(), samp_resourceLoad(), samp_tableHighlightRow(), samp_tableLoadFITS(), and samp_tableLoadVOTable().
| void samp_freeParam | ( | Param | param | ) |
Free the given Msg object.
SAMP_FREEPARAM -- Free the given Param object
| param | Param object to free |
| status samp_getAvailableHubs | ( | handle_t | handle | ) |
Get a list of available Hubs.
SAMP_GETAVAILABLEHUBS -- Get a list of available Hubs
| handle | hub handle |
| samp_getErr | ( | handle_t | handle | ) |
Get the error response string.
SAMP_GETERR -- Get the error response string.
| handle | samp struct handle |
References Samp::errortxt.
| ival samp_getFloatFromList | ( | List | list, | |
| int | index | |||
| ) |
Get a Float from the List.
SAMP_GETFLOATFROMLIST -- Get a Float from the List
| list | List object handle | |
| index | List index containing the desired value |
| rval samp_getFloatFromMap | ( | Map | map, | |
| char * | key | |||
| ) |
Get a float from the Map.
SAMP_GETFLOATFROMMAP -- Get a float from the Map
| map | handle to Map object | |
| key | Map key |
Referenced by samp_execUserHandler(), samp_pointAtHandler(), and samp_printMessage().
| ival samp_getIntFromMap | ( | Map | map, | |
| char * | key | |||
| ) |
Get a integer from the Map.
SAMP_GETINTFROMMAP -- Get a integer from the Map
| map | handle to Map object | |
| key | Map key |
Referenced by samp_execUserHandler(), samp_printMessage(), and samp_tbHighlightHandler().
| ival samp_getListFromList | ( | List | list, | |
| int | index | |||
| ) |
Get a List from the List.
Get an Int from the List.
SAMP_GETLISTFROMLIST -- Get a List from the List
| list | List object handle | |
| index | List index containing the List |
| list | List object handle | |
| index | List index containing the desired value |
Get a LIST from the Map.
SAMP_GETLISTFROMMAP -- Get a LIST from the Map
| map | handle to Map object | |
| key | Map key |
Referenced by samp_tbSelectHandler().
Get a Map from the List.
SAMP_GETMAPFROMLIST -- Get a Map from the List
| list | List object handle | |
| index | List index containing the Map |
Get a Map from the Map.
SAMP_GETMAPFROMMAP -- Get a Map from the Map
| map | handle to Map object | |
| key | Map key |
Referenced by samp_printMessage(), and samp_specLoadHandler().
| map samp_GetMetadata | ( | handle_t | handle, | |
| String | pubId | |||
| ) |
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().
| Map samp_getNullMap | ( | void | ) |
SAMP_GETNULLMAP -- Generate a 'Null' map we can return to the Hub.
References samp_newMap().
| Map samp_getOKMap | ( | void | ) |
SAMP_GETOKMAP -- Generate an 'OK' map we can return to the Hub.
References nullMap, samp_newMap(), samp_setMapInMap(), and samp_setStringInMap().
| handle 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().
| func samp_getSampHandler | ( | String | mtype | ) |
Get the Samphandler for the named mtype.
SAMP_GETSAMPHANDLER -- Get the Samphandler for the named mtype.
| mtype | mtype string |
References Samp::nsubs, and Subs::sampFunc.
Referenced by samp_receiveCall(), and samp_receiveNotification().
| char * samp_getStringFromList | ( | List | list, | |
| int | index | |||
| ) |
Get a string from the List.
SAMP_GETSTRINGFROMLIST -- Get a string from the List
| list | List object handle | |
| index | List index containing the string |
Referenced by samp_mapClients().
| char * samp_getStringFromMap | ( | Map | map, | |
| char * | key | |||
| ) |
Get a string from the Map.
SAMP_GETSTRINGFROMMAP -- Get a string from the Map
| map | handle to Map object | |
| key | Map key |
Referenced by samp_bibcodeHandler(), samp_cmdExecHandler(), samp_envGetHandler(), samp_envSetHandler(), samp_execUserHandler(), samp_imLoadHandler(), samp_paramGetHandler(), samp_paramSetHandler(), samp_printMessage(), samp_resLoadHandler(), samp_specLoadHandler(), samp_tbHighlightHandler(), samp_tbLoadHandler(), and samp_tbSelectHandler().
| list samp_GetSubscribedClients | ( | handle_t | handle, | |
| String | mtype | |||
| ) |
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().
| func samp_getUserHandler | ( | String | mtype | ) |
Get the User handler for the named mtype.
SAMP_GETUSERHANDLER -- Get the User handler for the named mtype.
| mtype | mtype string |
References Samp::defaultUserFunc, Samp::nsubs, and Subs::userFunc.
Referenced by samp_bibcodeHandler(), samp_cmdExecHandler(), samp_envGetHandler(), samp_envSetHandler(), samp_execUserHandler(), samp_imLoadHandler(), samp_paramGetHandler(), samp_paramSetHandler(), samp_PingHandler(), samp_pointAtHandler(), samp_receiveCall(), samp_resLoadHandler(), samp_specLoadHandler(), samp_StatusHandler(), samp_tbHighlightHandler(), samp_tbLoadHandler(), and samp_tbSelectHandler().
| status samp_hubClose | ( | handle_t | handle | ) |
Close a connection to the Hub.
SAMP_HUBCLOSE -- Close a connection to the Hub.
| handle | hub handle |
References samp_freeHandle(), and samp_hubUnRegister().
Referenced by sampClose(), and sampShutdown().
| status samp_hubDeclareMetadata | ( | Hub * | hub | ) |
Declare "standard" metadata to the Hub.
SAMP_DECLAREMETADATA -- Declare "standard" metadata to the Hub.
| hub | hub struct pointer |
References appMD::aKey, appMD::aVal, Hub::description, appMD::docURL, appMD::iconURL, Hub::id, Hub::meta, appMD::nkeys, and Hub::privateKey.
Referenced by samp_DeclareMetadata(), and sampStartup().
| status samp_hubDeclareSubscriptions | ( | Hub * | hub | ) |
Declare mtype subscriptions to the Hub.
SAMP_HUBDECLARESUBSCRIPTIONS -- Declare mtype subscriptions to the Hub.
| hub | hub struct pointer |
References Hub::id, Samp::nsubs, nullMap, Hub::privateKey, Hub::samp, and samp_freeMap().
Referenced by samp_DeclareSubscriptions(), and sampStartup().
| code samp_hubEvent | ( | String | mtype | ) |
Determine the type of Hub event mtype.
SAMP_HUBEVENT -- Determine the type of Hub event mtype.
| mtype | mtype string |
References HUB_SHUTDOWN.
Referenced by samp_processHubEvent().
| handle samp_hubOpen | ( | Samp * | sampP | ) |
Discover and open a connection to the SAMP Hub.
SAMP_HUBOPEN -- Discover and open a connection to the SAMP Hub.
| samp | Same structure |
References Samp::appVer, Samp::description, samp_hubRegister(), samp_hubSetXmlrpcCallback(), samp_newHandle(), and samp_P2H().
Referenced by sampInit(), and sampStartup().
| status samp_hubPing | ( | Hub * | hub | ) |
Ping the Hub to see if it is alive.
SAMP_HUBPING -- Ping the Hub to see if it is alive.
| hub | hub struct pointer |
References Hub::id, and Hub::privateKey.
Referenced by samp_Ping().
| status samp_hubRegister | ( | Hub * | hub | ) |
Send a Register message to the Hub.
SAMP_HUB_REGISTER -- Send a Register message to the Hub.
| hub | hub struct pointer |
References Hub::hubId, Hub::id, Hub::privateKey, Hub::secret, and Hub::selfId.
Referenced by samp_hubOpen().
| status samp_hubSendShutdown | ( | Hub * | hub | ) |
Send a samp.app.event.shutdown message to the Hub.
SAMP_HUBSENDSHUTDOWN -- Send a samp.app.event.shutdown message to the Hub.
| hub | hub struct pointer |
References Hub::id, Hub::privateKey, and samp_nullResponse().
| status samp_hubSetXmlrpcCallback | ( | Hub * | hub | ) |
Set the client callback and send to Hub.
SAMP_HUBSETXMLRPCCALLBACK -- Set the client callback and send to Hub
| hub | hub struct pointer |
References Hub::id, Hub::privateKey, and samp_serverPort().
Referenced by samp_hubOpen().
| status samp_hubUnRegister | ( | Hub * | hub | ) |
Send a UnRegister message to the Hub.
SAMP_HUBUNREGISTER -- Send a UnRegister message to the Hub.
| hub | hub struct pointer |
References Hub::id, and Hub::privateKey.
Referenced by samp_hubClose(), and samp_UnRegister().
| appName samp_id2app | ( | handle_t | handle, | |
| char * | pubId | |||
| ) |
Convert a public-ID to the application name.
SAMP_ID2APP -- Convert a public-ID to the application name.
| handle | samp struct handle | |
| pubId | public ID of application |
References Samp::clients, Client::name, and Samp::nclients.
Tell an app to load a FITS image.
SAMP_IMAGELOADFITS -- Tell an app to load a FITS image.
| handle | samp struct handle | |
| recip | Message recipient (or "all" for broadcast) | |
| url | URL to table to be loaded | |
| imageId | ID assigned to image (optional) | |
| name | Name assigned to image (optional) |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Handle an image.load.fits message.
SAMP_IMLOADHANDLER -- Handle an image.load.fits message.
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
| int samp_listClients | ( | handle_t | handle | ) |
SAMP_ADDCLIENT -- Add a newly registered client to the list of known apps so we can do the public-private name translation.
References Samp::clients, Client::name, and Samp::nclients.
| int samp_listLen | ( | List | list | ) |
Get number of elements in a List.
SAMP_LISTLEN -- Get number of elements in a List.
| list | List object handle |
Referenced by samp_GetRegisteredClients(), samp_GetSubscribedClients(), samp_mapClients(), and samp_tbSelectHandler().
| int samp_mapClients | ( | handle_t | handle | ) |
SAMP_MAPCLIENTS -- Map the public-ids of registered clients to the appName.
References Samp::clients, Client::name, Samp::nclients, samp_freeList(), samp_GetMetadata(), samp_GetRegisteredClients(), samp_getStringFromList(), and samp_listLen().
Referenced by sampStartup().
Set a metadata field value for the application.
SAMP_METADATA -- Set a metadata field for the application. This will be sent to the Hub later in a declareMetadata() call.
| handle | samp handle | |
| field | metadata field to set (name, author, etc) | |
| samp | value of field |
References appMD::aKey, appMD::aVal, appMD::desc, appMD::docURL, appMD::iconURL, Samp::meta, appMD::nkeys, and sampTrace().
Add a parameter to the Msg.
SAMP_MSGPARAM -- Add a parameter to the Msg.
| msg | handle to Msg object | |
| keyw | map keyword | |
| param | parameter map |
Referenced by samp_bibLoad(), samp_cmdExec(), samp_coordPointAtSky(), samp_envGet(), samp_envSet(), samp_imageLoadFITS(), samp_paramGet(), samp_paramSet(), samp_Ping(), samp_resourceLoad(), samp_tableHighlightRow(), samp_tableLoadFITS(), and samp_tableLoadVOTable().
| handle_t samp_newHandle | ( | void * | ptr | ) |
Get an unused object handle.
SAMP_NEWHANDLE -- Get an unused object handle.
| ptr | pointer to object to be stored |
Referenced by samp_hubOpen(), and sampInit().
| int samp_newList | ( | void | ) |
Create a new List object.
SAMP_NEWLIST -- Create a new List object
Referenced by samp_GetRegisteredClients(), samp_GetSubscribedClients(), and sampInit().
| int samp_newMap | ( | void | ) |
Create a new Map object.
SAMP_NEWMAP -- Create a new Map object
Referenced by samp_envGetHandler(), samp_getNullMap(), samp_getOKMap(), samp_paramGetHandler(), and sampInit().
| int samp_newMsg | ( | void | ) |
Create a new Msg object.
SAMP_NEWMSG -- Create a new Msg object
Referenced by samp_bibLoad(), samp_cmdExec(), samp_coordPointAtSky(), samp_envGet(), samp_envSet(), samp_imageLoadFITS(), samp_paramGet(), samp_paramSet(), samp_Ping(), samp_resourceLoad(), samp_tableHighlightRow(), samp_tableLoadFITS(), and samp_tableLoadVOTable().
| int samp_newParam | ( | void | ) |
Create a new Param object.
SAMP_NEWPARAM -- Create a new Param object
Referenced by samp_bibLoad(), samp_cmdExec(), samp_coordPointAtSky(), samp_envGet(), samp_envSet(), samp_imageLoadFITS(), samp_paramGet(), samp_paramSet(), samp_Ping(), samp_resourceLoad(), samp_tableHighlightRow(), samp_tableLoadFITS(), and samp_tableLoadVOTable().
Make a notify() call to the Hub.
SAMP_NOTIFY -- Make a notify() call to the Hub
| handle | samp struct handle | |
| recipId | recipient ID | |
| msg | message map |
References Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), and samp_nullResponse().
Referenced by samp_sendMsg().
| void samp_notifyAll | ( | handle_t | handle, | |
| Map | msg | |||
| ) |
Make a notifyAll() call to the Hub.
SAMP_NOTIFYALL -- Make a notifyAll() call to the Hub
| handle | samp struct handle | |
| msg | message map |
References Samp::debug, Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, and Samp::trace.
Referenced by samp_sendMsg().
| int samp_nullResponse | ( | void * | data | ) |
SAMP_NULLRESPONSE -- Handler to ignore async replies.
Referenced by samp_hubSendShutdown(), samp_notify(), and samp_Reply().
| handle_t samp_P2H | ( | void * | ptr | ) |
Convert a pointer to a handle.
SAMP_P2H -- Convert a pointer to a handle
| ptr | pointer to object |
Referenced by samp_hubOpen(), and samp_processHubEvent().
Get an parameter variable in a remote application.
SAMP_PARAMGET -- Get an parameter variable in a remote application.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| name | Name of variable in receiver's environment |
References Samp::errortxt, Samp::hub, hub, Hub::id, Hub::privateKey, samp_app2id(), samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and Hub::timeout.
Handle a client.param.set message.
SAMP_PARAMGETHANDLER -- Handle a client.param.set message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_freeMap(), samp_getStringFromMap(), samp_getUserHandler(), samp_newMap(), samp_Reply(), samp_setMapInMap(), samp_setStringInMap(), and sampH.
| nparam samp_paramInit | ( | Msg | msg | ) |
Get number of Params.
SAMP_PARAMINIT -- Get number of Params.
| msg | handle to Msg object |
Referenced by samp_addFloatParam(), samp_addIntParam(), samp_addListParam(), and samp_addMapParam().
| nparam samp_paramLen | ( | Msg | msg | ) |
Get number of Params.
SAMP_PARAMLEN -- Get number of Params.
| msg | handle to Msg object |
Set an parameter variable in a remote application.
SAMP_PARAMSET -- Set an parameter variable in a remote application.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| name | Name of variable in receiver's environment | |
| value | Value of variable or NULL |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Handle a client.param.set message.
SAMP_PARAMSETHANDLER -- Handle a client.param.set message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
| stat 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().
Is app alive and responding to messages?
SAMP_PINGHANDLER -- Simple aliveness test function.
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, and samp_getUserHandler().
Handle a coord.pointAt.sky message.
SAMP_POINTATHANDLER -- Handle a coord.pointAt.sky message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getFloatFromMap(), and samp_getUserHandler().
SAMP_PRINTMAP -- Print the contents of a Map structure.
Referenced by samp_printMessage().
Print a message contents in readable form.
SAMP_PRINTMESSAGE -- Print a message contents in readable form.
| mtype | mtype string | |
| sender | sender name | |
| msg_id | message-id string | |
| params | Mtype parameter Map |
References samp_getFloatFromMap(), samp_getIntFromMap(), samp_getMapFromMap(), samp_getStringFromMap(), and samp_printMap().
Determine the type of Hub event mtype.
SAMP_HUBEVENT -- Determine the type of Hub event mtype.
| mtype | mtype string | |
| params | message parameter Map |
References HUB_SHUTDOWN, samp_addClient(), samp_hubEvent(), samp_mutex, samp_P2H(), samp_removeClient(), sampH, and sampShutdown().
Referenced by samp_receiveNotification().
| int samp_receiveCall | ( | void * | data | ) |
test.echo method
receiveCall () client method.
SAMP_TESTECHO -- test.echo method
| data | caller param data |
| data | caller param data |
References Samp::defaultUserFunc, OK_Map, samp_execUserHandler(), samp_getSampHandler(), samp_getUserHandler(), samp_Reply(), sampH, and Samp::trace.
| int samp_receiveNotification | ( | void * | data | ) |
receiveNotification () client method.
SAMP_RECEIVENOTIFICATION -- receiveNotification() client method.
| data | caller param data |
References Samp::defaultUserFunc, OK_Map, samp_execUserHandler(), samp_getSampHandler(), samp_processHubEvent(), and Samp::trace.
| int samp_receiveResponse | ( | void * | data | ) |
receiveResponse () client method.
SAMP_RECEIVERESPONSE -- receiveResponse() client method.
| data | caller param data |
References Samp::defaultUserFunc, OK_Map, samp_execUserHandler(), and Samp::trace.
| handle 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_removeClient | ( | handle_t | handle, | |
| String | id | |||
| ) |
SAMP_REMOVECLIENT -- Remove a registered client from the list of known apps that do the public-private name translation.
References Samp::clients, Client::name, and Samp::nclients.
Referenced by samp_processHubEvent().
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.
| handle | samp struct handle | |
| msg_id | message ID | |
| response | response map |
References Samp::hub, hub, Hub::id, Hub::privateKey, and samp_nullResponse().
Referenced by samp_envGetHandler(), samp_paramGetHandler(), and samp_receiveCall().
| int samp_replyStatus | ( | handle_t | handle | ) |
Reply with the status of the last message sent.
SAMP_REPLYSTATUS -- Reply with the status of the last message sent.
May be used to 'poll' for a reponse from the caller in cases where use of a callback is a problem. Codes are: <0==ERR, 0==PENDING, 1==OK
| samp | samp struct ptr |
Referenced by samp_Register().
handle a voresource.loadlist message
SAMP_RESLOADHANDLER -- handle a voresource.loadlist message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
Exchange a resource list.
SAMP_RESOURCELOAD -- Exchange a resource list.
| handle | samp struct handle | |
| recip | Name of recipient (or 'all') | |
| type | Resource type (or NULL) | |
| name | Descriptive name (optional) | |
| resMap | Resource map |
References Samp::hub, hub, samp_addMapParam(), samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Send the specified message.
SAMP_SENDMSG -- Send the specified message.
| handle | samp struct handle | |
| recip | Name of recipient (or 'all') | |
| msg | Message map |
References Samp::clients, Samp::msgMode, Samp::nclients, samp_app2id(), samp_call(), samp_callAll(), samp_callAndWait(), samp_notify(), samp_notifyAll(), and samp_setErr().
Referenced by samp_bibLoad(), samp_cmdExec(), samp_coordPointAtSky(), samp_envSet(), samp_imageLoadFITS(), samp_paramSet(), samp_resourceLoad(), samp_tableHighlightRow(), samp_tableLoadFITS(), and samp_tableLoadVOTable().
| port samp_serverPort | ( | void | ) |
Return a unique port number for the server.
SAMP_SERVERPORT -- Return a unique port number for the server.
Referenced by samp_hubSetXmlrpcCallback(), and sampInit().
| void samp_setAppVersion | ( | handle_t | handle, | |
| String | version | |||
| ) |
Set the application name string.
Set the application version string.
SAMP_SETAPPNAME -- Set the application name string.
| handle | samp handle | |
| name | application name |
| handle | samp handle | |
| name | application version |
References Hub::appVer, Samp::appVer, and Samp::hub.
| void samp_setASyncMode | ( | handle_t | handle | ) |
Set the calling mode to use asynchronous messaging.
SAMP_SETASYNCMODE -- Set the calling mode to use asynchronous messaging.
| handle | samp handle |
References Samp::msgMode.
| void samp_setCallByRef | ( | handle_t | handle | ) |
Have interface call user handlers by reference.
SAMP_SETCALLBYREF -- Have interface call user handlers by reference.
| handle | samp handle |
References Samp::handlerMode.
| void samp_setCallMode | ( | handle_t | handle, | |
| int | mode | |||
| ) |
Set the default calling mode (synch or asynch).
SAMP_SETCALLMODE -- Set the default calling mode (synch or asynch)
| handle | samp handle | |
| mode | call mode (synch or asynch) |
References Samp::msgMode.
| stat samp_setErr | ( | handle_t | handle, | |
| Map | resp | |||
| ) |
Set the error response string.
SAMP_SETERR -- Set the error response string/code.
| handle | samp struct handle | |
| resp | Response map |
References Samp::errortxt.
Referenced by samp_callAll(), samp_callAndWait(), samp_Ping(), and samp_sendMsg().
| void samp_setFloatInList | ( | List | list, | |
| float | rval | |||
| ) |
Set a Float in a List (append).
SAMP_SETFLOATINLIST -- Set a Float in a List (append)
| list1 | List object handle | |
| rval | Float value to be appended |
| void samp_setFloatInMap | ( | Map | map, | |
| char * | key, | |||
| float | value | |||
| ) |
Set a string in a Map (append).
SAMP_SETFLOATINMAP -- Set a Float in a Map (append)
| map | handle to Map object | |
| key | Map key | |
| value | value |
| void samp_setIntInList | ( | List | list, | |
| int | ival | |||
| ) |
Set an Int in a List (append).
SAMP_SETINTINLIST -- Set an Int in a List (append)
| list1 | List object handle | |
| ival | Integer value to be appended |
| void samp_setIntInMap | ( | Map | map, | |
| char * | key, | |||
| int | value | |||
| ) |
Set a Int in a Map (append).
SAMP_SETINTINMAP -- Set a Int in a Map (append)
| map | handle to Map object | |
| key | Map key | |
| value | value |
Set a List in another List (append).
SAMP_SETLISTINLIST -- Set a List in another List (append)
| list1 | List object handle | |
| list2 | List to be appended |
Set a List in a Map (append).
SAMP_SETLISTINMAP -- Set a List in a Map (append)
| map | handle to Map object | |
| key | Map key | |
| list | handle to List object to set |
Set a Map in a List (append).
SAMP_SETMAPINLIST -- Set a Map in a List (append)
| list | List object handle | |
| map | Map object to be set |
Set a Map in a Map (append).
SAMP_SETMAPINMAP -- Set a Map in a Map (append)
| map1 | handle to Map object | |
| key | Map key | |
| map2 | handle to Map object to set |
Referenced by samp_envGetHandler(), samp_getOKMap(), samp_paramGetHandler(), and sampInit().
| void samp_setNotifyMode | ( | handle_t | handle | ) |
Set the calling mode to use notification messaging.
SAMP_SETNOTIFYMODE -- Set the calling mode to use notification messaging.
| handle | samp handle |
References Samp::msgMode.
| void samp_setReplyCallback | ( | handle_t | handle, | |
| int * | func | |||
| ) |
Set the Reply callback. samp_setReplyCallback (handle_t handle, int *func).
SAMP_SETREPLYCALLBACK -- Set the Reply callback.
| handle | samp handle | |
| func | callback for Reply message |
| void samp_setResponseCallback | ( | handle_t | handle, | |
| int * | func | |||
| ) |
Set the Response callback. samp_setResponseCallback (handle_t handle, int *func).
SAMP_SETRESPONSECALLBACK -- Set the Response callback.
| handle | samp handle | |
| func | callback for message response |
| samp_setSampHandler | ( | handle_t | handle, | |
| String | mtype, | |||
| void * | func | |||
| ) |
Set the SAMP interface handler for the mtype.
SAMP_SETSAMPHANDLER -- Set the SAMP interface handler for the mtype.
| handle | user handle to samp struct | |
| mtype | mtype name | |
| func | callback function |
References Samp::nsubs, and Subs::sampFunc.
| void samp_setStringInList | ( | List | list, | |
| char * | value | |||
| ) |
Set a string in a List (append).
SAMP_SETSTRINGINLIST -- Set a string in a List (append)
| list | List object handle | |
| value | string value to set |
Referenced by samp_GetRegisteredClients(), and samp_GetSubscribedClients().
| void samp_setStringInMap | ( | Map | map, | |
| char * | key, | |||
| char * | value | |||
| ) |
Set a string in a Map (append).
SAMP_SETSTRINGINMAP -- Set a string in a Map (append)
| map | handle to Map object | |
| key | Map key | |
| value | Map value |
Referenced by samp_envGetHandler(), samp_getOKMap(), samp_paramGetHandler(), and sampInit().
| void samp_setSyncMode | ( | handle_t | handle | ) |
Set the calling mode to use synchronous messaging.
SAMP_SETSYNCMODE -- Set the calling mode to use synchronous messaging.
| handle | samp handle |
References Samp::msgMode.
| void samp_setTimeout | ( | handle_t | handle, | |
| int | timeout | |||
| ) |
Set the message timeout value (in seconds).
SAMP_SETTIMEOUT -- Set the message timeout value (in seconds).
| handle | samp handle | |
| name | application name |
References Samp::hub, and Hub::timeout.
| samp_setUserHandler | ( | handle_t | handle, | |
| String | mtype, | |||
| void * | func | |||
| ) |
Set the user-interface handler for the mtype.
SAMP_SETUSERHANDLER -- Set the user-interface handler for the mtype.
| handle | user handle to samp struct | |
| mtype | mtype name | |
| func | callback function |
References Samp::defaultUserFunc, Samp::nsubs, and Subs::userFunc.
Referenced by samp_Subscribe().
Handle a spectrum.load.* message.
SAMP_SPECLOADHANDLER -- Handle a spectrum.load.* message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getMapFromMap(), samp_getStringFromMap(), and samp_getUserHandler().
| stat samp_specLoadSSAGeneric | ( | handle_t | handle, | |
| String | recip, | |||
| String | url, | |||
| Map | meta, | |||
| String | spectrumId, | |||
| String | name | |||
| ) |
Load a generic spectrum from an SSA service.
SAMP_SPECLOADSSAGENERIC -- Load a generic spectrum from an SSA service.
| handle | samp struct handle | |
| recip | name of recipient (or 'all') | |
| url | URL of spectrum to load | |
| meta | Metadata map describing data found at the URL | |
| spectrumId | Identifier for spectrum (optional) | |
| name | Name used to label spectrum (optional); |
Return status of the task.
SAMP_STATUSHANDLER -- Return status of the task.
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, and samp_getUserHandler().
| void samp_Subscribe | ( | handle_t | handle, | |
| String | mtype, | |||
| void * | userFunc | |||
| ) |
Subscribe to a given mtype.
SAMP_SUBSCRIBE -- Subscribe to a given mtype.
| handle | user handle to samp struct | |
| mtype | mtype name | |
| func | callback function |
References Samp::nsubs, and samp_setUserHandler().
Tell an app to highlight a table row.
SAMP_TABLEHIGHLIGHTROW -- Tell an app to highlight a table row.
| handle | samp struct handle | |
| recip | Message recipient (or "all" for broadcast) | |
| tableId | ID associated with a previously loaded table | |
| url | URL to table to be loaded | |
| rows | List of (zero-based) row indices |
References Samp::hub, hub, samp_addIntParam(), samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
Tell an app to load a FITS table.
SAMP_TABLELOADFITS -- Tell an app to load a FITS table.
| handle | samp struct handle | |
| recip | Message recipient (or "all" for broadcast) | |
| url | URL to table to be loaded | |
| tableId | ID assigned to table (optional) | |
| name | Name assigned to table (optional) |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
| stat samp_tableLoadVOTable | ( | handle_t | handle, | |
| String | recip, | |||
| String | url, | |||
| String | tableId, | |||
| String | name | |||
| ) |
Tell an app to load a VOTable.
SAMP_TABLELOADVOTABLE -- Tell an app to load a VOTable.
| handle | samp struct handle | |
| recip | Message recipient (or "all" for broadcast) | |
| url | URL to table to be loaded | |
| tableId | ID assigned to table (optional) | |
| name | Name assigned to table (optional) |
References Samp::hub, hub, samp_freeMsg(), samp_msgParam(), samp_newMsg(), samp_newParam(), and samp_sendMsg().
| stat samp_tableSelectRowList | ( | handle_t | handle, | |
| String | recip, | |||
| String | tableId, | |||
| String | url, | |||
| int | rows[] | |||
| ) |
Tell an app to select a list of table rows.
SAMP_TABLESELECTROWLIST -- Tell an app to select a list of table rows.
| handle | samp struct handle | |
| recip | Message recipient (or "all" for broadcast) | |
| tableId | ID associated with a previously loaded table | |
| url | URL to table to be loaded | |
| rows | Array of (zero-based) row indices |
Handle a table.highlight.row message.
SAMP_TBHIGHLIGHTHANDLER -- Handle a table.highlight.row message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getIntFromMap(), samp_getStringFromMap(), and samp_getUserHandler().
Handle a table.load.* message.
SAMP_TBLOADHANDLER -- Handle a table.load.* message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getStringFromMap(), and samp_getUserHandler().
Handle a table.select.rowList message.
SAMP_TBSELECTHANDLER -- Handle a table.select.rowList message
| sender | sender name | |
| msg_id | message id | |
| msg_map | message map struct |
References Samp::handlerMode, samp_getListFromMap(), samp_getStringFromMap(), samp_getUserHandler(), and samp_listLen().
| stat 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().
| void samp_Unsubscribe | ( | handle_t | handle, | |
| String | mtype | |||
| ) |
Unsubscribe to a given mtype.
SAMP_UNSUBSCRIBE -- Unsubscribe to a given mtype.
| handle | user handle to samp struct | |
| mtype | mtype name |
References Samp::nsubs, samp_DeclareSubscriptions(), Subs::sampFunc, and Subs::userFunc.
| void sampClose | ( | handle_t | handle | ) |
Close the SAMP interface and free resources.
SAMP_CLOSE -- Close the SAMP interface.
| handle | user handle to samp struct |
References Samp::hubHandle, samp_freeHandle(), samp_hubClose(), and sampTrace().
Initialize the SAMP interface.
Prototype declarations.
SAMP_INIT -- Initialize the SAMP interface.
| appName | application name | |
| description | description of application |
References nullList, nullMap, OK_Map, samp_hubOpen(), samp_newHandle(), samp_newList(), samp_newMap(), samp_serverPort(), samp_setMapInMap(), samp_setStringInMap(), sampH, and sampTrace().
| sampLog | ( | handle_t | handle, | |
| char * | format, | |||
| ... | ||||
| ) |
SAMP message logger.
SAMPLOG -- SAMP message logger.
| handle | SAMP handle | |
| format | message format string |
References Samp::debug, and Samp::logfd.
| int sampShutdown | ( | handle_t | handle | ) |
Shut down the active SAMP interface.
SAMP_SHUTDOWN -- Shut down the active SAMP interface.
| handle | user handle to samp struct |
References Samp::active, Samp::hubHandle, samp_hubClose(), and Samp::svrThread.
Referenced by samp_processHubEvent().
| int sampStartup | ( | handle_t | handle | ) |
Startup the SAMP interface to send/receive messages.
SAMP_STARTUP -- Startup the SAMP interface to send/receive messages.
| handle | user handle to samp struct |
References Samp::active, Samp::hub, Samp::hubHandle, Hub::id, samp_hubDeclareMetadata(), samp_hubDeclareSubscriptions(), samp_hubOpen(), samp_mapClients(), and Samp::trace.
| sampTrace | ( | handle_t | handle, | |
| char * | format, | |||
| ... | ||||
| ) |
SAMP tracer.
SAMPTRACE -- SAMP tracer.
| handle | SAMP handle | |
| format | message format string |
References Samp::trace.
Referenced by samp_Metadata(), sampClose(), and sampInit().
1.5.9