#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include "samp.h"
Defines | |
#define | MAX_HANDLES 128 |
Functions | |
handle_t | samp_P2H (void *ptr) |
void * | samp_H2P (handle_t handle) |
handle_t | samp_newHandle (void *ptr) |
void | samp_freeHandle (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 () |
Return a unique port number for the server. | |
void | samp_printMetadata (handle_t handle, String name) |
Print the metadata for the application. | |
char * | samp_getMetadata (handle_t handle, String name) |
Get the metadata item for the application. | |
Variables | |
int | numHandles = 0 |
long | sampHandles [MAX_HANDLES] |
SAMPUTIL.C -- Utility methods to convert struct pointers to user handles.
char* 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().
char* samp_getMetadata | ( | handle_t | handle, | |
String | name | |||
) |
Get the metadata item for the application.
SAMP_GETMETADATA -- Get the metadata item for the application.
handle | samp handle |
References appMD::aKey, appMD::aVal, Samp::description, appMD::docURL, appMD::iconURL, Samp::meta, and appMD::nkeys.
char* 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.
void samp_printMetadata | ( | handle_t | handle, | |
String | name | |||
) |
Print the metadata for the application.
SAMP_PRINTMETADATA -- Print the metadata for the application.
handle | samp handle |
References appMD::aKey, appMD::aVal, Samp::description, appMD::docURL, appMD::iconURL, Samp::meta, and appMD::nkeys.
int 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().