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

Object Building Functions
[Simple Objects C API]


Detailed Description

Functions for building simple object instances from a format specification and a variable argument list.

The building functions in this module can be used as a ``super factory'' for simple object instances. The format string is a text serialization of a simple object containing special variable references of the form ${%type}, all other variable references are taken literally. The type field is a sequence of characters similar to a printf() style escape sequence:

The length identifier
Here, the term ``integer conversion'' stands for d, i, or u conversion. The length identifier is optional.

The conversion specifier
The conversion specifier is one of the following:

In a first pass processing the specified format string, all double-'%' are replaced by single percent signs.

printf() Compatibility
The format string syntax is defined in a way that is argument-compatible with a standard printf() format string. As a consequence, some compilers (e.g. the GNU C compiler) can perform a consistency check on the format string and specified argument list. It is also possible to substitute the sobj_build() function with a printf() family function are get a useful output (with false represented by hex 0 and true represented by hex 1).


Functions

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

struct sobj* sobj_build struct sobj_env env,
const char *  format,
  ...
 

Build a simple object instance from a format string and a variable argument list.

Parameters:
env The environment used to resolve the resulting object. The function will intercept so_vref() callbacks matching the format pattern {%type}.
format The format string.
... The variable arguments referenced in the format string.
Returns:
On success, the function returns the object created. In case of an error, a null-pointer is returned.

Bug:
The function does currently not support conversion vrefs embedded in strings. Using such conversion vrefs might cause invalid results or a program chash.
See also:
sobj_vbuild(), sobj_build_ctx().

struct sobj* sobj_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.

This is a variant of the sobj_build() function accepting an additional context parameter.

Parameters:
env The environment used to resolve the resulting object. The function will intercept so_vref() callbacks matching the format pattern {%type}.
context The context used for interpreting the format string.
format The format string.
... The variable arguments referenced in the format string.
Returns:
On success, the function returns the object created. In case of an error, a null-pointer is returned.

Bug:
The function does currently not support conversion vrefs embedded in strings. Using such conversion vrefs might cause invalid results or a program chash.
See also:
sobj_vbuild_ctx(), sobj_build().

struct sobj* sobj_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.

This is the va_list variant of the sobj_build() function.

Parameters:
env The environment used to resolve the resulting object. The function will intercept so_vref() callbacks matching the format pattern {%type}.
format The format string.
ap The variable arguments referenced in the format string.
Returns:
On success, the function returns the object created. In case of an error, a null-pointer is returned.

Bug:
The function does currently not support conversion vrefs embedded in strings. Using such conversion vrefs might cause invalid results or a program chash.
See also:
sobj_build(), sobj_vbuild_ctx().

struct sobj* sobj_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.

This is the va_list variant of the sobj_build_ctx() function.

Parameters:
env The environment used to resolve the resulting object. The function will intercept so_vref() callbacks matching the format pattern {%type}.
context The context used for interpreting the format string.
format The format string.
ap The variable arguments referenced in the format string.
Returns:
On success, the function returns the object created. In case of an error, a null-pointer is returned.

Bug:
The function does currently not support conversion vrefs embedded in strings. Using such conversion vrefs might cause invalid results or a program chash.
See also:
sobj_build_ctx(), sobj_vbuild().


Generated on Sat Jul 23 16:07:33 2005 for sobject by  doxygen 1.3.9.1