FLDadd_long_array, FLDset_array_long, FLDget_array_long

Synopsis

create/get/set an integer subobject to an object

int FLDadd_long_array (
     OMobj_id field,
     const char *name,
     xp_long size);

int FLDset_array_long (
     OMobj_id field,
     const char *name,
     xp_long size,
     long *array,
     int mode);

int FLDget_array_long (
     OMobj_id field,
     const char *name,
     int **array,
     xp_long *size,
     int mode);

Description

These routines add a new integer array subobject to an existing field data schema object, and then set/get its values. They could also be used when you want to construct and reference an entirely new data object and add int array subobjects to it, but you want to do this within the code of a function, rather than using V.

Note: If you are accessing an existing, defined subobject, use the specific routine for that subobject (for example, FLDget_coord_extent). Use FLDadd/set/ get_array_int only when you have created your own, unique, named subobject, or when no FLD routine exists for a pre-defined subobject.

FLDadd_int_array adds an integer array subobject to the object specified by OMobj_id field. The object is named in the Object Manager by the string name. size indicates the total number of array values. For example, a [100][2] array would have size 200. The new subobject is flagged as "not set."

FLDset_array_int sets the integer array object named name within field equal to the first size values found in a integer array pointed to by array.

FLDget_array_int returns the value of the integer subobject name within field in via the double pointer array.

Parameters

OMobj_id field

The OMobj_id of an object. This can be any object, not just a "Field".

const char *name

In FLDadd_int, an input argument specifying a character string that names the new integer subobject.
In FLDset_int and FLDget_int, an input character string argument that specifies which subobject of field to get/set.

xp_long size

xp_long *size

In FLDadd_int_array, size is the total number of array values to create. A [100][3] array would have size=300.
In FLDset_array_int, size is how many sequential values to take from array and assign to the subobject.
In FLDget_array_int, size is a pointer to an integer in which the size of the subobject array will be returned.

int mode

An integer constant that establishes the access mode for the array subobject. Constants for the possible values are defined in avs/om.h as follows.
For FLDset_array_int:

Mode

Value

Meaning

OM_GET_ARRAY_RD

0

The program intends to read the array, but not write to it.

OM_GET_ARRAY_WR

1

The program intends to write to the array, completely replacing it, but not read it.

OM_GET_ARRAY_RW

2

The program intends to both read and write to the array.

OM_GET_ARRAY_RD_
COPY

3

The program requires a copy of the array for its own, private use (reading or writing).


int *array

int **array

In FLDset_array_int, array is an array of integers of size size. Those values will be assigned to the name subobject.
In FLDget_array_int, array should be the address of a pointer to integers; upon return, *array will be filled in with a pointer to the values. You must call ARRfree on the returned pointer (*array) when you are done with that array.

Examples

modules/int_data.c

modules/nmap.c

modules/iso.c

modules/isotrace.c

modules/slice.c

Files

v/fld.v.

See Also

FLDadd_real
FLDadd_int_array
FLDdelete