sampMap.c File Reference

(Internal) Interface to support the Map structure More...

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

Functions

handle_t samp_newMap ()
 Create a new Map object.
void samp_freeMap (Map map)
 Free the given Map object.
int samp_getMapSize (Map map)
char * samp_getMapKey (Map map, int index)
char * samp_getMapVal (Map map, int index)
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.


Detailed Description

(Internal) Interface to support the Map structure

SAMPMAP.C -- (Internal) Interface to support the Map structure

map = samp_newMap () samp_freeMap (Map map)

nelem = samp_getMapSize (Map map) key = samp_getMapKey (Map map, int index) val = samp_getMapVal (Map map, int index)

samp_setStringInMap (Map map, char *value) samp_setMapInMap (Map map1, Map map2) samp_setListInMap (Map map, List list) samp_setIntInMap (Map map, int ival) samp_setFloatInMap (Map map, float rval)

str = samp_getStringFromMap (Map map, char *key) map = samp_getMapFromMap (Map map, char *key) list = samp_getListFromMap (Map map, char *key) ival = samp_getIntFromMap (Map map, char *key) rval = samp_getFloatFromMap (Map map, char *key)

Author:
Mike Fitzpatrick
Date:
7/10/09

Function Documentation

void samp_freeMap ( Map  map  ) 

Free the given Map object.

SAMP_FREEMAP -- Free the given Map object

Parameters:
map Map object to free
Returns:
nothing

Referenced by samp_envGetHandler(), samp_hubDeclareSubscriptions(), samp_paramGetHandler(), and samp_Ping().

float samp_getFloatFromMap ( Map  map,
char *  key 
)

Get a float from the Map.

SAMP_GETFLOATFROMMAP -- Get a float from the Map

Parameters:
map handle to Map object
key Map key
Returns:
floating point value

Referenced by samp_execUserHandler(), and samp_pointAtHandler().

int samp_getIntFromMap ( Map  map,
char *  key 
)

Get a integer from the Map.

SAMP_GETINTFROMMAP -- Get a integer from the Map

Parameters:
map handle to Map object
key Map key
Returns:
integer value

Referenced by samp_execUserHandler(), and samp_tbHighlightHandler().

List samp_getListFromMap ( Map  map,
char *  key 
)

Get a LIST from the Map.

SAMP_GETLISTFROMMAP -- Get a LIST from the Map

Parameters:
map handle to Map object
key Map key
Returns:
handle to List value

Referenced by samp_execUserHandler(), and samp_tbSelectHandler().

Map samp_getMapFromMap ( Map  map,
char *  key 
)

Get a Map from the Map.

SAMP_GETMAPFROMMAP -- Get a Map from the Map

Parameters:
map handle to Map object
key Map key
Returns:
handle to Map value

Referenced by samp_execUserHandler(), samp_resConeHandler(), samp_resLoadHandler(), samp_resSiapHandler(), samp_resSsapHandler(), samp_resTapHandler(), samp_resVOSpaceHandler(), samp_specLoadHandler(), and samp_specSSAHandler().

char* samp_getStringFromMap ( Map  map,
char *  key 
)

handle_t samp_newMap ( void   ) 

Create a new Map object.

SAMP_NEWMAP -- Create a new Map object

Returns:
handle to new Map

Referenced by samp_envGetHandler(), samp_getNullMap(), samp_getOKMap(), samp_paramGetHandler(), and sampInit().

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)

Parameters:
map handle to Map object
key Map key
value value
Returns:
nothing

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)

Parameters:
map handle to Map object
key Map key
value value
Returns:
nothing

void samp_setListInMap ( Map  map,
char *  key,
List  list 
)

Set a List in a Map (append).

SAMP_SETLISTINMAP -- Set a List in a Map (append)

Parameters:
map handle to Map object
key Map key
list handle to List object to set
Returns:
nothing

void samp_setMapInMap ( Map  map1,
char *  key,
Map  map2 
)

Set a Map in a Map (append).

SAMP_SETMAPINMAP -- Set a Map in a Map (append)

Parameters:
map1 handle to Map object
key Map key
map2 handle to Map object to set
Returns:
nothing

Referenced by samp_envGetHandler(), samp_getOKMap(), samp_paramGetHandler(), and sampInit().

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)

Parameters:
map handle to Map object
key Map key
value Map value
Returns:
nothing

Referenced by samp_envGetHandler(), samp_getOKMap(), samp_paramGetHandler(), and sampInit().


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