![]() |
![]() |
|
|
viewfile(5)
Name
viewfile—Source file for view descriptions
Description
Viewfiles are source files for descriptions of one or more C data structures, or "views." When used as input to the viewc() command, the viewfile forms the basis for a binary file (filename view_filename.V) and a header file (view_filename.h) (see viewc, viewc32(1)).
The binary .V files are used two ways in the BEA Tuxedo system:
The .h file must be included in all programs using the view so that structure members can be referenced by their logical names.
VIEW Descriptions
Each view description in a source viewfile consists of three parts:
The first line of each view description must begin with the keyword "VIEW" followed by the name of the view description. A member description (or mapping entry) is a line with information about a member in the C structure. A line with the keyword "END" must be the last line in a view description. Lines beginning with a # are treated as comments and ignored.
Thus, a source view description has this general structure:
VIEW vname
# type cname fbname count flag size null
# ---- ----- ------ ----- ---- ---- ----
--------------member descriptions-------------------
.
.
.
END
In the view description, the variable fields have the following meaning:
Flag Options
The following is a list of the options that can be specified as the flag element of a member description in a view description. Note that the L and C options generate additional structure members even for views that are not FML-based.
Null Values
NULL values are used in views to indicate empty C structure members. Default NULL values are provided, and you may also define your own.
The default NULL value for all numeric types is 0 (0.0 for dec_t); for char types, it is "\"; and for string and carray types, it is "".
Escape convention constants can also be used to specify a NULL value. The view compiler recognizes the following escape constants: ddd (where d is an octal digit), 0, n, t, v, b, r, f, , ', and ".
String, carray, and char NULL values may be enclosed in double or single quotes. Unescaped quotes within a user-defined NULL value are not accepted by the view compiler.
Alternatively, an element is NULL if its value is the same as the NULL value for that element, except in the following cases:
You can also specify the keyword "NONE" in the NULL field of a view member description, which means there is no NULL value for the member.
The maximum size of defaults for string and character array members is 2660 characters.
Note that for string members, which usually end with a "0", a "0" is not required as the last character of a user-defined NULL value.
Environment Variables
For VIEW32, the environment variable VIEWFILES32 and VIEWDIR32 are used.
Examples
# BEGINNING OF AN FML-BASED VIEWFILE
VIEW custdb
$/* This is a comment */
#
#type cname fbname count flag size null
#
carray bug BUG_CURS 4 - 12 "no bugs"
long custid CUSTID 2 - - -1
short super SUPER_NUM 1 - - 999
long youid ID 1 - - -1
float tape TAPE_SENT 1 - - -.001
char ch CHR 1 - - "0"
string action ACTION 4 - 20 "no action"
END
# BEGINNING OF AN INDEPENDENT VIEWFILE
VIEW viewx
$ /* View structure for viewx information */
#
#type cname fbname count flag size null
#
int in - 1 - - -
short sh - 2 - - -
long lo - 3 - - -
char ch - 1 - - -
float fl - 1 - - -
double db - 1 - - -
string st - 1 - 15 -
carray ca - 1 - 15 -
END
See Also
viewc, viewc32(1), tpalloc(3c), Fvftos, Fvftos32(3fml), Fvstof, Fvstof32(3fml)
Programming BEA Tuxedo ATMI Applications Using FML
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|