DataSource for C SDK  6.2.20.310828
Field Management

Macros

#define DS_FIELDS_NOT_DEFINED
 Value returned by field API functions when a field is not defined. More...
 

Functions

int ds_fields_add (int num, const char *name, int flags, int dp, const char *fmt)
 Add a new field to the field list. More...
 
int ds_fields_getdp (int index)
 Return the decimal precision of this index. More...
 
int ds_fields_getflags (int index)
 Return the field flags of this index. More...
 
int ds_fields_indexbyname (const char *name)
 Return the index of this field. More...
 
int ds_fields_indexbynum (int num)
 Return the index of this field. More...
 
int ds_fields_max ()
 Return the number of fields that have been defined. More...
 
char * ds_fields_namebyindex (int index)
 Return the field name of this index. More...
 
char * ds_fields_namebynum (int num)
 Return the field name of this field number. More...
 
int ds_fields_numbyindex (int index)
 Return the field number of this index. More...
 
int ds_fields_numbyname (const char *name)
 Return the field number of this field. More...
 

Detailed Description

The field management API gives programmatic access to configured fields. A field can be referenced in a number of ways, these functions provide ways to access and map between them.

A field contains:

The index is useful for storing or keeping track of fields in an application. It is also the fastest lookup method to access the other attributes and allows you to loop through all the fields if required.

Macro Definition Documentation

#define DS_FIELDS_NOT_DEFINED

Value returned by field API functions when a field is not defined.

Function Documentation

int ds_fields_add ( int  num,
const char *  name,
int  flags,
int  dp,
const char *  fmt 
)

Add a new field to the field list.

Parameters
numField number to add
nameName of the field to add
flagsField flags
dpDecimal place precision
fmtFormat string of the field value
Return values
DS_FIELDS_NOT_DEFINED- if the field couldn't be added
Returns
The index of this field
int ds_fields_getdp ( int  index)

Return the decimal precision of this index.

Parameters
indexThe field index
Returns
The field's decimal precision
int ds_fields_getflags ( int  index)

Return the field flags of this index.

Parameters
indexThe field index
Returns
The field's flags
int ds_fields_indexbyname ( const char *  name)

Return the index of this field.

Parameters
nameThe fieldname
Returns
Field index
Return values
DS_FIELDS_NOT_DEFINED- if the field is not recognised
int ds_fields_indexbynum ( int  num)

Return the index of this field.

Parameters
numThe field number
Returns
Field index
Return values
DS_FIELDS_NOT_DEFINED- if the field is not recognised
int ds_fields_max ( )

Return the number of fields that have been defined.

Returns
The number of fields that have been defined
char* ds_fields_namebyindex ( int  index)

Return the field name of this index.

Parameters
indexThe field index
Returns
Field name
char* ds_fields_namebynum ( int  num)

Return the field name of this field number.

Parameters
numThe field number
Return values
Fieldname
NULLif not known
int ds_fields_numbyindex ( int  index)

Return the field number of this index.

Parameters
indexThe field index
Returns
Field number
Return values
DS_FIELDS_NOT_DEFINED- invalid index supplied
int ds_fields_numbyname ( const char *  name)

Return the field number of this field.

Parameters
nameThe fieldname
Returns
Field number
Return values
DS_FIELDS_NOT_DEFINED- if the field is not recognised

Generated on Wed Jan 24 2018 12:22:46 for DataSource for C SDK