GDIndex.gif Previous-2.gif Next-3.gif

GDget_int_array - GD API


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);

 



GDIndex.gif Previous-2.gif Next-3.gif