ILE C/C++ Programmer's Guide

Using the GENCSRC Utility for Level Checking

Use the GENCSRC utility to retrieve externally described file information for use in a C/C++ program. The utility:

Use the SLTFLD keyword to turn on level checking.

Note:
For a list of options for the SLTFLD keyword, see Appendix A, The GENCSRC Utility and the #pragma mapinc Directive.

If you specify the keyword SLTFLD with value *LVLCHK on the GENCSRC command, in addition to generating the type _LVLCHK_T (array of structures), a variable of type _LVLCHK_T is also generated. The name of this variable of type _LVLCHK_T is based on some or all of the following:

In the case when SLTFLD(*LVLCHK) is specified with the default TYPEDEFPFX(*OBJ), the name of the level check structure is based on the file name as specified in the OBJ keyword and the include name (see Table 36). The GENCSRC command generates the level check structure named mylib_myfile_mymbr_lvlchk, as shown in the following examples:

Figure 112. Example of SLTFLD(*LVLCHK) with the Default TYPEDEFPFX(*OBJ)




GENCSRC OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE') SRCFILE(INCLIB/H) 
SRCMBR(MYMBR) SLTFLD(*LVLCHK) TYPEDEFPFX(*OBJ)

or


GENCSRC OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE')
SRCSTMF('incdir/mymbr.h) SLTFLD(*LVLCHK) TYPEDEFPFX(*OBJ)

/* ------------------------------------------------------- */ 
// PHYSICAL FILE : MYLIB/MYFILE 
// FILE LAST CHANGE DATE : 2001/09/13
// RECORD FORMAT : FORMAT1
// FORMAT LEVEL IDENTIFIER : 38A624C5F3B51
/* ------------------------------------------------------- */

_LVLCHK_T mylib_myfile_mymbr_lvlchk = {
 .

};
.   
Note:
The level check name depends on your source location (library, file,
member).

In the case when SLTFLD(*LVLCHK) is specified with TYPEDEFPFX(*NONE), the name of the level check structure is based on the member name, and the commands in Figure 113 generate a level check structure named mymbr_lvlchk.

Figure 113. Example of SLTFLD(*LVLCHK) with the Default TYPEDEFPFX(*NONE)



GENCSRC OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE') SRCFILE(INCLIB/H) 
SRCMBR(MYMBR) SLTFLD(*LVLCHK) TYPEDEFPFX(*NONE)

or


GENCSRC OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE') 
SRCSTMF('incdir/mymbr.h) SLTFLD(*LVLCHK) TYPEDEFPFX(*NONE)



/* ------------------------------------------------------- */
// PHYSICAL FILE : MYLIB/MYFILE
// FILE LAST CHANGE DATE : 2001/09/13 
// RECORD FORMAT : FORMAT1
// FORMAT LEVEL IDENTIFIER : 38A624C5F3B51
/* ------------------------------------------------------- */

_LVLCHK_T mymbr_lvlchk = {
 .
 .
};
Note:
The level check name depends on your source location (library, file,
member).

In the case when SLTFLD(*LVLCHK) is specified with TYPEDEFPFX(prefix_name), the name of the level check structure is the prefix_name followed by the file name based on the OBJ keyword and the SRCFILE/SRCMBR or SRCSTMF keywords (the include file). The commands in Figure 114 give the level check structure named MYPREFIX_mylib_myfile_mymbr_lvlchk.

Figure 114. Example of SLTFLD(*LVLCHK) with the Default TYPEDEFPFX value *MYPREFIX



GENCSRC OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE') SRCFILE(INCLIB/H)
SRCMBR(MYMBR) SLTFLD(*LVLCHK) TYPEDEFPFX(MYPREFIX)

or


GENCSRC OBJ('/QSYS.LIB/MYLIB.LIB/MYFILE.FILE') 
SRCSTMF('incdir/mymbr.h) SLTFLD(*LVLCHK) TYPEDEFPFX(MYPREFIX)



/* ------------------------------------------------------- */
// PHYSICAL FILE : MYLIB/MYFILE
// FILE LAST CHANGE DATE : 2001/09/13 
// RECORD FORMAT : FORMAT1
// FORMAT LEVEL IDENTIFIER : 38A624C5F3B5
/* ------------------------------------------------------- */

_LVLCHK_T MYPREFIX_mylib_myfile_mymbr_lvlchk = {
 .
 .
};
Note:
The level check name depends on your source location (library, file,
member).


[ Top of Page | Previous Page | Next Page | Table of Contents ]