TOC PREV NEXT INDEX

Core AVS/Express and the Object Manager


D Object Manager
FORTRAN Application Programming Interface


This appendix describes the subset of the AVS/Express Object Manager API provided for FORTRAN programmers.

Note: The FORTRAN API is derived from the C API which is comprehensively documented in Appendix 1, Object Manager Application Programming Interface.

D.1 Overview

Wherever possible and feasible, the FORTRAN API functions are one-to-one translations of their C counterparts. In most cases, the function names are equivalent and are generated by extending the prefix OM to OMF.

Each FORTRAN API function description consists of the specification of the function itself and its arguments, a reference to the corresponding C API documentation and a brief description of the arguments and the return value. Differences in functionality or arguments, as well as specific FORTRAN behavior, are given in full detail.

D.1.1 Object id

AVS/Express assigns each object a unique id which is of type OMobj_id in a C API function (see Section 1.3, Object id  [page 1-16]). The FORTRAN API represents the OMobj_id in terms of an integer array of sufficient size. In order to be safe, the include file omf.inc defines the size via the parameters OM_OBJ_ID_SIZE or OIDSIZ which are recommended to be used. In order to provide the values of some standard objects, omf.inc defines the following set of OMobject_ids:

INTEGER OMnull_obj(OIDSIZ),
INTEGER OMroot_obj(OIDSIZ),
INTEGER OMinst_obj(OIDSIZ),
INTEGER OMtempl_obj(OIDSIZ)
COMMON /OMF/ OMnull_obj, OMroot_obj, OMinst_obj, OMtempl_obj

The values of these variables are not initialized by default but you can set them by making the call

istat = OMFstd_objs_set (OMnull_obj,
OMroot_obj,
OMinst_obj,
OMtempl_obj)
D.1.2 Object name

AVS/Express objects have a name which is stored in terms of a unique integer value (see Section 1.4, Object names  [page 1-18]). Accordingly, the OMobj_name type is represented as an INTEGER type in the FORTRAN API.

D.1.3 Predefined values and function types

The FORTRAN include file omf.inc contains predefined values specified via PARAMETER statements and the function type declarations. Most functions are of type INTEGER but don't follow implicit type declaration conventions. It is therefore important to include omf.inc whenever API functions are being used.

The examples in the descriptions of the API functions use the preprocessor statement

#include <avs/omf.inc>

to include the file. SGI f77 calls the preprocessor automatically, on Sun and HP the filename extension ".F" is required to correctly resolve the statement. Alternatively, a $INCLUDE statement or a FORTRAN statement INCLUDE may be available and used.

D.1.4 Return status

Most API functions return a status code (see Section 1.7, Return status  [page 1-22]) which is defined in omf.inc by the following constants:

Return value
Status code
1
OM_STAT_SUCCESS
0
OM_STAT_UNDEF
-1
OM_STAT_ERROR

In some cases, an indicator value is returned which has a particular meaning which differs from the status code.

D.1.5 Array objects

The full array access mechanism provided in the C API is supported for FORTRAN arrays of type INTEGER, REAL, and DOUBLE PRECISION. The memory organization of an array is thereby conserved. For multi-dimensional arrays specified in AVS/Express as float xyz[n1][n2];, the corresponding FORTRAN representation is REAL xyz(n2,n1).

Some C API routines expect or return pointers to memory locations. For efficiency reasons, a corresponding mechanism is required by the FORTRAN API. Since FORTRAN77 doesn't have a standard (and therefore portable) pointer type, the address of a memory location is represented in terms of an INTEGER type. In cases where the address of an allocated memory area is returned, a function for the translation into an offset relative to a specified memory location is provided. Another utility function returns the address of a storage area for the purpose of passing a FORTRAN array location to the Object Manager.

Note: Array indexing in AVS/Express is zero-based, that is, the first element of an array object has the index 0. This is important when addressing particular array elements or ranges via an API function.

D.1.6 API function overview

The following table summarizes the FORTRAN APIs by function.

Function
Call
Getting and setting object ids
Getting and setting a scalar object's value
Integer objects:
Floating-point objects:
String objects:
Getting and setting array object's values
Memory allocation:
set_array access:
get_array access:
subarray access:
string array access:

D.2 ARRFalloc
Synopsis
       INTEGER FUNCTION ARRFalloc (N1,
      .  type,
      .  number_of_elements,
      .  N2)
       INTEGER N1, N2
       INTEGER type, number_of_elements
Description

For a complete description of this function, see Section 1.8, ARRalloc  [page 1-23].

Arguments
type

An integer code specifying the data type for which to allocate memory. All type codes are predefined in the include file omf.inc. The meaningful codes in the FORTRAN context are:

Code
Allocate memory for...
DTYPE_INT
Integer
DTYPE_FLOAT
Single-precision floating point
DTYPE_DOUBLE
Double-precision floating point

number_of_elements

The number of elements to be stored in the allocated memory, expressed as an integer.

N1
N2

Both N1 and N2 should be set to 0.

Returned value

The address of the allocated memory area or 0 if the call fails.

Example
#include <avs/omf.inc>
       INTEGER iaddr
       ...
       iaddr = ARRFalloc(0,DTYPE_FLOAT,2000,0)
       IF (iaddr .EQ. 0) PRINT*,'Error allocating memory area'
See also

Related modules:

Section D.4, ARRFincr_refcnt  [page D-10]
Section D.3, ARRFfree  [page D-9]
Section D.5, ARRFoffset  [page D-11]
Section D.6, ARRFretptr  [page D-13]

D.3 ARRFfree
Synopsis
       SUBROUTINE ARRFfree(array_ptr)
       INTEGER array_ptr
Description

For a complete description of this function, see Section 1.9, ARRfree  [page 1-25].

Arguments
array_ptr

The address of a memory location, expressed as an integer.

Example
#include <avs/omf.inc>
       INTEGER iaddr
       ...
       iaddr = ARRFalloc(0,DTYPE_FLOAT,2000,0)
       IF (iaddr .EQ. 0) PRINT*,'Error allocating memory area'
       call ARRFfree(iaddr)
See also

Related modules:

Section D.4, ARRFincr_refcnt  [page D-10]
Section D.2, ARRFalloc  [page D-7]
Section D.5, ARRFoffset  [page D-11]
Section D.6, ARRFretptr  [page D-13]
D.4 ARRFincr_refcnt
Synopsis
       SUBROUTINE ARRFincr_refcnt(array_ptr)
       INTEGER array_ptr
Description

For a complete description of this function, see Section 1.10, ARRincr_refcnt  [page 1-26].

Arguments
array_ptr

The address of a memory area allocated with ARRFalloc, expressed as an integer.

Example
#include <avs/omf.inc>
       INTEGER iaddr
       ...
       iaddr = ARRFalloc(0,DTYPE_FLOAT,2000,0)
       IF (iaddr .EQ. 0) PRINT*,'Error allocating memory area'
       call ARRFincr_refcnt(iaddr)
See also

Related modules:

Section D.2, ARRFalloc  [page D-7]
Section D.3, ARRFfree  [page D-9]
Section D.5, ARRFoffset  [page D-11]
Section D.6, ARRFretptr  [page D-13]
D.5 ARRFoffset
Synopsis
       INTEGER FUNCTION ARRFoffset (array_ptr,
      .  basevec,
      .  type)
       INTEGER array_ptr
       DIMENSION basevec(1)
Description

This routine enables FORTRAN programmers to access memory locations specified by a pointer in a portable manner.

Arguments
array_ptr

The address of a memory area allocated with ARRFalloc or returned by ARRFretptr or by one of the get_array access routines described below (expressed as an integer).

basevec

A local array, used as a reference location. This array can be dimensioned with one element.

type

A code for the data type of the local array basevec, expressed as an integer. It is used to compute the correct addressing offset according to the size of the elements of the local array. The meaningful codes predefined in the include file omf.inc are:

Code
basevec(1) data type
DTYPE_INT
INTEGER
DTYPE_FLOAT
REAL
DTYPE_DOUBLE
DOUBLE PRECISION

Returned value

The addressing offset of an allocated memory area with respect to the first element of basevec.

Example
C Allocate a memory area and fill some values in
#include <avs/omf.inc>
       INTEGER iaddr, offset, size
       REAL base(1)
       ...
       size = 2000
       iaddr = ARRFalloc(0,DTYPE_FLOAT,size,0)
       IF (iaddr .EQ. 0) PRINT*,'Error allocating memory area'        offset = ARRFoffset(iaddr,base,DTYPE_FLOAT)
C
       DO 100 i=1,size base(offset+i) = FLOAT(i)
 100   CONTINUE
See also

Related modules:

Section D.4, ARRFincr_refcnt  [page D-10]
Section D.3, ARRFfree  [page D-9]
Section D.2, ARRFalloc  [page D-7]
Section D.6, ARRFretptr  [page D-13]
D.6 ARRFretptr
Synopsis
       INTEGER FUNCTION ARRFretptr(farray)
       DIMENSION farray(1)
Description

This function returns the address of a local memory location. It is required to pass locally defined arrays to AVS/Express.

Arguments
farray

A local FORTRAN array.

Returned value

The address of the first element of farray.

Example
#include <avs/omf.inc>
       INTEGER iaddr
       INTEGER iarray(200)
       ...
       iaddr = ARRFretptr(iarray)
See also

Related modules:

Section D.4, ARRFincr_refcnt  [page D-10]
Section D.3, ARRFfree  [page D-9]
Section D.5, ARRFoffset  [page D-11]
Section D.2, ARRFalloc  [page D-7]

D.7 OMFdel_array_val
Synopsis
       INTEGER FUNCTION OMFdel_array_val (object_id,
      .  value_id)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ), value_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.43, OMget_array_val, OMset_array_val, OMdel_array_val  [page 1-89].

Arguments
object_id

The id of an object, expressed as an integer.

value_id

The id of the object to be deleted from the array, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example

A V file contains the following definitions:

group a;
group b;
group c;
group d;
group &grps[] => {a,b,c};

The following code illustrates how to delete a value in grps:

#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       INTEGER a_id(OIDSIZ), b_id(OIDSIZ), c_id(OIDSIZ), d_id(OIDSIZ)
       INTEGER grps_id(OIDSIZ), tmp_id(OIDSIZ)
       ...
       IF (OMFfind_subobj(parent_object,
      . OMFstr_to_name('grps'),
      . OM_OBJ_RW,
      . grps_id) .NE. 1)
      . PRINT*,'Error searching for grps'
C
       IF (OMFget_array_val(grps_id,1,tmp_id,OM_OBJ_RD) .NE. 1)
      . PRINT*,'Error getting array value with index 1'
       IF (OMFdel_array_val(grps_id,tmp_id) .NE. 1)
      . PRINT*,'Error deleting array value with index 1'
See also

Related modules:

Section D.17, OMFset_array_val  [page D-32]
Section D.16, OMFget_array_val  [page D-30]
D.8 OMFequal_objs
Synopsis
       INTEGER FUNCTION OMFequal_objs (object1_id,
      .  object2_id)
#include <avs/omf.inc>
       INTEGER object1_id(OIDSIZ)
       INTEGER object2_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.33, OMequal_objs  [page 1-65].

Arguments
object1_id
object2_id

The ids of the objects to be compared, expressed as integers.

Returned value

1 if the object ids are the same; 0 if the object ids are not the same. OM_STAT_ERROR on failure.

D.9 OMFfind_subobj
Synopsis
       INTEGER FUNCTION OMFfind_subobj (parent_id,
      .  name,
      .  mode,
      .  returned_id)
#include <avs/omf.inc>
       INTEGER parent_id(OIDSIZ)
       INTEGER name, mode
       INTEGER returned_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.36, OMfind_subobj, OMlookup_subobj and OMfind_obj  [page 1-69].

Arguments
parent_id

The id of an object, as an integer value.

name

The unqualified name of an object as an integer value.

mode

Indication of how the process intends to use the object. The following constants are predefined in the include file omf.inc:

Mode
Meaning
OM_OBJ_RD
The process intends to read the object, but not write to it (or any object that it might get using this id).
OM_OBJ_RW
The process intends to read and possibly write to the object.

returned_id

The id of the found object or OMnull_obj on failure.

Returned value

1 on success; 0 if OMnull_obj is returned.

Example
C Find subobject x. Its parent's id is grp1_id.
#include <avs/omf.inc>
       INTEGER grp1_id (OIDSIZ), x_id(OIDSIZ)
       ...
       IF (OMFfind_subobj(grp1_id,
      .  OMFstr_to_name('x'),
      .  OM_OBJ_RD,
      .  x_id) .NE. 1) PRINT*,'Err searching for x'
See also

Related modules:

Section D.49, OMFlookup_subobj  [page D-77]
Section D.10, OMFfind_obj  [page D-19]

D.10 OMFfind_obj
Synopsis
       INTEGER FUNCTION OMFfind_obj (parent_id,
      .  name,
      .  mode,
      .  returned_id)
#include <avs/omf.inc>
       INTEGER parent_id(OIDSIZ)
       INTEGER name, mode
       INTEGER returned_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.36, OMfind_subobj, OMlookup_subobj and OMfind_obj  [page 1-69].

Arguments
parent_id

The id of an object, as an integer value.

name

The unqualified name of an object as an Integer value.

mode

Indication of how the process intends to use the object. The following constants are predefined in the include file omf.inc:

Mode
Meaning
OM_OBJ_RD
The process intends to read the object, but not write to it (or any object that it might get using this id).
OM_OBJ_RW
The process intends to read and possibly write to the object.

The flags to qualify the object search are:

Flag
Meaning
OM_FIND_NO_LIBRARIES
Do not search recursively for subobjects in global libraries.
OM_FIND_NO_VIRTUAL
Do not search for virtual objects.
OM_SUB_TEMPL
If parent_id is a group pointer or reference, by default AVS/Express returns the id of parent_id's subobject.
OM_SUB_TEMPL specifies that AVS/Express should instead return the id of the subobject in parent_id's template object.

returned_id

The id of the found object or OMnull_obj on failure.

Returned value

1 on success; 0 if OMnull_obj is returned.

See also

Related modules:

Section D.49, OMFlookup_subobj  [page D-77]
Section D.9, OMFfind_subobj  [page D-17]

D.11 OMFget_array
Synopsis
       INTEGER FUNCTION OMFget_array (object_id,
      . type,
      . array_ptr,
      . ndims,
      . dims,
      . mode)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER type, ndims, mode
       INTEGER dims(ndims)
       INTEGER array_ptr
Description

For a complete description of this function, see Section 1.38, OMget_array  [page 1-74].

Arguments
object_id

The id of an object, expressed as an integer.

type

An integer code specifying the array's data type. Valid types predefined in the include file omf.inc are:

Code
Array data type
OM_TYPE_INT
Integer
OM_TYPE_FLOAT
Single-precision floating point
OM_TYPE_DOUBLE
Double-precision floating point
OM_TYPE_UNSET
Not set (for example, data type is prim)

array_ptr

The memory location of the returned array, expressed as an integer. A local memory location can be passed by using the ARRFretptr function. A NULL pointer is passed by setting the address to 0; AVS/Express returns a memory location of its choosing.

ndims

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim integer values specifying the dimensions of the array. The constant OM_ARRAY_MAXDIM defined in the include file omf.inc specifies the maximum number of dimensions allowed by AVS/Express.

mode

The mode in which to retrieve the the value for the array. The following constants are predefined in the include file omf.inc:

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example 1
C set the array value of object array
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER type, iaddr, offset, ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       REAL base(1)
       ...
C  the AVS/Express specification will be: float array[300][3];
C  this maps to REAL array(3,300) in FORTRAN
       type = OM_TYPE_FLOAT
       iaddr = 0 ndims = 2 dims(1) = 3 dims(2) = 300
C
       IF (OMFget_array(array_id,
      . type,
      . iaddr,
      . ndims,
      . dims,
      . OM_GET_ARRAY_WR) .NE. 1) THEN
       PRINT*,'Error getting array value of object array'
       ...
       ENDIF
C
C  continue only when successfully retrieved the array
       offset = ARRFoffset(iaddr,base,DTYPE_FLOAT)
C
C  set the values of the array
       ...
       CALL ARRFfree(iaddr)
Example 2
C return the array value of object array into a static location
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER type, iaddr, size, ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       REAL larray(1000)
       ...
C check for sufficient size
       IF OMFget_array_size(array_id,size) .NE. 1)
      . PRINT*,'Error getting array size'
       IF (size .LT. 1000) PRINT*,'Not enough space in local array'
C
       iaddr = ARRFretptr(larray)
       type = OM_TYPE_FLOAT
       ndims = 0
       IF (OMFget_array(array_id,
      . type,
      . iaddr,
      . ndims,
      . dims,
      . OM_GET_ARRAY_RD) .NE. 1)
      . PRINT*,'Error getting array value of object array'
C
See also

Related module:

Section D.12, OMFset_array  [page D-24]

D.12 OMFset_array
Synopsis
       INTEGER FUNCTION OMFset_array (object_id,
      .  type,
      .  farray,
      .  size,
      .  mode)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER type, size, mode
       DIMENSION farray(1)
Description

For a complete description of this function, see Section 1.99, OMset_array  [page 1-187].

Arguments
object_id

The id of an object, expressed as an integer.

type

An integer code specifying the array's data type. Valid types predefined in the include file omf.inc are:

Code
Array data type
OM_TYPE_INT
Integer
OM_TYPE_FLOAT
Single-precision floating point
OM_TYPE_DOUBLE
Double-precision floating point

farray

A local FORTRAN array.

size

The total number of values in the array, expressed as an integer.

mode

How AVS/Express should set the array. The following constants are predefined in the include file omf.inc:

If set to OM_SET_ARRAY_STATIC, farray has to be a static array (notice that some FORTRAN compilers do not perform static memory allocation by default). If set to OM_SET_ARRAY_COPY, farray needs not to be a static array since AVS/Express creates a copy.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example 1

A standard application of OMFset_array:

#include <avs/omf.inc>
       INTEGER sarray_id(OIDSIZ) larray_id(OIDSIZ)
       DOUBLE PRECISION sarray(500)
       INTEGER larray(3,100)
       ...
C sarray has to be a static array to make the following work
C correctly. The call will not fail if this condition is not
C satisfied.
C
       IF (OMFset_array(sarray_id,
      . OM_TYPE_DOUBLE,
      . sarray,
      . 500,
      . OM_SET_ARRAY_STATIC) .NE. 1)
      . PRINT*,'Error setting array value of object sarray'
C
       IF (OMFset_array(larray_id,
      . OM_TYPE_INT,
      . larray,
      . 300,
      . OM_SET_ARRAY_COPY) .NE. 1)
      . PRINT*,'Error setting array value of object larray'
Example 2

The construction required to pass a memory area allocated by ARRFalloc:

#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER iaddr, offset, size
DOUBLE PRECISION base(1)
       ...
       size = 300
       iaddr = ARRFalloc(0,DTYPE_DOUBLE,size,0)
       offset = ARRFoffset(iaddr,base,DTYPE_DOUBLE)
       ...
C
       IF (OMFset_array(array_id,
      . OM_TYPE_DOUBLE,
      . base(1+offset),
      . 300,
      . OM_SET_ARRAY_FREE) .NE. 1)
      . PRINT*,'Error setting array value of object array'
See also

Related module:

Section D.11, OMFget_array  [page D-21]

D.13 OMFget_array_dims
Synopsis
       INTEGER FUNCTION OMFget_array_dims (object_id,
      . ndims,
      . dims)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(ndims)
Description

For a complete description of this function, see Section 1.39, OMget_array_dims  [page 1-81].

Arguments
object_id

The id of an object, expressed as an integer.

ndims

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim integer values specifying the dimensions of the array. The constant OM_ARRAY_MAXDIM defined in the include file omf.inc secifies the maximum number of dimensions allowed by AVS/Express. In order to pass the NULL reference instead of a locally defined array, pass the constant FPNULL defined in the include file omf.inc.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       ...
       IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array'
D.14 OMFget_array_size
Synopsis
       INTEGER FUNCTION OMFget_array_size (object_id,
      . size)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER size
Description

For a complete description of this function, see Section 1.41, OMget_array_size and OMset_array_size  [page 1-85].

Arguments
object_id

The id of an object, expressed as an integer.

size

The total number of values in the array, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER size
       ...
       IF OMFget_array_size(array_id,size) .NE. 1)
      . PRINT*,'Error getting array size'
See also

Related module:

Section D.15, OMFset_array_size  [page D-29]

D.15 OMFset_array_size
Synopsis
       INTEGER FUNCTION OMFset_array_size (object_id,
      . size)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER size
Description

For a complete description of this function, see Section 1.41, OMget_array_size and OMset_array_size  [page 1-85].

Arguments
object_id

The id of an object, expressed as an integer.

size

The number of values in the one-dimensional array, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER size
       ...
       size = 250
       IF OMFset_array_size(array_id,size) .NE. 1)
      . PRINT*,'Error getting array size'
See also

Related module:

Section D.14, OMFget_array_size  [page D-28]

D.16 OMFget_array_val
Synopsis
       INTEGER FUNCTION OMFget_array_val (object_id,
      .  index,
      .  value_id,
      .  mode)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER index, mode
       INTEGER value_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.43, OMget_array_val, OMset_array_val, OMdel_array_val  [page 1-89].

Arguments
object_id

The id of an object, expressed as an integer.

index The array index.
value_id

The id of the specified object, expressed as an integer.

mode

Indication of how the process intends to use the object. The following constants are predefined in the include file omf.inc:

Mode
Meaning
OM_OBJ_RD
The process intends to read the object, but not write to it (or any object that it might get using this id).
OM_OBJ_RW
The process intends to read and possibly write to the object.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example

A V file contains the following definitions:

group a;
group b;
group c;
group d;
group &grps[] => {a,b,c};

The following code illustrates how to access the values in grps:

#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       INTEGER a_id(OIDSIZ), b_id(OIDSIZ), c_id(OIDSIZ), d_id(OIDSIZ)
       INTEGER grps_id(OIDSIZ), tmp_id(OIDSIZ)
       ...
       IF (OMFfind_subobj(parent_object,
      . OMFstr_to_name('grps'),
      . OM_OBJ_RD,
      . grps_id) .NE. 1)
      . PRINT*,'Error searching for grps'
C
       IF (OMFget_array_val(grps_id,0,tmp_id,OM_OBJ_RD) .NE. 1)
      . PRINT*,'Error getting array value with index 0'
See also

Related modules:

Section D.17, OMFset_array_val  [page D-32]
Section D.7, OMFdel_array_val  [page D-14]
D.17 OMFset_array_val
Synopsis
       INTEGER FUNCTION OMFset_array_val (object_id,
      .  index,
      .  value_id)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ), value_id(OIDSIZ)
       INTEGER index
Description

For a complete description of this function, see Section 1.43, OMget_array_val, OMset_array_val, OMdel_array_val  [page 1-89].

Arguments
object_id

The id of an object, expressed as an integer.

index

Array index that specifies the predefined parameter OM_ARRAY_APPEND appends the object value to the end of object_id.

value_id

The id of the object to be placed in the array, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example

A V file contains the following definitions:

group a;
group b;
group c;
group d;
group &grps[] => {a,b,c};

The following code illustrates how to set a value in grps:

#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       INTEGER a_id(OIDSIZ), b_id(OIDSIZ), c_id(OIDSIZ), d_id(OIDSIZ)
       INTEGER grps_id(OIDSIZ), tmp_id(OIDSIZ)
       ...
       IF (OMFfind_subobj(parent_object,
      . OMFstr_to_name('grps'),
      . OM_OBJ_RW,
      . grps_id) .NE. 1)
      .   PRINT*,'Error searching for grps'
C
       IF (OMFfind_subobj(parent_object,
      . OMFstr_to_name('d'),
      . OM_OBJ_RD,
      . d_id) .NE. 1)
      .   PRINT*,'Error searching for d'
C
       IF (OMFset_array_val(grps_id,1,d_id,OM_OBJ_RD) .NE. 1)
      .    PRINT*,'Error setting array value with index 1'
See also

Related modules:

Section D.16, OMFget_array_val  [page D-30]
Section D.7, OMFdel_array_val  [page D-14]
D.18 OMFget_data_type
Synopsis
       INTEGER FUNCTION OMFget_data_type (object_id,
      .  data_type)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER data_type
Description

For a complete description of this function, see Section 1.45, OMget_data_type and OMset_data_type  [page 1-95].

Arguments
object_id

The id of an object, expressed as an integer.

data_type

The new data type of the object, expressed as an integer. The FORTRAN API supports the following codes which are predefined in the include file omf.inc:

Type
Meaning
OM_TYPE_INT
Integer
OM_TYPE_FLOAT
Single-precision floating point
OM_TYPE_DOUBLE
Double-precision floating point
OM_TYPE_STRING
Character string
OM_TYPE_UNSET
Not set, that is, its type is prim

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER data_id(OIDSIZ)
       INTEGER type
       ...
       IF (OMFget_data_type(data_id, type) .NE. 1)
      . PRINT*,'cannot get data type'
See also

Related module:

Section D.19, OMFset_data_type  [page D-36]
D.19 OMFset_data_type
Synopsis
       INTEGER FUNCTION OMFset_data_type (object_id,
      .  data_type)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER data_type
Description

For a complete description of this function, see Section 1.45, OMget_data_type and OMset_data_type  [page 1-95].

Arguments
object_id

The id of an object, expressed as an integer.

data_type

The new data type of the object, expressed as an integer. The FORTRAN API supports the following codes which are predefined in the include file omf.inc:

Type
Meaning
OM_TYPE_INT
Integer
OM_TYPE_FLOAT
Single-precision floating point
OM_TYPE_DOUBLE
Double-precision floating point
OM_TYPE_STRING
Character string
OM_TYPE_UNSET
Not set, that is, its type is prim

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER data_id(OIDSIZ)
       ...
       IF (OMFset_data_type(data_id, OM_TYPE_FLOAT) .NE. 1)
      . PRINT*,'cannot set data type'
See also

Related module:

Section D.18, OMFget_data_type  [page D-34]
D.20 OMFget_int_val
Synopsis
       INTEGER FUNCTION OMFget_int_val (object_id,
      .  ival)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ival
Description

For a complete description of this function, see Section 1.48, OMget_int_val and OMset_int_val  [page 1-100].

Arguments
object_id

The id of an object, expressed as an integer.

ival

The object's value, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), ival_id(OIDSIZ)
       INTEGER value
       ...
       IF (OMFfind_subobj(parent_object,
      .  OMstr_to_name('ival'),
      .  OM_OBJ_RD,
      .  ival_id) .NE. 1)
      . PRINT*,'Error searching for ival'
C
       IF (OMFget_int_val(ival_id,value) .NE. 1)
      . PRINT*,'Error getting value of object ival'
See also

Related module:

Section D.21, OMFset_int_val  [page D-39]
D.21 OMFset_int_val
Synopsis
       INTEGER FUNCTION OMFset_int_val (object_id,
      .  ival)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ival
Description

For a complete description of this function, see Section 1.48, OMget_int_val and OMset_int_val  [page 1-100].

Arguments
object_id

The id of an object, expressed as an integer.

ival

The object's value, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), ival_id(OIDSIZ)
       INTEGER value
       ...
       value = 15 IF (OMFfind_subobj(parent_object,
      .    OMstr_to_name('ival'),
      .    OM_OBJ_RD, . ival_id) .NE. 1)
      .  PRINT*,'Error searching for ival'
C
       IF (OMFset_int_val(ival_id,value) .NE. 1)
      .  PRINT*,'Error setting value of object ival'
See also

Related module:

Section D.20, OMFget_int_val  [page D-38]
D.22 OMFget_name_int_val
Synopsis
       INTEGER FUNCTION OMFget_name_int_val (object_id,
      .  name,
      .  ival)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       INTEGER ival
Description

For a complete description of this function, see Section 1.48, OMget_int_val and OMset_int_val  [page 1-100].

Arguments
object_id

The id of an object, expressed as an integer.

name

The name of one of object_id's immediate subobjects, expressed as an integer.

ival

The subobject's value, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       INTEGER value
       ...
       IF (OMFget_name_int_val(parent_object,
      .    OMFstr_to_name('ival'),
      .    value) .NE. 1)
      . PRINT*,'Error getting value of object ival'
See also

Related module:

Section D.23, OMFset_name_int_val  [page D-41]

D.23 OMFset_name_int_val
Synopsis
       INTEGER FUNCTION OMFset_name_int_val (object_id,
      .  name,
      .  ival)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       INTEGER ival
Description

For a complete description of this function, see Section 1.48, OMget_int_val and OMset_int_val  [page 1-100].

Arguments
object_id

The id of an object, expressed as an integer.

name

The name of one of object_id's immediate subobjects, expressed as an integer.

ival

The subobject's value, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       INTEGER value
       ...
        value = 15
        IF (OMFset_name_int_val(parent_object,
      .     OMFstr_to_name('ival'),
      .     value) .NE. 1)
      . PRINT*,'Error setting value of object ival'
See also

Related module:

Section D.22, OMFget_name_int_val  [page D-40]

D.24 OMFget_name_real8_val
Synopsis
       INTEGER FUNCTION OMFget_name_real_val (object_id,
      .  name,
      .  dval)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       DOUBLE PRECISION dval
Description

For a complete description of this function, see Section 1.61, OMget_real_val and OMset_real_val  [page 1-124].

Arguments
object_id

The id of an object, expressed as an integer.

name

The name of one of object_id's immediate subobjects, expressed as an integer.

dval

The object's value, expressed in double precision.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
       #include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       DOUBLE PRECISION value
       ...
       IF (OMFget_name_real8_val(parent_object,
      .  OMFstr_to_name('fval'),
      .  value) .NE. 1)
      . PRINT*,'Error getting value of object fval'
See also

Related module:

Section D.25, OMFset_name_real8_val  [page D-43]

D.25 OMFset_name_real8_val
Synopsis
       INTEGER FUNCTION OMFset_name_real_val (object_id,
      .  name,
      .  dval)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       DOUBLE PRECISION dval
Description

For a complete description of this function, see Section 1.61, OMget_real_val and OMset_real_val  [page 1-124].

Arguments
object_id

The id of an object, expressed as an integer.

name

The name of one of object_id's immediate subobjects.

dval

The subobject's value, expressed in double precision.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       DOUBLE PRECISION value
       ...
       value = 0.75
       IF (OMFset_name_real8_val(parent_object,
      .  OMFstr_to_name('fval'),
      .  value) .NE. 1)
      . PRINT*,'Error setting value of object
See also

Related module:

Section D.24, OMFget_name_real8_val  [page D-42]

D.26 OMFget_name_str_val
Synopsis
       INTEGER FUNCTION OMFget_name_str_val (object_id,
      .  name,
      .  cval,
      .  maxlen)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name, maxlen
       CHARACTER*(*) cval
Description

For a complete description of this function, see Section 1.64, OMget_str_val and OMset_str_val  [page 1-132].

Arguments
object_id

The id of an object, expressed as an integer.

name

The name of one of object_id's immediate subobjects, expressed as an integer.

maxlen

The maximum number of characters to get, expressed as an integer.

cval

A character string specifying the subobject's value. This call requires that you pass a locally defined character variable and doesn't allow for memory allocation.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       CHARACTER*30 value
...
       IF (OMFget_name_str_val(parent_object,
      .    OMFstr_to_name('cval'),
      .    value
      .    LEN(value)) .NE. 1)
      . PRINT*,'Error getting value of object cval'
See also

Related module:

Section D.27, OMFset_name_str_val  [page D-46]
D.27 OMFset_name_str_val
Synopsis
       INTEGER FUNCTION OMFget_name_str_val (object_id,
      .  name,
      .  cval,
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       CHARACTER*(*) cval
Description

For a complete description of this function, see Section 1.64, OMget_str_val and OMset_str_val  [page 1-132].

Arguments
object_id

The id of an object, expressed as an integer.

name

The name of one of object_id's immediate subobjects, expressed as an integer.

cval

A character string specifying the subobject's value.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ)
       CHARACTER*30 value
       ...
       value = 'My String'
       IF (OMFset_name_str_val(parent_object,
      .    OMFstr_to_name('cval'),
      .    value) .NE. 1)
      . PRINT*,'Error setting value of object cval'
See also

Related module:

Section D.26, OMFget_name_str_val  [page D-44]
D.28 OMFname_to_str
Synopsis
       INTEGER FUNCTION OMFname_to_str (object_name,
      .  object_string)
       INTEGER object_name
       CHARACTER*(*) object_string
Description

For a complete description of this function, see Section 1.75, OMname_to_str and OMstr_to_name  [page 1-150].

Arguments
object_name

An object's name, as an integer value.

object_string

An object's name, as a character string.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER name, status
       CHARACTER*30 name_str
       ...
       name = OMFstr_to_name('My string')
       status = OMFname_to_str(name,name_str)
See also

Related module:

Section D.29, OMFstr_to_name  [page D-48]

D.29 OMFstr_to_name
Synopsis
       INTEGER FUNCTION OMFstr_to_name(object_string)
       CHARACTER*(*) object_string
Description

For a complete description of this function, see Section 1.75, OMname_to_str and OMstr_to_name  [page 1-150]

Arguments
object_string

An object's name, as a character string.

Returned value

An object's name, as an integer value.

Example
#include <avs/omf.inc>
       INTEGER name
       ...
       name = OMFstr_to_name('My string')
See also

Related module:

Section D.28, OMFname_to_str  [page D-47]
D.30 OMFget_obj_name
Synopsis
       INTEGER FUNCTION OMFget_obj_name (object_id,
      .  object_name)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER object_name
Description

For a complete description of this function, see Section 1.52, OMget_obj_name and OMset_obj_name  [page 1-106].

Arguments
object_id

The id of an object, expressed as an integer.

object_name

An new object's name, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       ...
       IF (OMFget_obj_name(object_id,
      .   OMFstr_to_name("new_name")) .NE. 1)
      . PRINT*,'cannot set object name'
See also

Related module:

Section D.31, OMFset_obj_name  [page D-50]
D.31 OMFset_obj_name
Synopsis
       INTEGER FUNCTION OMFset_obj_name (object_id,
      .  object_name)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER object_name
Description

For a complete description of this function, see Section 1.52, OMget_obj_name and OMset_obj_name  [page 1-106].

Arguments
object_id

The id of an object, expressed as an integer.

object_name

An new object's name, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER name
       ...
       IF (OMFset_obj_name(object_id,
      .   OMFstr_to_name("new_name")) .NE. 1)
      . PRINT*,'cannot set object name'
See also

Related module:

Section D.30, OMFget_obj_name  [page D-49]
D.32 OMFget_obj_parent
Synopsis
       INTEGER FUNCTION OMFget_obj_parent (object_id,
      .  parent_id)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER parent_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.53, OMget_obj_parent  [page 1-107].

Arguments
object_id

The id of an object, expressed as an integer.

parent_id

The parent's id, as an integer value.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
C Get object var1_id's parent
#include <avs/omf.inc>
       INTEGER var1_id (OIDSIZ), parent(OIDSIZ)
       ...
       IF (OMFget_obj_parent(var1_id,
      .    parent) .NE. 1) PRINT*,'Object has no parent'
D.33 OMFget_obj_val
Synopsis
       INTEGER FUNCTION OMFget_obj_val (object_id,
      .  value_id)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER value_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.57, OMget_obj_val, OMget_obj_pval, and OMset_obj_val  [page 1-116].

Arguments
object_id

The id of an object with mode by-reference or by-pointer, expressed as an integer.

value_id

The id of the object at the end of the chain of references, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

See also

Related module:

Section D.34, OMFset_obj_val  [page D-53]

D.34 OMFset_obj_val
Synopsis
       INTEGER FUNCTION OMFset_obj_val (object_id,
      .  value_id,
      .  mode)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER value_id(OIDSIZ)
       INTEGER mode
Description

For a complete description of this function, see Section 1.57, OMget_obj_val, OMget_obj_pval, and OMset_obj_val  [page 1-116].

Arguments
object_id

The id of an object with mode by-reference or by-pointer, expressed as an integer.

value_id

The pointer object's value to be set, expressed as an integer.

mode

Reserved for future use. Set to 0 in all cases.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

See also

Related module:

Section D.33, OMFget_obj_val  [page D-52]
D.35 OMFget_real8_val
Synopsis
       INTEGER FUNCTION OMFget_real8_val (object_id,
      .  dval)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       DOUBLE PRECISION dval
Description

For a complete description of this function, see Section 1.61, OMget_real_val and OMset_real_val  [page 1-124].

Arguments
object_id

The id of an object, expressed as an integer.

dval

The object's value, expressed in double precision.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), fval_id(OIDSIZ)
       DOUBLE PRECISION value
       ...
       IF (OMFfind_subobj(parent_object,
      .  OMstr_to_name('fval'),
      .  OM_OBJ_RD,
      .  fval_id) .NE. 1)
      . PRINT*,'Error searching for fval'
C
       IF (OMFget_int_val(fval_id,value) .NE. 1)
      . PRINT*,'Error getting value of object fval'
See also

Related module:

Section D.36, OMFset_real8_val  [page D-55]

D.36 OMFset_real8_val
Synopsis
       INTEGER FUNCTION OMFget_real8_val (object_id,
      .  dval)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       DOUBLE PRECISION dval
Description

For a complete description of this function, see Section 1.61, OMget_real_val and OMset_real_val  [page 1-124].

Arguments
object_id

The id of an object, expressed as an integer.

dval

The object's value, expressed in double precision.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), fval_id(OIDSIZ)
       DOUBLE PRECISION value
       ...
       IF (OMFfind_subobj(parent_object,
      .  OMstr_to_name('fval'),
      . OM_OBJ_RD,
      .  fval_id) .NE. 1)
      . PRINT*,'Error searching for value'
C
       value = 0.75
       IF (OMFset_int_val(fval_id,value) .NE. 1)
      . PRINT*,'Error setting value of object fval'
See also

Related module:

Section D.35, OMFget_real8_val  [page D-54]

D.37 OMFget_str_array_val
Synopsis
       INTEGER FUNCTION OMFget_str_array_val (object_id,
      . index,
      . cval,
      . maxlen)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER index, maxlen
       CHARACTER*(*) cval
Description

For a complete description of this function, see Section 1.63, OMget_str_array_val and OMset_str_array_val  [page 1-129].

Arguments
object_id

The id of an object, expressed as an integer.

index

The array index, expressed as an integer.

cval

A character string specifying the object's value. This call requires that you pass a locally defined character variable and doesn't allow for memory allocation.

maxlen

The maximum number of characters to get, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER strarr_id(OIDSIZ)
       CHARACTER*30 value
       ...
       IF (OMFget_str_array_val(strarr_id,
      . 0,
      . value,
      . LEN(value)) .NE. 1)
      . PRINT*,'Error getting string value of object strarr'
See also

Related module:

Section D.38, OMFset_str_array_val  [page D-58]

D.38 OMFset_str_array_val
Synopsis
       INTEGER FUNCTION OMFset_str_array_val (object_id,
      . index,
      . string)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER index
       CHARACTER*(*) string
Description

For a complete description of this function, see Section 1.63, OMget_str_array_val and OMset_str_array_val  [page 1-129].

Arguments
object_id

The id of an object, expressed as an integer.

index

The array index, expressed as an integer.

string

A character string specifying the object's value.

value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER strarr_id(OIDSIZ)
       CHARACTER*30 value
       ...
       value = 'My String'
       IF (OMFset_str_array_val(strarr_id,
      . 0,
      . value) .NE. 1)
      . PRINT*,'Error setting string value of object strarr'
See also

Related module:

Section D.37, OMFget_str_array_val  [page D-56]
D.39 OMFget_str_val
Synopsis
       INTEGER FUNCTION OMFget_str_val (object_id,
      .  cval,
      .  maxlen)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER maxlen
       CHARACTER*(*) cval
Description

For a complete description of this function, see Section 1.64, OMget_str_val and OMset_str_val  [page 1-132].

Arguments
object_id

The id of an object, expressed as an integer.

cval

A character string specifying the object's value. This call requires that you pass a locally defined character variable and doesn't allow for memory allocation.

maxlen

The maximum number of characters to get, expressed as an integer.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), cval_id(OIDSIZ)
       CHARACTER*30 value
       ...
       IF (OMFfind_subobj(parent_object,
      .  OMstr_to_name('cval'),
      .  OM_OBJ_RD,
      .  cval_id) .NE. 1)
      . PRINT*,'Error searching for cval'
C
       IF (OMFget_str_val(cval_id,value,LEN(value)) .NE. 1)
      . PRINT*,'Error getting value of object cval'
See also

Related modules:

Section D.40, OMFset_str_val  [page D-61]
Section D.41, OMFget_str_val_mode  [page D-62]
D.40 OMFset_str_val
Synopsis
       INTEGER FUNCTION OMFget_str_val (object_id,
      .  cval)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       CHARACTER*(*) cval
Description

For a complete description of this function, see Section 1.64, OMget_str_val and OMset_str_val  [page 1-132].

Arguments
object_id

The id of an object, expressed as an integer.

cval

A character string specifying the object's value. This call requires that you pass a locally defined character variable and doesn't allow for memory allocation.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), cval_id(OIDSIZ)
       CHARACTER*30 value
       ...
       IF (OMFfind_subobj(parent_object,
      .  OMstr_to_name('cval'),
      .  OM_OBJ_RD,
      .  cval_id) .NE. 1)
      . PRINT*,'Error searching for cval'
C
       value = 'My String'
       IF (OMFset_str_val(cval_id,value) .NE. 1)
      . PRINT*,'Error setting value of object cval'
See also

Related modules:

Section D.39, OMFget_str_val  [page D-59]
Section D.41, OMFget_str_val_mode  [page D-62]
D.41 OMFget_str_val_mode
Synopsis
       INTEGER FUNCTION OMFget_str_val_mode (object_id,
      .  cval,
      .  maxlen,
      .  mode)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER maxlen, mode
       CHARACTER*(*) cval
Description

For a complete description of this function, see Section 1.64, OMget_str_val and OMset_str_val  [page 1-132].

Arguments
object_id

The id of an object, expressed as an integer.

cval

A character string specifying the object's value. This call requires that you pass a locally defined character variable and doesn't allow for memory allocation.

maxlen

The maximum number of characters to get, expressed as an integer.

mode

Translation mode, expressed as an integer - 0 for translation to take place; OM_STR_NO_I18N for no translation.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER parent_object(OIDSIZ), cval_id(OIDSIZ)
       CHARACTER*30 value
       ...
       IF (OMFfind_subobj(parent_object,
      .  OMstr_to_name('cval'),
      .  OM_OBJ_RD,
      .  cval_id) .NE. 1)
      . PRINT*,'Error searching for cval'
C
       IF (OMFget_str_val_mode(cval_id,
      .    value,
      .    LEN(value),
      .    OM_STR_NO_I18N) .NE. 1)
      . PRINT*,'Error getting value of object cval'
See also

Related modules:

Section D.40, OMFset_str_val  [page D-61]
Section D.39, OMFget_str_val  [page D-59]

D.42 OMFget_sub_farray
Synopsis
       INTEGER FUNCTION OMFget_sub_farray (object_id,
      . ndim,
      . dims,
      . min,
      . max,
      . farray)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndim
       INTEGER dims(ndims), min(ndims), max(ndims)
       REAL farray(1)
Description

For a complete description of this function, see Section 1.65, OMget_sub_barray and OMset_sub_barray  [page 1-135].

Arguments
object_id

The id of an object, expressed as an integer.

ndim

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim integer values specifying the dimensions of the array.

min
max

Arrays of ndim integer values specifying the the minimum and maximum indices to retrieve in each dimension of the array.

farray

The returned real subarray.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       INTEGER min(OM_ARRAY_MAXDIM), max(OM_ARRAY_MAXDIM)
       REAL sub(2,3,5)
       ...
C
C  get the dimensions of object array
       IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array'
C
C  set the subarray indices
       min(1) = 0
       max(1) = 2
       min(2) = 1
       max(2) = 4
       min(3) = 5
       max(3) = 10
       ...
C get the subarray
       IF (OMFget_sub_farray(array_id,
      . ndims,
      . dims,
      . min,
      . max,
      . sub) .NE. 1)
       . PRINT*,'Error getting subarray of object array'
See also

Related module:

Section D.43, OMFset_sub_farray  [page D-66]

D.43 OMFset_sub_farray
Synopsis
       INTEGER FUNCTION OMFset_sub_farray (object_id,
      . ndim,
      . dims,
      . min,
      . max,
      . farray)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndim
       INTEGER dims(ndims), min(ndims), max(ndims)
       REAL farray(1)
Description

For a complete description of this function, see Section 1.65, OMget_sub_barray and OMset_sub_barray  [page 1-135].

Arguments
object_id

The id of an object, expressed as an integer.

ndim

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim integer values specifying the dimensions of the array.

min
max

Arrays of ndim integer values specifying the the minimum and maximum indices to set in each dimension of the array.

farray

The real subarray.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc> INTEGER array_id(OIDSIZ) INTEGER ndims INTEGER dims(OM_ARRAY_MAXDIM) INTEGER min(OM_ARRAY_MAXDIM), max(OM_ARRAY_MAXDIM) REAL sub(2,3,5) ... C C get the dimensions of object array IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array' C C set the subarray indices min(1) = 0 max(1) = 2 min(2) = 1 max(2) = 4 min(3) = 5 max(3) = 10 ... C get the subarray IF (OMFset_sub_farray(array_id,
      . ndims,
      . dims,
      . min,
      . max,
      . sub) .NE. 1) . PRINT*,'Error setting subarray of object array'
See also

Related module:

Section D.42, OMFget_sub_farray  [page D-64]

D.44 OMFget_sub_iarray
Synopsis
       INTEGER FUNCTION OMFget_sub_iarray (object_id,
      . ndim,
      . dims,
      . min,
      . max,
      . iarray)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndim
       INTEGER dims(ndims), min(ndims), max(ndims)
       INTEGER iarray(1)
Description

For a complete description of this function, see Section 1.65, OMget_sub_barray and OMset_sub_barray  [page 1-135].

Arguments
object_id

The id of an object, expressed as an integer.

ndim

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim integer values specifying the dimensions of the array.

min
max

Arrays of ndim integer values specifying the the minimum and maximum indices to retrieve in each dimension of the array.

iarray

The returned integer subarray.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       INTEGER min(OM_ARRAY_MAXDIM), max(OM_ARRAY_MAXDIM)
       INTEGER sub(2,3,5)
       ...
C
C  get the dimensions of object array
       IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array'
C
C  set the subarray indices
       min(1) = 0
       max(1) = 2
       min(2) = 1
       max(2) = 4
       min(3) = 5
       max(3) = 10
       ...
C  get the subarray
       IF (OMFget_sub_iarray(array_id,
      . ndims,
      . dims,
      . min,
      . max,
      . sub) .NE. 1)
      . PRINT*,'Error getting subarray of object array'
See also

Related module:

Section D.45, OMFset_sub_iarray  [page D-70]

D.45 OMFset_sub_iarray
Synopsis
       INTEGER FUNCTION OMFset_sub_iarray (object_id,
      . ndim,
      . dims,
      . min,
      . max,
      . iarray)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndim
       INTEGER dims(ndims), min(ndims), max(ndims)
       INTEGER iarray(1)
Description

For a complete description of this function, see Section 1.65, OMget_sub_barray and OMset_sub_barray  [page 1-135].

Arguments
object_id

The id of an object.

ndim

The number of dimensions in the array.

dims

An array of ndim values specifying the dimensions of the array.

min
max

Arrays of ndim values specifying the the minimum and maximum indices to set in each dimension of the array.

iarray

The integer subarray.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       INTEGER min(OM_ARRAY_MAXDIM), max(OM_ARRAY_MAXDIM)
       INTEGER sub(2,3,5)
       ...
C
C  get the dimensions of object array
       IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array'
C
C  set the subarray indices
       min(1) = 0
       max(1) = 2
       min(2) = 1
       max(2) = 4
       min(3) = 5
       max(3) = 10
       ...
C get the subarray
       IF (OMFset_sub_iarray(array_id,
      . ndims,
      . dims,
      . min,
      . max, . sub) .NE. 1)
      . PRINT*,'Error setting subarray of object array'
See also

Related module:

Section D.44, OMFget_sub_iarray  [page D-68]

D.46 OMFget_sub_rarray
Synopsis
       INTEGER FUNCTION OMFget_sub_rarray (object_id,
      . ndim,
      . dims,
      . min,
      . max,
      . rarray)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndim
       INTEGER dims(ndims), min(ndims), max(ndims)
       DOUBLE PRECISION rarray(1)
Description

For a complete description of this function, see Section 1.65, OMget_sub_barray and OMset_sub_barray  [page 1-135].

Arguments
object_id

The id of an object, expressed as an integer.

ndim

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim values specifying the dimensions of the array.

min
max

Arrays of ndim integer values specifying the the minimum and maximum indices to retrieve in each dimension of the array.

rarray

The returned double-precision subarray.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       INTEGER min(OM_ARRAY_MAXDIM), max(OM_ARRAY_MAXDIM)
       DOUBLE PRECISION sub(2,3,5)
       ...
C
C  get the dimensions of object array
       IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array'
C
C  set the subarray indices
       min(1) = 0
       max(1) = 2
       min(2) = 1
       max(2) = 4
       min(3) = 5
       max(3) = 10
       ...
C get the subarray
       IF (OMFget_sub_rarray(array_id,
      . ndims,
      . dims,
      . min,
      . max,
      . sub) .NE. 1)
      . PRINT*,'Error getting subarray of object array'
See also

Related module:

Section D.47, OMFset_sub_rarray  [page D-74]

D.47 OMFset_sub_rarray
Synopsis
       INTEGER FUNCTION OMFset_sub_rarray (object_id,
      . ndim,
      . dims,
      . min,
      . max,
      . rarray)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER ndim
       INTEGER dims(ndims), min(ndims), max(ndims)
       DOUBLE PRECISION rarray(1)
Description

For a complete description of this function, see Section 1.65, OMget_sub_barray and OMset_sub_barray  [page 1-135].

Arguments
object_id

The id of an object, expressed as an integer.

ndim

The number of dimensions in the array, expressed as an integer.

dims

An array of ndim integer values specifying the dimensions of the array.

min
max

Arrays of ndim integer values specifying the the minimum and maximum indices to set in each dimension of the array.

rarray

The double precision subarray.

Returned value

The status code (see Section 1.7, Return status  [page 1-22]).

Example
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER ndims
       INTEGER dims(OM_ARRAY_MAXDIM)
       INTEGER min(OM_ARRAY_MAXDIM), max(OM_ARRAY_MAXDIM)
       DOUBLE PRECISION sub(2,3,5)
       ...
C
C  get the dimensions of object array
       IF (OMFget_array_dims(array_id,
      . ndims,
      . dims) .NE. 1)
      . PRINT*,'Error getting array dimensions of object array'
C
C  set the subarray indices
       min(1) = 0
       max(1) = 2
       min(2) = 1
       max(2) = 4
       min(3) = 5
       max(3) = 10
       ...
C get the subarray
       IF (OMFset_sub_rarray(array_id,
      . ndims,
      . dims,
      . min,
      . max,
      . sub) .NE. 1)
      . PRINT*,'Error setting subarray of object array'
See also

Related module:

Section D.46, OMFget_sub_rarray  [page D-72]

D.48 OMFis_null_obj
Synopsis
       INTEGER FUNCTION OMFis_null_obj(object_id)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.69, OMis_null_obj  [page 1-142].

Arguments
object_id

The id of an object, expressed as an integer.

Returned value

1 if the object id is NULL; 0 if the object id is not NULL. OM_STAT_ERROR on failure.

D.49 OMFlookup_subobj
Synopsis
       INTEGER FUNCTION OMFlookup_subobj (parent_id,
      .  name,
      .  mode,
      .  returned_id)
#include <avs/omf.inc>
       INTEGER parent_id(OIDSIZ)
       INTEGER name, mode
       INTEGER returned_id(OIDSIZ)
Description

For a complete description of this function, see Section 1.36, OMfind_subobj, OMlookup_subobj and OMfind_obj  [page 1-69].

Arguments
parent_id

The id of an object, as an integer value.

name

The unqualified name of an object as an integer value.

mode

Indication of how the process intends to use the object. The following constants are predefined in the include file omf.inc:

Mode
Meaning
OM_OBJ_RD
The process intends to read the object, but not write to it (or any object that it might get using this id).
OM_OBJ_RW
The process intends to read and possibly write to the object.

returned_id

The id of the found object or OMnull_obj on failure.

Returned value

1 on success; 0 if OMnull_obj is returned.

See also

Related modules:

Section D.9, OMFfind_subobj  [page D-17]
Section D.10, OMFfind_obj  [page D-19]

D.50 OMFret_array_ptr
Synopsis
       INTEGER FUNCTION OMFret_array_ptr (object_id,
      . mode,
      . size,
      . type)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER mode
       INTEGER size, type
Description

For a complete description of this function, see Section 1.89, OMret_array_ptr  [page 1-171].

Arguments
object_id

The id of an object, expressed as an integer.

mode

An integer specifying the mode in which to retrieve the the value for the array. The following constants are predefined in the include file omf.inc:

size

The total number of values in the array, expressed as an integer. In order to pass the NULL reference, set the value to FPNULL (defined in the include file omf.inc).

type

Integer code for the array's data type. In order to pass the NULL reference, set the value to FPNULL (defined in the include file omf.inc).

Returned value

The memory location of the returned array. On failure, 0 is returned.

Example
C return the array value of object array for RW access
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER type, iaddr, offset, size
       REAL base(1)
       ...
       iaddr = OMFret_array_ptr(array_id,
      . OM_GET_ARRAY_RW,
      . size,
      . type)
       IF (iaddr .EQ. 0) THEN
        PRINT*,'Error getting array value of object array'
        ...
       ENDIF
C
C  continue only for iaddr .ne. 0
       offset = ARRFoffset(iaddr,base,DTYPE_FLOAT)
C
C  set the values of the array
       ...
       CALL ARRFfree(iaddr)
D.51 OMFret_name_array_ptr
Synopsis
       INTEGER FUNCTION OMFret_name_array_ptr (parent_id,
      . name,
      . mode,
      . size,
      . type)
#include <avs/omf.inc>
       INTEGER parent_id(OIDSIZ)
       INTEGER name, mode
       INTEGER size, type
Description

For a complete description of this function, see Section 1.89, OMret_array_ptr  [page 1-171].

Arguments
parent_id

The id of an object, expressed as an integer.

name

The name of one of parent_id's immediate subobjects, expressed as an integer.

mode

An integer specifying the mode in which to retrieve the the value for the array. The following constants are predefined in the include file omf.inc:

size

The total number of values in the array, expressed as an integer. In order to pass the NULL reference, set the value to FPNULL (defined in the include file omf.inc).

type

Integer code for the array's data type. In order to pass the NULL reference, set the value to FPNULL (defined in the include file omf.inc).

Returned value

The memory location of the returned array. On failure, 0 is returned.

Example
C return the array value of object array for RD access
#include <avs/omf.inc>
       INTEGER parent_id(OIDSIZ)
       INTEGER type, iaddr, offset, size
       REAL base(1)
       ...
       iaddr = OMFret_name_array_ptr(parent_id,
      . OMFstr_to_name('array'),
      . OM_GET_ARRAY_RD,
      . size,
      . type)
       IF (iaddr .EQ. 0) THEN
PRINT*,'Error getting array value of object array'
        ...
       ENDIF
C
C continue only for iaddr .ne. 0
       offset = ARRFoffset(iaddr,base,DTYPE_FLOAT)
C
C use the values of the array
       ...
       CALL ARRFfree(iaddr)
D.52 OMFret_typed_array_ptr
lSynopsis
INTEGER FUNCTION OMFret_typed_array_ptr (object_id,
      . mode,
      . type,
      . size)
#include <avs/omf.inc>
       INTEGER object_id(OIDSIZ)
       INTEGER mode, type
       INTEGER size
Description

For a complete description of this function, see Section 1.89, OMret_array_ptr  [page 1-171].

Arguments
object_id

The id of an object, expressed as an integer.

mode

Integer code specifying the mode in which to retrieve the the value for the array. The following constants are predefined in the include file omf.inc:

type

Integer code for the array's data type. Valid types predefined in the include file omf.inc are:

Code
Array data type
OM_TYPE_INT
Integer
OM_TYPE_FLOAT
Single-precision floating point
OM_TYPE_DOUBLE
Double-precision floating point
OM_TYPE_UNSET
Not set (for example, data type is prim)

size

The total number of values in the array. In order to pass the NULL reference, set the value to FPNULL (defined in the include file omf.inc).

Returned value

The memory location of the returned array. On failure, 0 is returned.

Example
C return the array value of object array for RW access
#include <avs/omf.inc>
       INTEGER array_id(OIDSIZ)
       INTEGER iaddr, offset, size
       DOUBLE PRECISION base(1)
       ...
       iaddr = OMFret_typed_array_ptr(array_id,
      . OM_GET_ARRAY_RW,
      . OM_TYPE_DOUBLE,
      . size)
       IF (iaddr .EQ. 0) THEN
        PRINT*,'Error getting array value of object array'
        ...
       ENDIF
C
C  continue only for iaddr .ne. 0
       offset = ARRFoffset(iaddr,base,DTYPE_FLOAT)
C
C  set the values of the array
       ...
       CALL ARRFfree(iaddr)


TOC PREV NEXT INDEX

Copyright © 2001 Advanced Visual Systems Inc.
All rights reserved.