Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sobj_env.c File Reference


Detailed Description

Simple object environments and environment classes.

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "sobject_p.h"

Include dependency graph for sobj_env.c:

Include dependency graph

Data Structures

struct  sobj_env_private
 Private structure derived from sobj_env. More...
struct  sobj_env_class_private
 Private structure derived from sobj_env_class. More...
struct  sobj_class_name_to_id
 Element mapping a class ID to a class name. More...

Functions

void sobj_env_class_init (struct sobj_env_class *)
 Initialize an instance of an environment class.
void sobj_env_class_deinit (struct sobj_env_class *)
 De-initialize an instance of an environment class.
void sobj_env_class_del (void *)
 Destructor callback function for environment classes.
void sobj_env_init (struct sobj_env *)
 Initialize an environment object.
void sobj_env_deinit (struct sobj_env *)
 De-initialize an environment object.
void sobj_env_del (void *)
 Destructor callback function for environment objects.
sobj_env_classnew_sobj_env_class (void)
 Create a new instance of an environment class.
sobj_env_classsobj_env_class_clone (struct sobj_env_class *env_class)
 Create a clone of an environment class.
void sobj_env_class_set_name (struct sobj_env_class *env_class, const char *name)
 Set the name of an environment class.
sobj_envnew_sobj_env (void)
 Create a new instance of an environment object.
sobj_envsobj_env_clone (struct sobj_env *env)
 Create a clone of an environment object.
void sobj_env_add_class (struct sobj_env *env, struct sobj_env_class *env_class)
 Add an environment class to an environment object.
sobj_env_classsobj_env_find_class (struct sobj_env *env, const char *name)
 Find an environment class matching a specified name.
void sobj_env_clear_error (struct sobj_env *env)
 Clear the environment error indicator.
size_t sobj_env_sizeof (void)
 Return the size of an environment object.
int sobj_env_get_classes (struct sobj_env *env, struct sobj_env_class ***class_list_ptr, struct sobj_env_class **default_class_ptr)
 Get a list of all classes of an environment object.
void sobj_env_set_error (struct sobj_env *env, const char *id, struct sobj_dict *args)
 Set the error indicator of an environment.
void sobj_env_set_user_error (struct sobj_env *env, struct sobj *error)
 Set a user error object.
int sobj_class_name_to_id (const char *name)
 Get the class ID for the specified class name.
const char * sobj_class_id_to_name (int id)
 Get the class name for a specified class ID.
void sobj_env_cleanup (void)
 Final cleanup function.

Function Documentation

const char* sobj_class_id_to_name int  id  ) 
 

Get the class name for a specified class ID.

Parameters:
id The class ID. It is a fatal runtime error if the specified ID is not assigned.
Returns:
The requested class name. For the class ID 0 a null-pointer is returned.
Note:
The pointer returned is a pointer to the string stored in the ID table. This is safe, even in a multi-threading environment, since class names can only be added to the table, but not removed.

int sobj_class_name_to_id const char *  name  ) 
 

Get the class ID for the specified class name.

If the specified class name is unknown, a new class ID is assigned to the specified name.

Parameters:
name The class name. If this is a null-pointer or an empty string, the corresponding class ID will be 0.
Returns:
The class ID. 0 if the specified name is a null-pointer or an empty string.

void sobj_env_class_deinit struct sobj_env_class env_class  )  [static]
 

De-initialize an instance of an environment class.

Parameters:
env_class The environment class.

void sobj_env_class_del void *  self  )  [static]
 

Destructor callback function for environment classes.

Parameters:
self Generic pointer to the environment class.

void sobj_env_class_init struct sobj_env_class env_class  )  [static]
 

Initialize an instance of an environment class.

Parameters:
env_class Pointer to an un-initialized environment class.

void sobj_env_cleanup void   ) 
 

Final cleanup function.

void sobj_env_deinit struct sobj_env env  )  [static]
 

De-initialize an environment object.

Parameters:
env The environment object.

void sobj_env_del void *  self  )  [static]
 

Destructor callback function for environment objects.

Parameters:
self Generic pointer to the environment object.

void sobj_env_init struct sobj_env env  )  [static]
 

Initialize an environment object.

Parameters:
env Pointer to an un-initialized environment object.


Generated on Sat Jul 23 16:05:08 2005 for sobject by  doxygen 1.3.9.1