>>-#--pragma--descriptor----------------------------------------> >--(--void--function_name--(--| od_specifiers |--)--)---------->< od_specifiers: |--+-""---+--+-----------------+--------------------------------| +-void-+ | .-------------. | '-*----' | V | | '---,--+-""---+-+-' +-void-+ '-*----'
Description
An operational descriptor is an optional piece of information that is associated with a function argument. This information is used to describe an argument's attributes, for example, its data type and length. The #pragma descriptor directive is used to identify functions whose arguments have operational descriptors.
Operational descriptors are useful when passing arguments to functions that are written in other languages that may have a different definition of the data types of the arguments. For example, C defines a string as a contiguous sequence of characters ended by and including the first null character. In another language, a string may be defined as consisting of a length specifier and a character sequence. When passing a string from a C function to a function written in another language, an operational descriptor can be provided with the argument to allow the called function to determine the length and type of the string being passed.
The ILE C/C++ compiler generates operational descriptors for arguments that are passed to a function specified in a #pragma descriptor directive. The generated descriptor contains the descriptor type, data type, and length for each argument that is identified as requiring an operational descriptor. The information in an operational descriptor can be retrieved by the called function using the ILE APIs CEEGSI and CEEDOD. For more information about CL commands, see the CL and APIs section in the Programming category at the iSeries 400 Information Center Web site:
http://publib.boulder.ibm.com/pubs/html/as400/infocenter.htm
For the operational descriptor to determine the correct string length when passed through a function, the string has to be initialized.
The ILE C compiler supports operational descriptors for describing strings.
Parameters
Notes on Usage
Do not specify #pragma descriptor together with #pragma argopt for the same declaration. The compiler supports using only one or the other of these pragmas at a time.
The compiler issues a warning and ignores the #pragma descriptor directive if any of the following conditions occur:
When using operational descriptors consider the following:
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.