hamsterdb Embedded Database  2.1.7
Data Structures | Typedefs | Functions
hamsterdb Embedded Server

Data Structures

struct  ham_srv_config_t
 

Typedefs

typedef struct ham_srv_t ham_srv_t
 

Functions

ham_status_t ham_srv_init (ham_srv_config_t *config, ham_srv_t **srv)
 
ham_status_t ham_srv_add_env (ham_srv_t *srv, ham_env_t *env, const char *urlname)
 
void ham_srv_close (ham_srv_t *srv)
 

Detailed Description

Typedef Documentation

typedef struct ham_srv_t ham_srv_t

Definition at line 55 of file hamsterdb_srv.h.

Function Documentation

ham_status_t ham_srv_add_env ( ham_srv_t srv,
ham_env_t env,
const char *  urlname 
)

Add a hamsterdb Environment

This function adds a new hamsterdb Environment to the server. The Environment has to be initialized properly by the caller. It will be served at ham://localhost:port/urlname, where port was specified for ham_srv_init and urlname is the third parameter to this function.

A client accessing this Environment will specify this URL as a filename, and hamsterdb will transparently connect to this server.

Parameters
srvA valid ham_srv_t handle
envA valid hamsterdb Environment handle
urlnameURL of this Environment
Returns
HAM_SUCCESS on success
HAM_LIMITS_REACHED if more than the max. number of Environments were added (default limit: 128)

Referenced by main().

void ham_srv_close ( ham_srv_t srv)

Referenced by main().

ham_status_t ham_srv_init ( ham_srv_config_t config,
ham_srv_t **  srv 
)

Initialize the server

This function initializes a ham_srv_t handle and starts the hamsterdb database server on the port specified in the configuration object.

Parameters
configA configuration structure
srvA pointer to a ham_srv_t pointer; will be allocated if this function returns successfully
Returns
HAM_SUCCESS on success
HAM_OUT_OF_MEMORY if memory could not be allocated

Referenced by main().