OSI/FTAM Programming Guide

NonStop FTAM Programming
HP NonStop OSI/FTAM Programming Guide528612-001
3-36
Using Predefined Data Structures
union name, u_zcntntstype; on line 19, the name of the union structure containing
the desired field, zdoctype; on line 10, the name of the field in zdoctype,
zdoctypename.
Line 10 also shows that zdoctypename is defined as zaps_ddl_obj_id_def,
which is specified in the file ZAPSC. The zaps_ddl_obj_id structure corresponds
to the ASN.1-type object identifier and is broken down into the count of elements in the
object identifier array (maximum of 16) and the components of the object identifier.
The file ZAPSC shows this C data structure for zaps_ddl_obj_id_def, again with
comments removed:
1 #pragma section zaps_ddl_obj_id
2 typedef struct
3 {
4 zaps_ddl_int1_def znum_elements;
5 zaps_ddl_int1_def zobj_id[16];
6 } zaps_ddl_obj_id_def;
Therefore, to set up the document type name for an FTAM-3 file, use these lines of C
code:
contents_type.u_zcntntstype.zdoctype.zdoctypename.znum_elements = 5;
contents_type.u_zcntntstype.zdoctype.zdoctypename.zobj_id [0] = 1;
contents_type.u_zcntntstype.zdoctype.zdoctypename.zobj_id [1] = 0;
contents_type.u_zcntntstype.zdoctype.zdoctypename.zobj_id [2] = 8571;
contents_type.u_zcntntstype.zdoctype.zdoctypename.zobj_id [3] = 5;
contents_type.u_zcntntstype.zdoctype.zdoctypename.zobj_id [4] = 3;