TOC PREV NEXT INDEX

GDget_int_array

Synopsis

get or set a integer array

int _ GDget_int_array ( parent_id , _ elem_name , _int * size , _float ** array );
int _ GDget_newint_array ( parent_id , _ elem_name , seq, _int * size ,_ float ** array );
void _ GDset_int_array ( parent_id , _ elem_name , _int size , _float * array );

OMobj_id _ parent_id ;
char _* elem_name ;
int _* seq ;

Description

GDget_int_array gets an integer array, placing the array's elements into array . The return value is 1 if successful, 0 if a failure.

GDget_newint_array gets an integer array, placing the array's elements into array . The routine also returns the array's updated sequence number. The return value is 1 if the data has changed, 0 if it has not.

GDset_int_array sets an integer array.

Parameters

parent_id

The id of the target subobject's parent.

elem_name

The name of the target subobject.

size

In the GDget_xxxx routines, an output argument set to the number of values in the array.
In GDset_int_array, an input argument indicating the number of values in the array.

seq

(GDget_newint_array only) _An input/output argument. It is used to compare against the array's current sequence number to determine if the array has changed. It is then updated with the current sequence number.

array

In the GDget_xxxx routines, a pointer to the address where the routine places the array.
In GDset_int_array, the address of the source array.

Example

/* Get, then set, the value of a modes object's mode subobject*/
OMobj_id _modes_id; /* Assume this has been set. */
int size
int mode[5];
int status;
...
status = GDget_int_array(modes_id, "mode", &size, &mode);
if (status == 0) {
printf("Error getting the mode's mode subobject\n");
return(1);
};

/* Modify the array, then set the array object. */
mode[2] = 3;
GDset_int_array(modes_id, "mode", size, mode);


TOC PREV NEXT INDEX