#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Integra/integra_value.h"
#include "Integra/integra_types.h"
#include "Integra/integra_error.h"
#include "Integra/integra_bridge.h"
#include "memory.h"
#include "helper.h"
Functions | |
int | ntg_value_sprintf (char *s, const ntg_value *value) |
Prints a ntg_value to a C string. | |
void | ntg_value_copy (ntg_value *target, const ntg_value *source, const int source_type, const int target_type) |
Copies the source value into target. | |
void | ntg_value_set (ntg_value *value, int type, void *v) |
Set an ntg_value as given by type. | |
ntg_value * | ntg_value_new (int type, void *v) |
Returns a pointer to a newly allocated value. | |
void | ntg_value_append (ntg_value *values, const ntg_value *value) |
Append an ntg_value to an existing array of ntg_values. | |
int | ntg_value_free (ntg_value *value) |
Value free. | |
float | ntg_value_get_float (const ntg_value *value) |
Get the type of a value. | |
int | ntg_value_get_int (const ntg_value *value) |
Gets a int from an ntg_value. | |
unsigned char * | ntg_value_get_blob (const ntg_value *value) |
Gets a string from an ntg_value. | |
char * | ntg_value_get_string (const ntg_value *value) |
Gets a string from an ntg_value. |
Append an ntg_value to an existing array of ntg_values.
References ARRAY_ELEMENTS, and ntg_realloc().
void ntg_value_copy | ( | ntg_value * | target, | |
const ntg_value * | source, | |||
const int | source_type, | |||
const int | target_type | |||
) |
Copies the source value into target.
ntg_value | *target A pointer to an ntg_value struct that will b used to store the value | |
ntg_calue | *source A pointer to an ntg_value struct that contains the source value |
References ntg_value_::ctype, ntg_value_::ctype_::f, ntg_value_::ctype_::i, NTG_FLOAT, NTG_INTEGER, ntg_malloc(), ntg_print_error(), NTG_STRING, ntg_value_sprintf(), ntg_value_::ctype_::s, and ntg_value_::type.
Referenced by ntg_instance_attribute_set_value().
int ntg_value_free | ( | ntg_value * | value | ) |
Value free.
References ntg_value_::ctype, ntg_free(), NTG_STRING, ntg_value_::ctype_::s, and ntg_value_::type.
unsigned char* ntg_value_get_blob | ( | const ntg_value * | value | ) |
Gets a string from an ntg_value.
References ntg_value_::ctype_::b, ntg_value_::ctype, NTG_BLOB, ntg_print_error(), and ntg_value_::type.
float ntg_value_get_float | ( | const ntg_value * | value | ) |
Get the type of a value.
Gets a float from an ntg_value
References ntg_value_::ctype, ntg_value_::ctype_::f, NTG_FLOAT, ntg_print_error(), and ntg_value_::type.
int ntg_value_get_int | ( | const ntg_value * | value | ) |
Gets a int from an ntg_value.
References ntg_value_::ctype, ntg_value_::ctype_::i, NTG_INTEGER, ntg_print_error(), and ntg_value_::type.
char* ntg_value_get_string | ( | const ntg_value * | value | ) |
Gets a string from an ntg_value.
References ntg_value_::ctype, ntg_print_error(), NTG_STRING, ntg_value_::ctype_::s, and ntg_value_::type.
Referenced by ntg_server_fix_connections().
ntg_value* ntg_value_new | ( | int | type, | |
void * | v | |||
) |
Returns a pointer to a newly allocated value.
References ntg_value_::ctype, ntg_malloc(), NTG_NIL, ntg_value_set(), ntg_value_::ctype_::s, and ntg_value_::type.
void ntg_value_set | ( | ntg_value * | value, | |
int | type, | |||
void * | v | |||
) |
Set an ntg_value as given by type.
ntg_value | *target A pointer to an ntg_value struct that will b used to store the value | |
int | type the constant giving the type of the value e.g. NTG_FLOAT | |
void | *v A pointer to the actual value |
References ntg_value_::ctype, ntg_value_::ctype_::f, ntg_value_::ctype_::i, NTG_FLOAT, ntg_free(), NTG_INTEGER, ntg_malloc(), NTG_STRING, ntg_value_::ctype_::s, and ntg_value_::type.
Referenced by ntg_server_fix_connections(), and ntg_value_new().
int ntg_value_sprintf | ( | char * | s, | |
const ntg_value * | value | |||
) |
Prints a ntg_value to a C string.
References ntg_value_::ctype, ntg_value_::ctype_::f, ntg_value_::ctype_::i, NTG_FLOAT, NTG_INTEGER, NTG_STRING, ntg_value_::ctype_::s, and ntg_value_::type.
Referenced by ntg_instance_attribute_print(), and ntg_value_copy().