viewfile — Enduro/X VIEW Buffer descriptor file
Formal specification:
# First view in the file VIEW VIEWNAME FLD_TYPE C_NAME UBF_NAME COUNT FLAGS SIZE NULL_VAL ... FLD_TYPE_N C_NAME_N UBF_NAME_N COUNT_N FLAGS_N SIZE_N NULL_VAL_N END ... # N view in the view file VIEW VIEWNAME_N ... END
Example view: (test.v):
VIEW MYVIEW1 #type cname fbname count flag size null short tshort1 T_SHORT_FLD 1 FS - 2000 short tshort2 T_SHORT_2_FLD 2 FSC - 2001 short tshort3 T_SHORT_3_FLD 3 FSC - - short tshort4 - 1 N - NONE long tlong1 T_LONG_FLD 1 FS - 0 int tint2 T_LONG_2_FLD 2 FS - 0 int tint3 - 1 - - -1 int tint4 - 2 - - -1 char tchar1 T_CHAR_FLD 1 F - '\n' char tchar2 T_CHAR_2_FLD 5 SC - 'A' char tchar3 T_CHAR_3_FLD 2 CN - - float tfloat1 T_FLOAT_FLD 4 FS - 1.1 float tfloat2 T_FLOAT_2_FLD 2 S - - float tfloat3 - 1 N - 9999.99 double tdouble1 T_DOUBLE_FLD 2 FS - 55555.99 double tdouble2 T_DOUBLE_2_FLD 1 F - -999.123 string tstring0 - 3 - 18 '\n\t\f\\\'\"\vHELLOWORLD' string tstring1 T_STRING_FLD 3 FSP 20 'HELLO WORLDB' string tstring2 T_STRING_2_FLD 3 FCL 20 - string tstring3 T_STRING_3_FLD 4 FSCL 20 'TESTEST' string tstring4 - 1 P 15 'HELLO TEST' string tstring5 - 1 - 15 'MEGA TEST' carray tcarray1 T_CARRAY_FLD 1 FS 30 '\0\n\t\f\\\'\"\vHELLOWORLD' carray tcarray2 T_CARRAY_2_FLD 1 LFSP 25 '\0\n\t\f\\\'\"\vHELLOWORL\n' carray tcarray3 T_CARRAY_3_FLD 10 FSCLP 30 '\0\\\nABC\t\f\'\vHELLO' carray tcarray4 - 1 - 5 'ABC' carray tcarray5 - 1 - 5 - END
Compiled header output (C language mode):
struct MYVIEW1 { short tshort1; /* null=2000 */ short C_tshort2; short tshort2[2]; /* null=2001 */ short C_tshort3; short tshort3[3]; short tshort4; /* null=NONE */ long tlong1; /* null=0 */ int tint2[2]; /* null=0 */ int tint3; /* null=-1 */ int tint4[2]; /* null=-1 */ char tchar1; /* null="\n" */ short C_tchar2; char tchar2[5]; /* null="A" */ short C_tchar3; char tchar3[2]; float tfloat1[4]; /* null=1.1 */ float tfloat2[2]; float tfloat3; /* null=9999.99 */ double tdouble1[2]; /* null=55555.99 */ double tdouble2; /* null=-999.123 */ char tstring0[3][18]; /* null="\n\t\f\\\'\"\vHELLOWORLD" */ char tstring1[3][20]; /* null="HELLO WORLDB" */ short C_tstring2; unsigned short L_tstring2[3]; char tstring2[3][20]; short C_tstring3; unsigned short L_tstring3[4]; char tstring3[4][20]; /* null="TESTEST" */ char tstring4[15]; /* null="HELLO TEST" */ char tstring5[15]; /* null="MEGA TEST" */ char tcarray1[30]; /* null="\0\n\t\f\\\'\"\vHELLOWORLD" */ unsigned short L_tcarray2; char tcarray2[25]; /* null="\0\n\t\f\\\'\"\vHELLOWORL\n" */ short C_tcarray3; unsigned short L_tcarray3[10]; char tcarray3[10][30]; /* null="\0\\\nABC\t\f\'\vHELLO" */ char tcarray4[5]; /* null="ABC" */ char tcarray5[5]; };
View files (usually with extension .v) describe the data block or structure which later is generated by viewc(8) binary. The view compiler generate C header file for view file. Also the compiler generate the object-file with extension .V. The object-file basically is the same view file except it contains platform specific meta data. For each platfrom (OS/CPU changes), view file shall be re- compiled. How ever during the middleware operations, the message view message produced on one platform is transferable on the other platform. This basically is the core view feature, so that programmer may operate with C structures, but the middleware ensures that structure is successfully delivered to the target system in cross platform way.
View files may describe single element or array of the element (e.g. tshort1). The arrays are supported for STRING and CARRAY fields too. In those cases those are two dimensional arrays.
For STRING and CARRAY types, length can be specified. The length is given in total number of bytes. So if you want to store "ABC", you will need to specify count 4, one extra byte for EOS (zero terminator).
The next section describes each of the view file elements.
FLD_TYPE C_NAME FB_NAME COUNT FLAGS SIZE NULL_VAL