This example module does the following:
- Search for an identical string in the tree.
- Inserts a string into a tree and returns a unique StringID. This
is done as follows:
- Check first to make sure the length of the string is within the
maximum symbol buffer size.
- Inserts the string into the root if the tree is empty or searches
down the tree to find the appropriate empty leaf node.
- When the insert node location is found, its address
will be passed to the INSERT_STRING subroutine. The subroutine will
create a new leaf node and then insert the string.
- Return the StringID if the string inserted successfully.
Note: This is the actual exit pointed to in the SYS_SVC_VECTOR
table.
Register 14 is used to store the return address,
which must be kept intact in order to exit this subroutine correctly.
This
example module assumes register one, which is passed in from the caller,
contains the address of the parameter list. The following input variables
are used in the example module:
- SYS_SVC_PARM
- Address of storage area that the caller of the z/OS XML parser wants to pass
to the exit. It also contains the XSI structure information.
- STR
- The string that will be inserted into the tree.
- STRLEN
- Length of the current string needed to be inserted. Length is
derived from the number of bytes of the characters in the string.
- CCSID
- Identifier for the string's character set.
The following output variables are used in the example
module:
- STRID
- The index of the inserted or found string.
- EXIT_DIAG_CODE
- Contains diagnostic information.
- XSI_DC_INCORRECT_PARM_STRLEN
- String length is out of bound.
- XSI_DC_OUT_OF_STORAGE_SPACE
- Allocated storage is full.
- XSI_DC_INCORRECT_EYE_CATCHER
- Eye catcher is incorrect.
- XSI_DC_MAX_OUT_ID_LIST_ENTRIES
- StringID list is full.
- RETCODE
-
- XRC_FAILURE
- Failed to insert or search for STR.
- XRC_SUCCESS
- String was inserted or found.