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

sobject.h File Reference


Detailed Description

Public include file for the simple object library.

#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>

Include dependency graph for sobject.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  sobj_refcount
 Reference counting structure. More...
struct  sobj_buffer
 Structure representing a variable byte array. More...
struct  sobj_env_class
 A simple object environment class. More...
struct  sobj_env
 A simple object environment. More...

Find Flag Constants

Flag constants for the sobj_find() and sobj_substitute() functions.

#define SOBJ_FIND_CN   (1)
 Flag indicating that the relevant sub-object's class names must match the specified class name.
#define SOBJ_FIND_TYPE   (2)
 Flag indicating that the relevant sub-object's types must match the specified type.
#define SOBJ_FIND_RECURSIVE   (4)
 Flag indicating that the find/substitute operation should be performed recursively on the found/substituted objects.

Defines

#define SOBJ_REFCOUNT_T_FMT   "%lu"
 printf() style format string for converting a reference counter to decimal representation.
#define SOBJ_REFCOUNT_MASK   ((sobj_refcount_t)~0L >> 2)
 The reference counter mask.
#define SOBJ_RETAIN(OBJECT)   (sobj_retain((OBJECT)))
 Retain a reference counted object.
#define SOBJ_RELEASE(OBJECT)   (sobj_release((OBJECT)))
 Release a reference counted object.
#define SOBJ_UNRETAIN(OBJECT)   (sobj_unretain((OBJECT)))
 Release a reference counted object without discarding unreferenced objects.
#define SOBJ_DROP(OBJECT)   (sobj_drop((OBJECT)))
 Discard an unreferenced reference counted object.
#define SOBJ_XRETAIN(OBJECT)   (sobj_xretain((OBJECT)))
 Retain a reference counted object.
#define SOBJ_XRELEASE(OBJECT)   (sobj_xrelease((OBJECT)))
 Release a reference counted object.
#define SOBJ_XUNRETAIN(OBJECT)   (sobj_xunretain((OBJECT)))
 Release a reference counted object without discarding unreferenced objects.
#define SOBJ_XDROP(OBJECT)   (sobj_xdrop((OBJECT)))
 Discard an unreferenced reference counted object.
#define SOBJ_BUFFER_SIZE_STATIC   (1024)
 Size of the static buffer used in struct sobj_buffer.
#define SOBJ_BUFFER_INIT(BUFFER)
 Initialize a byte buffer instance.
#define SOBJ_BUFFER_DEINIT(BUFFER)
 De-initialize a byte buffer instance.
#define SOBJ_BUFFER_CLEAR(BUFFER)
 Clear a byte buffer instance.
#define SOBJ_BUFFER_LENGTH(BUFFER)   ((size_t)((BUFFER).so_length + 0))
 Return the length of a byte buffer.
#define SOBJ_BUFFER_BYTES(BUFFER)   ((const unsigned char *)((BUFFER).so_buffer + 0))
 Return a pointer to the byte array held by a byte buffer instance.
#define SOBJ_BUFFER_PUTC(BUFFER, X)
 Append a single character to the end of a byte buffer.
#define SOBJ_ENV_STANDARD   ((struct sobj_env *)1)
 Special constant representing the standard environment.
#define sobj_INT(VALUE, CN)   (sobj_INT_imax((VALUE), (CN)))
 Factory for simple objects of type int.
#define sobj_CSTRING(STR, CN)   (sobj_STRING_raw((STR), -1, (CN)))
 Convenience factory macro for creating a string from a C string.
#define sobj_ARRAY0(CN)   (sobj_ARRAY(0, 0, 0, 0, (CN)))
 Convenience factory macro for creating empty arrays.

Typedefs

typedef unsigned long sobj_refcount_t
 Integer type used for reference counters.
typedef int sobj_find_fn (struct sobj *sobj, void *so_sender)
 Function type for sobj_find() callback functions.
typedef sobjsobj_substitute_fn (struct sobj *sobj, void *so_sender)
 Function type for sobj_substitute() callback functions.

Enumerations

enum  sobj_msg_type { SOBJ_MSG_ERROR = 1, SOBJ_MSG_WARNING = 2, SOBJ_MSG_INFO = 3, SOBJ_MSG_DEBUG = 4 }
 Enumeration of message types. More...
enum  sobj_expr_type {
  SOBJ_EXPR_POS = 1, SOBJ_EXPR_NEG, SOBJ_EXPR_NOT, SOBJ_EXPR_PLUS,
  SOBJ_EXPR_MINUS, SOBJ_EXPR_MUL, SOBJ_EXPR_DIV, SOBJ_EXPR_MOD,
  SOBJ_EXPR_LS, SOBJ_EXPR_LS_APPROX, SOBJ_EXPR_LE, SOBJ_EXPR_LE_APPROX,
  SOBJ_EXPR_GT, SOBJ_EXPR_GT_APPROX, SOBJ_EXPR_GE, SOBJ_EXPR_GE_APPROX,
  SOBJ_EXPR_EQ, SOBJ_EXPR_EQ_APPROX, SOBJ_EXPR_NE, SOBJ_EXPR_NE_APPROX,
  SOBJ_EXPR_AND, SOBJ_EXPR_OR, SOBJ_EXPR_COND, SOBJ_EXPR_SEQ,
  SOBJ_EXPR_SEL, SOBJ_EXPR_INDEX, SOBJ_EXPR_CALL, SOBJ_EXPR_CAT
}
 Expression type enumeration for simple objects of type expr. More...
enum  sobj_type {
  SOBJ_TYPE_NIL = 0, SOBJ_TYPE_BOOL = 1, SOBJ_TYPE_INT = 2, SOBJ_TYPE_FLOAT = 3,
  SOBJ_TYPE_STRING = 4, SOBJ_TYPE_BINARY = 5, SOBJ_TYPE_ARRAY = 6, SOBJ_TYPE_EXPR = 7,
  SOBJ_TYPE_VREF = 8
}
 Object type enumeration. More...
enum  sobj_text_context {
  SOBJ_CTX_GENERAL = 1, SOBJ_CTX_SELECTION = 2, SOBJ_CTX_ARRAY = 3, SOBJ_CTX_EXPRESSION = 4,
  SOBJ_CTX_STRING = 5
}
 Enumeration of text serialization contexts. More...
enum  sobj_serialization_mode {
  SOBJ_SER_BINARY = 1, SOBJ_SER_TEXT = 2, SOBJ_SER_TEXT_COMPACT = 3, SOBJ_SER_TEXT_PRETTY = 4,
  SOBJ_SER_TEXT_DISPLAY = 5
}
 Enumeration of serialization modes. More...

Functions

void * sobj_malloc (size_t)
 Heap allocation function.
void * sobj_realloc (void *, size_t)
 Heap re-allocation function.
void sobj_free (void *)
 Heap free function.
char * sobj_strdup (const char *)
 Duplicate a null-terminated string.
void * sobj_retain (void *)
 Increase the referece count of an object (retain the object).
void sobj_release (void *)
 Decrease the referece count of an object and delete ob zero (release the object).
void sobj_unretain (void *)
 Decrease the referece count of an object without deletion on zero (unretain the object).
void sobj_drop (void *)
 Delete an object if the referece counter is zero.
sobj_refcount_t sobj_refcount (void *)
 Get the current referece counted of the specified object.
void * sobj_xretain (void *)
 Increase the referece count of an object (retain the object).
void sobj_xrelease (void *)
 Decrease the referece count of an object and delete ob zero (release the object).
void sobj_xunretain (void *)
 Decrease the referece count of an object without deletion on zero (unretain the object).
void sobj_xdrop (void *)
 Delete an object if the referece counter is zero.
void sobj_buffer_init (struct sobj_buffer *)
 Initialize a byte buffer instance.
void sobj_buffer_deinit (struct sobj_buffer *)
 De-initialize a byte buffer instance.
void sobj_buffer_clear (struct sobj_buffer *)
 Clear a byte buffer instance.
size_t sobj_buffer_length (const struct sobj_buffer *)
 Return the length of a byte buffer.
const unsigned char * sobj_buffer_bytes (const struct sobj_buffer *)
 Return a pointer to the byte array held by a byte buffer instance.
unsigned char * sobj_buffer_append (struct sobj_buffer *, ptrdiff_t)
 Append to a byte buffer.
unsigned char * sobj_buffer_insert (struct sobj_buffer *, size_t, ptrdiff_t)
 Insert data into a byte buffer.
void sobj_buffer_putc (struct sobj_buffer *, unsigned char)
 Append a single character to the end of a byte buffer.
void sobj_buffer_puts (struct sobj_buffer *, const char *)
 Append a null-terminated string to the end of a buffer.
void sobj_buffer_truncate (struct sobj_buffer *, size_t)
 Truncate a buffer instance to the specified size.
void sobj_buffer_remove (struct sobj_buffer *, size_t, ptrdiff_t)
 Remove a sequence of bytes from the buffer.
size_t sobj_buffer_line_start (const struct sobj_buffer *)
 Find the beginning of the current line.
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 *)
 Create a clone of an environment class.
void sobj_env_class_set_name (struct sobj_env_class *, const char *)
 Set the name of an environment class.
sobj_envnew_sobj_env (void)
 Create a new instance of an environment object.
sobj_envsobj_env_STANDARD (void)
 Return a copy of the standard environment.
sobj_envsobj_env_clone (struct sobj_env *)
 Create a clone of an environment object.
void sobj_env_add_class (struct sobj_env *, struct sobj_env_class *)
 Add an environment class to an environment object.
sobj_env_classsobj_env_find_class (struct sobj_env *, const char *)
 Find an environment class matching a specified name.
void sobj_env_clear_error (struct sobj_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 *, struct sobj_env_class ***, struct sobj_env_class **)
 Get a list of all classes of an environment object.
void sobj_env_set_error (struct sobj_env *, const char *, struct sobj_dict *)
 Set the error indicator of an environment.
void sobj_env_set_user_error (struct sobj_env *, struct sobj *)
 Set a user error object.
sobjsobj_NIL (const char *)
 Factory for simple objects of type nil.
sobjsobj_BOOL (bool, const char *)
 Factory for simple objects of type bool.
sobjsobj_INT_i (int, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_l (long, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_ll (long long, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_i8 (int8_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_i16 (int16_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_i32 (int32_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_i64 (int64_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_imax (intmax_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_u (unsigned, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_ul (unsigned long, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_ull (unsigned long long, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_u8 (uint8_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_u16 (uint16_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_u32 (uint32_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_u64 (uint64_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_umax (uintmax_t, const char *)
 Factory for simple objects of type int.
sobjsobj_INT_time_t (const void *)
 Factory for simple objects of type int.
sobjsobj_INT_timeval (const void *)
 Factory for simple objects of type int.
sobjsobj_INT_timespec (const void *)
 Factory for simple objects of type int.
sobjsobj_INT_iso8601_time (const void *)
 Factory for simple objects of type int.
sobjsobj_INT_time_now (void)
 Factory for simple objects of type int.
sobjsobj_FLOAT (double, const char *)
 Factory for simple objects of type float.
sobjsobj_FLOAT_nan (const char *)
 Factory for simple objects of type float with the value NAN (Not A Number).
sobjsobj_FLOAT_inf (const char *)
 Factory for simple objects of type float with the value INF (positive infinity).
sobjsobj_FLOAT_neginf (const char *)
 Factory for simple objects of type float with the value -INF (negative infinity).
sobjsobj_STRING (const char *, const char *, struct sobj_env *)
 String factory creating a string object from a text serialization in string context.
sobjsobj_STRING_raw (const char *, ptrdiff_t, const char *)
 String factory creating a string object from a raw UNICODE UTF-8 string.
sobjsobj_STRING_ucx (const char *, ptrdiff_t, const char *)
 String factory creating a string object from an extended UNICODE string.
sobjsobj_BINARY (struct sobj *, const unsigned char *, size_t, const char *)
 Factory creating simple objects of type binary.
sobjsobj_ARRAY (int, struct sobj **, int, struct sobj **, const char *)
 Factory for creating simple objects of type array.
sobjsobj_ARRAY1 (struct sobj *, struct sobj *, const char *)
 Convenience factory function for creating one-element arrays.
sobjsobj_ARRAY2 (struct sobj *, struct sobj *, struct sobj *, struct sobj *, const char *)
 Convenience factory function for creating two-element arrays.
sobjsobj_ARRAY_str (int, const char **, int, const char **, const char *)
 Convenience factory function for creating an array of strings.
sobjsobj_VREF (const char *, const char *)
 Factory function for creating simple objects of type vref.
sobjsobj_VREF_raw (const char *, const char *)
 Factory function for creating simple objects of type vref.
sobjsobj_VREF_ucx (const char *, const char *)
 Factory function for creating simple objects of type vref.
sobjsobj_EXPR (enum sobj_expr_type, struct sobj *, struct sobj *, struct sobj *, const char *)
 Factory function for creating simple objects of type expr.
sobjsobj_set_classname (struct sobj *, const char *)
 Change the class name of the called object.
sobjsobj_insert (struct sobj *, int, struct sobj *, struct sobj *)
 Insert an element (key/value pair) into an array object.
sobjsobj_insert_with_string (struct sobj *, int, const char *, struct sobj *)
 Insert an element (key/value pair) into an array object.
sobjsobj_insert_many (struct sobj *, int, int, struct sobj **, int, struct sobj **)
 Insert a sequence of elements (key/value pairs) into an array object.
sobjsobj_append (struct sobj *, struct sobj *, struct sobj *)
 Append an element (key/value pair) to an array object.
sobjsobj_append_with_string (struct sobj *, const char *, struct sobj *)
 Append an element (key/value pair) to an array object.
sobjsobj_append_many (struct sobj *, int, struct sobj **, int, struct sobj **)
 Append a sequence of elements (key/value pairs) to an array object.
sobjsobj_remove (struct sobj *, int, int)
 Remove a number of elements from an array object.
sobjsobj_remove_key (struct sobj *, struct sobj *, struct sobj_env *)
 Remove the last element whose key matches the specified key.
sobjsobj_remove_key_with_string (struct sobj *, const char *, struct sobj_env *)
 Remove the last element whose key matches the specified key.
sobjsobj_replace (struct sobj *, int, struct sobj *, struct sobj *)
 Replace an element in an array object.
sobjsobj_replace_with_string (struct sobj *, int, const char *, struct sobj *)
 Replace an element in an array object.
sobjsobj_put (struct sobj *, struct sobj *, struct sobj *, struct sobj_env *)
 Alter or add an element in/to an array object.
sobjsobj_put_with_string (struct sobj *, const char *, struct sobj *, struct sobj_env *)
 Alter or add an element in/to an array object.
sobjsobj_concat (struct sobj *, struct sobj *)
 Append an array object to an array object or a string object to a string object.
sobjsobj_set (struct sobj *, const char *, struct sobj *, bool, struct sobj_env *)
 Substitute a subobject at the specified address.
sobjsobj_set2 (struct sobj *, struct sobj *, struct sobj *, bool, struct sobj_env *)
 Substitute a subobject at the specified address.
sobjsobj_string_insert (struct sobj *, int, const char *)
 Insert a string into a string object.
sobjsobj_string_append (struct sobj *, const char *)
 Append a string to the end of a string object.
sobjsobj_string_replace (struct sobj *, int, int, const char *)
 Replace a substring of the specified string object.
sobjsobj_string_replace_ucx (struct sobj *, int, int, const char *)
 Replace a substring of the specified string object.
sobjsobj_index (struct sobj *, int)
 Perform an index operation.
sobjsobj_slice (struct sobj *, int, int)
 Perform a slice operation.
sobjsobj_select (struct sobj *, struct sobj *, struct sobj_env *)
 Perform a selection operation.
sobjsobj_select_with_string (struct sobj *, const char *, struct sobj_env *)
 Perform a selection operation using a string as the key.
sobjsobj_lookup (struct sobj *, struct sobj *, struct sobj_env *)
 Perform a dictionary lookup operation.
sobjsobj_lookup_with_string (struct sobj *, const char *, struct sobj_env *)
 Perform a dictionary lookup operation using a key string.
sobjsobj_call (struct sobj *, const char *, struct sobj *, struct sobj_env *)
 Perform a method call on a simple object.
int sobj_index_of (struct sobj *, struct sobj *, struct sobj_env *)
 Return the index of the element associated with the specified key.
int sobj_index_of_with_string (struct sobj *, const char *, struct sobj_env *)
 Return the index of the element associated with the specified key.
sobjsobj_address (const char *, struct sobj_env *)
 Convert an address string to an address object.
void sobj_address_string (struct sobj *, struct sobj_buffer *, struct sobj_env *)
 Convert an address object to an address string.
sobjsobj_get (struct sobj *, const char *, bool, struct sobj_env *)
 Get a subobject of the called object.
sobjsobj_get2 (struct sobj *, struct sobj *, bool, struct sobj_env *)
 Get a subobject of the called object.
sobjsobj_getf (struct sobj *, bool, struct sobj_env *, const char *,...)
 Get a subobject of the called object.
char * sobj_substring (struct sobj *, int, int, struct sobj_env *)
 Get a substring from the called object.
size_t sobj_string_length (struct sobj *)
 Return the length of a string (number of UNICODE characters).
enum sobj_type sobj_type (struct sobj *)
 Return the object type.
const char * sobj_typename (enum sobj_type, bool)
 Return a type name string for the specified type.
const char * sobj_classname (struct sobj *)
 Return the object class name.
unsigned long sobj_length (struct sobj *)
 Return the length of the object.
bool sobj_to_bool (struct sobj *, bool *)
 Convert a simple object to bool.
int sobj_to_int (struct sobj *, bool *)
 Convert a simple object to int.
long sobj_to_long (struct sobj *, bool *)
 Convert a simple object to long.
long long sobj_to_long_long (struct sobj *, bool *)
 Convert a simple object to long long.
unsigned sobj_to_unsigned (struct sobj *, bool *)
 Convert a simple object to unsigned.
unsigned long sobj_to_unsigned_long (struct sobj *, bool *)
 Convert a simple object to unsigned long.
unsigned long long sobj_to_unsigned_long_long (struct sobj *, bool *)
 Convert a simple object to unsigned long long.
int8_t sobj_to_int8_t (struct sobj *, bool *)
 Convert a simple object to int8_t.
int16_t sobj_to_int16_t (struct sobj *, bool *)
 Convert a simple object to int16_t.
int32_t sobj_to_int32_t (struct sobj *, bool *)
 Convert a simple object to int32_t.
int64_t sobj_to_int64_t (struct sobj *, bool *)
 Convert a simple object to int64_t.
intmax_t sobj_to_intmax_t (struct sobj *, bool *)
 Convert a simple object to intmax_t.
uint8_t sobj_to_uint8_t (struct sobj *, bool *)
 Convert a simple object to uint8_t.
uint16_t sobj_to_uint16_t (struct sobj *, bool *)
 Convert a simple object to uint16_t.
uint32_t sobj_to_uint32_t (struct sobj *, bool *)
 Convert a simple object to uint32_t.
uint64_t sobj_to_uint64_t (struct sobj *, bool *)
 Convert a simple object to uint64_t.
uintmax_t sobj_to_uintmax_t (struct sobj *, bool *)
 Convert a simple object to uintmax_t.
size_t sobj_to_size_t (struct sobj *, bool *)
 Convert a simple object to size_t.
ptrdiff_t sobj_to_ptrdiff_t (struct sobj *, bool *)
 Convert a simple object to ptrdiff_t.
float sobj_to_float (struct sobj *, bool *)
 Convert a simple object to float.
double sobj_to_double (struct sobj *, bool *)
 Convert a simple object to double.
size_t sobj_to_string (struct sobj *, char *, ptrdiff_t)
 Convert a simple object to a string.
bool sobj_is_nil (struct sobj *)
 Check if the called object is a classless nil object.
bool sobj_is_nil_with_cn (struct sobj *, const char *)
 Check if the called object is a nil object of the specified class.
bool sobj_is_bool (struct sobj *)
 Check if the called object is a classless boolean object.
bool sobj_is_bool_with_cn (struct sobj *, const char *)
 Check if the called object is a boolean object of the specified class.
bool sobj_is_int (struct sobj *)
 Check if the called object is a classless integer object.
bool sobj_is_int_with_cn (struct sobj *, const char *)
 Check if the called object is an integer object of the specified class.
bool sobj_is_float (struct sobj *)
 Check if the called object is a classless floating point object.
bool sobj_is_float_with_cn (struct sobj *, const char *)
 Check if the called object is a floating point object of the specified class.
bool sobj_is_number (struct sobj *)
 Check if the called object is a classless number.
bool sobj_is_number_with_cn (struct sobj *, const char *)
 Check if the called object is a number of the specified class.
bool sobj_is_string (struct sobj *)
 Check if the called object is a classless object of type string.
bool sobj_is_string_with_cn (struct sobj *, const char *)
 Check if the called object is a string object of the specified class.
bool sobj_is_simple_string (struct sobj *)
 Check if the called object is a classless simple string object.
bool sobj_is_simple_string_with_cn (struct sobj *, const char *)
 Check if the called object is a simple string object of the specified class.
bool sobj_is_binary (struct sobj *)
 Check if the called object is a classless binary object.
bool sobj_is_binary_with_cn (struct sobj *, const char *)
 Check if the called object is a binary object of the specified class.
bool sobj_is_plain_binary (struct sobj *)
 Check if the called object is a plain classless binary object.
bool sobj_is_plain_binary_with_cn (struct sobj *, const char *)
 Check if the called object is a plain binary object of the specified class.
bool sobj_is_array (struct sobj *)
 Check if the called object is a classless array object.
bool sobj_is_array_with_cn (struct sobj *, const char *)
 Check if the called object is an array object of the specified class.
bool sobj_is_plain_array (struct sobj *)
 Check if the called object is a plain classless array object.
bool sobj_is_plain_array_with_cn (struct sobj *, const char *)
 Check if the called object is a plain array object of the specified class.
bool sobj_is_int_array (struct sobj *)
 Check if the called object is a plain classless integer array object.
bool sobj_is_int_array_with_cn (struct sobj *, const char *)
 Check if the called object is a plain integer array object of the specified class.
bool sobj_is_float_array (struct sobj *)
 Check if the called object is a plain classless floating point array object.
bool sobj_is_float_array_with_cn (struct sobj *, const char *)
 Check if the called object is a plain floating point array object of the specified class.
bool sobj_is_number_array (struct sobj *)
 Check if the called object is a plain classless number array object.
bool sobj_is_number_array_with_cn (struct sobj *, const char *)
 Check if the called object is a plain number array object of the specified class.
bool sobj_is_string_array (struct sobj *)
 Check if the called object is a plain classless string array object.
bool sobj_is_string_array_with_cn (struct sobj *, const char *)
 Check if the called object is a plain string array object of the specified class.
bool sobj_is_simple_string_array (struct sobj *)
 Check if the called object is a plain classless simple string array object.
bool sobj_is_simple_string_array_with_cn (struct sobj *, const char *)
 Check if the called object is a plain simple string array object of the specified class.
bool sobj_is_dict (struct sobj *)
 Check if the called object is a classless dictionary object.
bool sobj_is_dict_with_cn (struct sobj *, const char *)
 Check if the called object is a dictionary object with the specified class name.
bool sobj_is_simple_dict (struct sobj *)
 Check if the called object is a classless simple dictionary object.
bool sobj_is_simple_dict_with_cn (struct sobj *, const char *)
 Check if the called object is a simple dictionary object with the specified class name.
bool sobj_is_expr (struct sobj *)
 Check if the called object is a classless expression object.
bool sobj_is_expr_with_cn (struct sobj *, const char *)
 Check if the called object is an expression object of the specified class.
bool sobj_is_vref (struct sobj *)
 Check if the called object is a classless vref object.
bool sobj_is_vref_with_cn (struct sobj *, const char *)
 Check if the called object is a vref object of the specified class.
int sobj_test (struct sobj *, const char *, struct sobj_env *)
 Check if the called object matches the specified type specification.
char * sobj_str (struct sobj *, struct sobj_env *)
 Create a string representation of a simple object.
size_t sobj_string_ucx (struct sobj *, char *, ptrdiff_t)
 Get the extended UNICODE string from a string object.
sobjsobj_binary_type_id (struct sobj *)
 Get the type id of a simple object of type binary.
const unsigned char * sobj_binary_data (struct sobj *, size_t *)
 Get the data field of a simple object of type binary.
size_t sobj_binary_copy_data (struct sobj *, unsigned char *, ptrdiff_t)
 Get the data field of a simple object of type binary.
int sobj_array_count (struct sobj *)
 Get the number of elements stored in an array object.
void sobj_array_values (struct sobj *, struct sobj **)
 Get the values stored in an array object.
void sobj_array_keys (struct sobj *, struct sobj **)
 Get the keys stored in an array object.
sobjsobj_array_value (struct sobj *, int)
 Get an array value at a specified index.
sobjsobj_array_key (struct sobj *, int)
 Get an array key at a specified index.
const char * sobj_vref_ref (struct sobj *)
 Get the reference string from a vref object.
enum sobj_expr_type sobj_expr_type (struct sobj *)
 Get the expression type from an expression object.
int sobj_expr_op_count (struct sobj *)
 Get the number of operands from an expression object.
int sobj_expr_op (struct sobj *, struct sobj **)
 Get the operands from an expression object.
sobjsobj_eval (struct sobj *, struct sobj_env *)
 Perform an object evaluation.
sobjsobj_resolve (struct sobj *, bool, struct sobj_env *)
 Resolve variable references.
sobjsobj_copy (struct sobj *)
 Create a (flat) copy of a simple object.
int sobj_compare (struct sobj *, struct sobj *, struct sobj_env *)
 Perform an ordered comparison of the called object with the specified object operand.
sobjsobj_unpack (const char *, ptrdiff_t, enum sobj_text_context, struct sobj_env *)
 Deserialize a simple object.
sobjsobj_unpack_x (const char **, ptrdiff_t, enum sobj_text_context, struct sobj_env *)
 Deserialize a simple object.
sobjsobj_unpack_fp (FILE *, ptrdiff_t, enum sobj_text_context, struct sobj_env *)
 Deserialize a simple object from a standard C stream.
int sobj_unpack_scan (int(*)(void *), void *, struct sobj_buffer *, long)
 Scan for the end of a serialization of a simple object.
size_t sobj_pack (struct sobj *, enum sobj_serialization_mode, struct sobj_buffer *, struct sobj_env *)
 Create a serialization from a simple object instance.
size_t sobj_pack_fp (struct sobj *, enum sobj_serialization_mode, FILE *, struct sobj_env *)
 Create a serialization from a simple object instance.
size_t sobj_pack_ccode (struct sobj *, struct sobj_buffer *, bool, struct sobj_env *)
 Serialize a simple object to a C expression.
int sobj_scanf (struct sobj *, struct sobj_env *, const char *,...)
 Scan an object according to a format string.
int sobj_scanff (struct sobj *, struct sobj_env *, const char *,...)
 Scan an object according to a format string.
sobjsobj_build (struct sobj_env *, const char *,...)
 Build a simple object instance from a format string and a variable argument list.
sobjsobj_build_ctx (struct sobj_env *, enum sobj_text_context, const char *,...)
 Build a simple object instance from a format string and a variable argument list.
int sobj_find (struct sobj *, const char *, enum sobj_type, sobj_find_fn *, void *, int)
 Find sub-objects of the specified object matching the specified criteria.
int sobj_find_cn (struct sobj *, const char *, sobj_find_fn *, void *)
 Find sub-objects of the specified object matching the specified class name.
int sobj_find_type (struct sobj *, enum sobj_type, sobj_find_fn *, void *)
 Find sub-objects of the specified object matching the specified type.
int sobj_find_list (struct sobj *, const char *, enum sobj_type, struct sobj **, int, int)
 Create a list of all sub-objects matching the specified criteria.
int sobj_find_cn_list (struct sobj *, const char *, struct sobj **, int)
 Create a list of all sub-objects matching the specified class name.
int sobj_find_type_list (struct sobj *, enum sobj_type, struct sobj **, int)
 Create a list of all sub-objects matching the specified class name.
sobjsobj_substitute (struct sobj *, const char *, enum sobj_type, sobj_substitute_fn *, void *, int)
 In the specified objects substitute sub-objects matching the specified criteria.
sobjsobj_substitute_cn (struct sobj *, const char *, sobj_substitute_fn *, void *)
 In the specified objects substitute sub-objects matching the specified class name.
sobjsobj_substitute_type (struct sobj *, enum sobj_type, sobj_substitute_fn *, void *)
 In the specified objects substitute sub-objects matching the specified class name.
void sobj_dump (struct sobj *)
 Dump an object representation to standard error.
void sobj_cleanup (void)
 Final cleanup function.
const char * sobj_version (const char *)
 Get the library version number.


Function Documentation

unsigned char* sobj_buffer_insert struct sobj_buffer sobj_buffer,
size_t  offset,
ptrdiff_t  count
 

Insert data into a byte buffer.

Parameters:
sobj_buffer The byte buffer instance.
offset The offset of the insert position. If this is larger than the buffer size, then the specified data is appended to the buffer.
count The number of bytes to be inserted.
Returns:
A pointer to the first byte of the bytes inserted.

void sobj_dump struct sobj sobj  ) 
 

Dump an object representation to standard error.

The function uses the SOBJ_SER_TEXT_DISPLAY mode (i.e. the ClassEnv::pack() call is skipped).

Parameters:
sobj The object to be dumped.
See also:
sobj_xdump().


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