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

sobj_build.c File Reference


Detailed Description

Functions for building a simple object.

Simple objects can be created using the sobj_build() or sobj_vbuild() function, using a format string and a variable argument list.

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <math.h>
#include <stdarg.h>
#include <unistd.h>
#include "sobject_p.h"

Include dependency graph for sobj_build.c:

Include dependency graph

Data Structures

struct  sobj_build_env
 Helper object for the environment used to build an object. More...

Functions

int sobj_build_so_message (void *, int, const char *, struct sobj_dict *, const char *)
 Object building environment helper.
char * sobj_build_so_str (void *, struct sobj *)
 Object building environment helper.
sobjsobj_build_so_vref (void *, const char *)
 Object building environment helper.
char * sobj_build_so_vref_str (void *, const char *)
 Object building environment helper.
sobjsobj_build (struct sobj_env *env, const char *format,...)
 Build a simple object instance from a format string and a variable argument list.
sobjsobj_vbuild (struct sobj_env *env, const char *format, va_list ap)
 Build a simple object instance from a format string and a variable argument list.
sobjsobj_build_ctx (struct sobj_env *env, enum sobj_text_context context, const char *format,...)
 Build a simple object instance from a format string and a variable argument list.
sobjsobj_vbuild_ctx (struct sobj_env *env, enum sobj_text_context context, const char *format, va_list ap)
 Build a simple object instance from a format string and a variable argument list.

Function Documentation

int sobj_build_so_message void *  self,
int  type,
const char *  id,
struct sobj_dict args,
const char *  message
[static]
 

Object building environment helper.

This is a wrapper function calling the so_message hook of the environment provided by the caller.

Parameters:
self 
type 
id 
args 
message 
Returns:
The return value received from the called so_message hook, or -1 if no function is hooked.

char * sobj_build_so_str void *  self,
struct sobj object
[static]
 

Object building environment helper.

This is a wrapper function calling the so_str hook of the environment provided by the caller.

Parameters:
self 
object 
Returns:
The return value received from the called so_str hook, or null if no function is hooked.

struct sobj * sobj_build_so_vref void *  self,
const char *  ref
[static]
 

Object building environment helper.

Variable resolution callback for building objects. If the reference string ref has the format {%type}, then the corresponding argument is read from the argument pointer sobj_build_env::ap and the value is returned as a simple object. If the reference string does not match this pattern, the variable resolution callback so_vref of the callers environment is used to resolve the variable (if present).

Parameters:
self 
ref 
Returns:
The resolved object, or null if the reference string does not match the object building pattern and the hooked so_vref function in the callers environment returned null (or if no such function is hooked).

char * sobj_build_so_vref_str void *  self,
const char *  ref
[static]
 

Object building environment helper.

This is a wrapper function calling the so_str hook of the environment provided by the caller.

Parameters:
self 
ref 
Returns:
The return value received from the called so_str hook, or null if no function is hooked.

Bug:
The function does currently not support conversion vrefs embedded in strings. Using such conversion vrefs might cause invalid results or a program chash.


Generated on Sat Jul 23 16:04:52 2005 for sobject by  doxygen 1.3.9.1