Next: , Previous: , Up: Server functions   [Contents][Index] Configuration

These functions provide an interface for configuring a server. They are used to create and modify the default configuration of a server type in order to create a server configuration.

Function: int svz_config_type_instantiate (char *type, char *name, char *instance, void *options, svz_config_accessor_t *accessor, size_t ebufsz, char *ebuf)

Instantiate a configurable type. The type argument specifies the configurable type name, name the name of the type (in the domain of the configurable type) and instance the instance name of the type. Return zero on success, otherwise -1.

Function: void svz_config_free (svz_config_prototype_t *prototype, void *cfg)

Release the configuration cfg of the given configuration prototype prototype. If cfg is NULL, do nothing.

Function: void * svz_collect (int type, size_t count, void *data)

Create a collection of type, given the count items of data. Valid values of type are one of: SVZ_INTARRAY, SVZ_STRARRAY, SVZ_STRHASH. For a string hash, data should be alternating keys and values; the returned hash table will have count / 2 elements. The C type of data for an int array should be int[], and for string array or hash it should be char*[]. On error (either bad type or odd count for string hash), return NULL.

Here are some convenience macros for svz_collect:


Return an integer array svz_array_t * created from int cvar[].


Return a string array svz_array_t * created from char *cvar[].


Return a string hash svz_hash_t * created from char *cvar[].