Common Run-Time Environment (CRE) Programmer’s Guide Abstract This manual describes the Common Run-Time Environment (CRE), a set of run-time services that enable system and application programmers to write mixed-language programs. In the TNS environment, the TNS CRE run-time services support C, COBOL, FORTRAN, and TAL language programs. In the native environment, the native CRE run-time services support C, C++, COBOL, and pTAL language programs.
Document History Part Number Product Version Published 528146-003 CRE G09, CRE H01 July 2005 528146-004 CRE G09, CRE H01 February 2006
Common Run-Time Environment (CRE) Programmer’s Guide Glossary Index Examples What’s New in This Guide xiii Guide Information xiii New and Changed Information About This Guide xv Audience xvi Organization xvi Additional Information Hypertext Links xix Figures Tables xiii xvii 1. Introducing the CRE Mixed-Language Programming Without the CRE What Is the CRE? 1-2 Selecting a Run-Time Environment 1-5 Advantages of Using the CRE 1-8 1-1 2.
2. CRE Services (continued) Contents 2.
2. CRE Services (continued) Contents 2.
5. Using the Common Language Utility (CLU) Library Contents 5. Using the Common Language Utility (CLU) Library What Is the CLU Library? 5-1 Compiling and Binding or Linking Programs That Use the CLU Library Creating Processes 5-2 Locating and Identifying File Connectors 5-2 Using the Saved Message Utility Functions 5-2 Services Provided by the Saved Message Utility 5-4 Content of Messages 5-6 Using SMU Routines to Manipulate Messages 5-7 Using the environ Array 5-9 5-2 6.
. Math Functions (continued) Contents 7.
. String and Memory Block Functions Contents 8.
8. String and Memory Block Functions (continued) Contents 8. String and Memory Block Functions (continued) Memory Block Functions (continued) Memory_Swap 8-40 9.
. Run-Time Diagnostic Messages (continued) Contents 10. Run-Time Diagnostic Messages (continued) Heap-Management Messages 10-12 Function Parameter Message 10-14 Math Function Messages 10-15 Function Parameter Messages 10-17 Input/Output Messages 10-18 COBOL Messages 10-25 FORTRAN Messages 10-25 Native CRE Messages 10-25 Mapping Message Numbers Between Run-Time Environments 10-26 A. Data Type Correspondence Glossary Index Examples Example 2-1. Example 2-2. Example 2-3.
Figures (continued) Contents Figures (continued) Figure 2-10. Figure 2-11. Figure 2-12. Figure 2-13. Figure 2-14. Figure 2-15. Figure 2-16. Figure 5-1. Figure 6-1. Figure 6-2. Figure 6-3. Figure 6-4. Figure 8-1. Figure 8-2.
Tables (continued) Contents Tables (continued) Table 2-10. Table 3-1. Table 3-2. Table 3-3. Table 3-4. Table 3-5. Table 3-6. Table 3-7. Table 3-8. Table 4-1. Table 5-1. Table 5-2. Table 5-3. Table 5-4. Table 5-5. Table 5-6. Table 5-7. Table 6-1. Table 6-2. Table 6-3. Table 6-4. Table 6-5. Table 6-6. Table 6-7. Table 6-8. Table 7-1. Table 7-2. Table 7-3. Table 7-4. Table 7-5. Table 8-1. Table 8-2. Table 8-3. Table 8-4. Table 9-1. Table 10-1. Table 10-2.
Tables (continued) Contents Tables (continued) Table 10-3. Table A-1. Table A-2. Table A-3. Table A-4. Table A-5. Table A-6.
Contents Tables (continued) Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 xii
What’s New in This Guide Guide Information Common Run-Time Environment (CRE) Programmer’s Guide Abstract This manual describes the Common Run-Time Environment (CRE), a set of run-time services that enable system and application programmers to write mixed-language programs. In the TNS environment, the TNS CRE run-time services support C, COBOL, FORTRAN, and TAL language programs. In the native environment, the native CRE run-time services support C, C++, COBOL, and pTAL language programs.
What’s New in This Guide New and Changed Information If you are running H06.03 or H06.04 RVUs, continue to use the HP Enterprise Toolkit-NonStop Edition or HP NonStop S-series servers with these development tools. This manual contains the following changes from its G-series predecessor: • • Certain information has been restructured for clarity.
About This Guide The Common Run-Time Environment (CRE) is a set of services used by the HP compiler language run-time libraries. The CRE makes it easier to write mixed-language programs. The Common Run-Time Environment (CRE) Programmer’s Guide describes: • • • • Run-time environments and how they affect programs. Services provided by the CRE, such as program initialization and termination, file sharing, trap handling, and heap allocation. How to compile and bind programs that use the CRE.
Audience About This Guide The SCREEN COBOL product is also excluded from COBOL discussions in this guide unless specifically mentioned. To reduce confusion between the current product name and compiler-specific or platform-specific behaviors, this guide now uses “COBOL” to refer to the language when a more specific distinction is not needed or is obvious from context. “COBOL85” is used only to refer to the HP product or to the TNS compiler in the Guardian environment.
Additional Information About This Guide Section 10, Run-Time Diagnostic Messages, lists the cause, effect, and recovery for each of the error messages emitted by programs running in the CRE. Appendix A, Data Type Correspondence, shows the relationships between data types among different programming languages. Additional Information Table i. Language Manuals Manual Description C/C++ Programmer’s Guide Describes the syntax and semantics of HP C and C++ for NonStop servers.
Additional Information About This Guide Table ii. System Programming Manuals Manual Description Guardian Application Conversion Guide Explains how to convert C-series file system procedure calls to use the extended features of the D-series file system procedure calls. Guardian Programmer's Guide Explains how to use the Guardian programmatic interface of the NonStop operating system in the Guardian environment.
Hypertext Links About This Guide Table iii. Program Development Manuals (page 2 of 2) Manual Description Native Inspect Manual Describes how to use Native Inspect, the built-in conversational symbolic debugger on TNS/E systems. Native Inspect is based on the UNIX debuggers GDB and WDB. nld Manual Explains how to link TNS/R environment non-positionindependent-code (non-PIC) object files using the nld utility. rld Manual Explains how to load object files using the rld utility.
General Syntax Notation About This Guide [ ] Brackets. Brackets enclose optional syntax items. For example: TERM [\system-name.]$terminal-name INT[ERRUPTS] A group of items enclosed in brackets is a list from which you can choose one item or none. The items in the list may be arranged either vertically, with aligned brackets on each side of the list, or horizontally, enclosed in a pair of brackets and separated by vertical lines. For example: FC [ num ] [ -num ] [ text ] K [ X | D ] address { } Braces.
Notation for Messages About This Guide Item Spacing. Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma. For example: CALL STEPMOM ( process-id ) ; If there is no space between two items, spaces are not permitted. In the following example, there are no spaces permitted between the period and any other items: $process-name.#su-name Line Spacing.
Notation for Messages About This Guide Bold Text. Bold text in an example indicates user input entered at the terminal. For example: ENTER RUN CODE ?123 CODE RECEIVED: 123.00 The user must press the Return key after typing the input. Nonitalic text. Nonitalic letters, numbers, and punctuation indicate text that is displayed or returned exactly as shown. For example: Backup Up. lowercase italic letters. Lowercase italic letters indicate variable items whose values are displayed or returned.
Change Bar Notation About This Guide % Percent Sign. A percent sign precedes a number that is not in decimal notation. The % notation precedes an octal number. The %B notation precedes a binary number. The %H notation precedes a hexadecimal number. For example: %005400 %B101111 %H2F P=%p-register E=%e-register Change Bar Notation A change bar (as shown to the right of this paragraph) indicates a difference between this edition of this guide and the preceding edition.
About This Guide Change Bar Notation Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 xxiv
1 Introducing the CRE This section describes the differences between using the Common Run-Time Environment (CRE) in the Guardian and the HP NonStop Open System Services (OSS) environments, and in the TNS, TNS/R, and TNS/E native environments.
What Is the CRE? Introducing the CRE Note. For simplicity, Figure 1-1 does not show the TAL run-time library or explicit calls to system routines in non-TAL programs. Only TAL programs with embedded SQL statements use the TAL run-time library when they run without the CRE. For a mixed-language program running in a language-specific run-time environment, the program’s main routine determines the run-time environment for all routines in the program. The run-time libraries do not coordinate with each other.
What Is the CRE? Introducing the CRE Figure 1-3. The Common Run-Time Environment in the OSS Environment C Program COBOL Program C RTL COBOL RTL CRE Library NonStop Operating System VST 103.VSD The CRE provides several products with similar services: • • • TNS CRE/RTL (product number T9280) supports programs running in the TNS environment Native CRE/RTL (product number T8431) supports programs running in the TNS/R native environment.
What Is the CRE? Introducing the CRE Table 1-1. CRE/RTL Files File name Default Location Description CLUDECS $SYSTEM.SYSTEM Source file containing TNS CRE Saved Message Utility (SMU) functions, data, and data structure declarations in TAL. CLURDECS $SYSTEM.SYSTEM Source file containing TNS/R and TNS/E native CRE Saved Message Utility (SMU) functions, data, and data structure declarations in pTAL. CREDECS $SYSTEM.
Selecting a Run-Time Environment Introducing the CRE Feature OSS Environment Guardian Management of process initialization and termination Provided by the CRE Provided by the CRE Management of checkpoint and restart activities for process pairs N.A. Provided by the CRE Uniform handling of exceptions N.A.
Selecting a Run-Time Environment Introducing the CRE Table 1-2. Requirements for Running in the CRE (page 2 of 3) Primary language or compiler used for the program Need to make source changes? Must be compiled to run in the CRE? Can use system procedure calls for resources that are not shared? What changes in execution? Can contain a main routine? COBOL85 or cobol (TNS) No, if the routine uses only operating system and language constructs. Yes, by specifying the ENV COMMON compiler directive.
Selecting a Run-Time Environment Introducing the CRE Table 1-2.
Advantages of Using the CRE Introducing the CRE . Table 1-3. Language Support in TNS CRE and native CRE Application Language TNS CRE Native CRE COBOL Yes (using the COBOL85 or cobol compiler) Yes (using the ECOBOL, ecobol, nmcobol, or NMCOBOL compiler) FORTRAN Yes No C Yes Yes C++ Yes Yes TAL Yes No pTAL No Yes Note.
2 CRE Services This section describes the services and resources managed by the CRE. In this section, CRE refers to both the TNS environment and native environments. Where there are differences, TNS CRE and TNS/R native CRE or TNS/E CRE are used. Your C, COBOL, and FORTRAN routines in the TNS environment, and your C, C++, COBOL, and pTAL routines in the native environments access most CRE services transparently to you through their run-time libraries.
Comparing the CRE in the OSS and Guardian Environments CRE Services Read the Following Subsection: In order to: (continued) Using the Native Heap Managers on page 2-43 Learn how to use the native heap managers and how to query or set heap-management attributes TNS CRE Traps and Exceptions on page 2-47 and Native CRE Signals and Exceptions on page 2-55 Learn how the CRE handles traps, signals, and exceptions Reporting CRE Errors in the OSS Environment on page 2-54 Understand how the CRE determines w
$RECEIVE CRE Services modules to share standard files (standard out and standard log) that write to spooler collectors. In the OSS environment, the file system supports standard files—the CRE, therefore, does not provide such support. Language-specific run-time libraries call OSS routines to access standard files. Because the CRE does not support standard files in the OSS environment, it does not support the CRE routines for sharing spooled files.
Program Initialization CRE Services In both the OSS and Guardian environments, the CRE validates the environment during program execution. If it detects that the environment is corrupted, it writes a message for the user to read, and terminates the program.
Error Reporting CRE Services native CRE calls a kernel routine that calls all shared run-time library termination routines, and then calls another kernel routine to stop the process. In the Guardian environment, the CRE also ensures that buffers for standard files are empty and properly closed. Error Reporting In general, the CRE writes messages to the standard log file. The location to which the CRE writes messages, however, can be different in the OSS and Guardian environments.
Process Pairs CRE Services Table 2-2. CRE Services in the OSS Environment (page 2 of 2) Service TNS environment Native environment Process initialization Yes Yes Process termination Yes Yes Process pairs No No Note. All CRE service functions are visible to all programs in the Guardian and OSS environments. The results of calling a function that is not defined in the current environment, however, are undefined.
Writing TAL Routines That Use the TNS CRE CRE Services • • • • • Call TAL_CRE_INITIALIZER_ in the first statement of a TAL main procedure. TAL_CRE_INITIALIZER_ is located in the TAL run-time library, TALLIB and the external declaration is located in TALDECS. TAL_CRE_INITIALIZER_ invokes TNS CRE functions that initialize the TNS CRE. Program Initialization on page 2-4 describes the TNS CRE’s initialization tasks. The TAL Programmer’s Guide describes the interface to TAL_CRE_INITIALIZER_.
CRE Services Writing pTAL Routines That Use the Native CRE behavior if a math function detects an error. For more details, see Traps and Exceptions on page 2-3. For more information on using TAL in mixed-language programs and writing TAL programs that use TNS CRE services, see the TAL Programmer’s Guide. Writing pTAL Routines That Use the Native CRE This subsection describes considerations for pTAL language routines that run in the CRE.
Program Initialization CRE Services You must resolve how to remove the call to the INITIALIZER procedure from your program. The Guardian Procedure Calls Reference Manual describes the INITIALIZER procedure and each of the SIO procedures. The Guardian Programmer’s Guide describes how to use the INITIALIZER system procedure with SIO procedures. Program Initialization Your program begins execution when the operating system transfers control to your program’s object code.
TNS CRE Initialization CRE Services a main routine. The following table shows an example of the syntax of a main routine, called MYMAIN, in each of the languages supported by the CRE. Language Examples of Main Routine Declarations C int main(); { ... }; COBOL ?MAIN mymain IDENTIFICATION DIVISION. PROGRAM-ID. mymain. FORTRAN PROGRAM mymain TAL pTAL PROC mymain MAIN; BEGIN ...
TNS CRE Initialization CRE Services Table 2-3. PARAMs Processed by the CRE (page 1 of 2) PARAM Name PARAM Values Default Value Specifies: BUFFEREDSPOOLING ON OFF ON Whether buffered spooling is the default DEBUG ON OFF OFF How COBOL85 or cobol handles the DEBUG switch. See the COBOL Manual for TNS and TNS/R Programs. EXECUTION-LOG filename N.A. The file to which the CRE writes log messages. It can also be used to specify the standard input and standard output files.
TNS CRE Initialization CRE Services Table 2-3. PARAMs Processed by the CRE (page 2 of 2) PARAM Name PRINTERCONTROL PARAM Values Default Value Specifies: That the operating system return control to your program if the printer specified by the value of the PRINTER-CONTROL PARAM is either not ready or out of paper. The semantics for PARAM value are: filename *.filename • • • filename matches a file in any program but cannot appear in more than one program. *.
Native CRE Initialization CRE Services • Opens certain shared standard files (standard input, standard output, standard log), depending on the language of your main routine: ° If your main routine is written in C, the CRE calls a C run-time library function to open all three standard files unless you have specified the nostdfiles pragma. ° If your program is written in COBOL, FORTRAN, or TAL, the TNS CRE opens each standard file only when it receives an open request from your program.
Initialization Errors CRE Services Initialization Errors Several kinds of errors can occur during CRE initialization. If an error occurs before the CRE has set up its environment, the CRE invokes PROCESS_STOP_ and specifies option ABEND with the appropriate error text, as listed in Table 2-4 on page 2-14. Table 2-4. CRE Initialization Errors Error Text Cause of Error Backup heap allocation failed Invalid heap or heap control block.
Initializing the TNS CRE From TAL CRE Services The following errors can occur during CRE initialization after the CRE has set up its environment. Section 10, Run-Time Diagnostic Messages, describes these errors in greater detail. The CRE writes a message to standard log and terminates your program if any of these errors occur: Message Number Cause 17 The CRE could not obtain space from the run-time heap (user data segment).
CRE_Terminator_ Procedure CRE Services the C exit() function, the compiler generates a call to a language-specific run-time library function for program termination. For programs that run in the TNS CRE, the language-specific run-time library function calls the CRE_Terminator_ procedure. CRE_Terminator_ Procedure The syntax used to call the CRE_Terminator_ procedure is described in Section 6, CRE Service Functions.
Sharing Standard Files CRE Services • • If CRE_Terminator_ cannot close a standard file, it writes an error to standard log. If it cannot write to standard log, CRE_Terminator_ uses a generic completion error value for the status code and reports the text “Close error on IN”, “Close error on OUT”, or “Close error on log” according to which standard file it cannot close.
Sharing Standard Files Using the CRE CRE Services might write to the same disk location because there is no method for the run-time libraries to share the file record pointer. That is, because each routine begins writing at the beginning of the same file, the first record written by each of the program’s routines writes to the same disk location—thereby overwriting data already written there by another routine in the same program.
CRE Services Sharing Standard Files Using the CRE For example, if you have routines written in C, COBOL, and TAL, requests to write to standard output from each of the routines can be coordinated by the CRE. (The C and COBOL run-time libraries call CRE functions directly. Because the TAL run-time library does not support I/O operations, routines written in TAL must call CRE functions directly in order to use the standard files features of the CRE.
Sharing Standard Files Using the CRE CRE Services • • Figure 2-4 on page 2-22 shows the TAL routine opening standard output by calling CRE_File_Open_. The path from TAL to the CRE is a solid line and, because this is the first time a routine has requested a connection to standard output, the CRE calls the system procedure FILE_OPEN_. The path to the operating system is a solid line and the operating system box is shaded.
Sharing Standard Files Using the CRE CRE Services Figure 2-3. Using the CRE—The COBOL Routine Defaults Opening Standard Output COBOL: No special action required to open file TAL: C: COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL 0 NonStop Operating System 1 2 3 SUBVOL.FILE VST 204 .
Sharing Standard Files Using the CRE CRE Services Figure 2-4. Using the CRE—The TAL Routine Opens Standard Output COBOL: TAL: CALL CRE_FILE_Open_(CRE^Standard^Output); C: COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL NonStop Operating System 0 1 2 3 SUBVOL.FILE VST 205 .
Sharing Standard Files Using the CRE CRE Services Figure 2-5. Using the CRE—The C Routine Opens Standard Output COBOL: TAL: C: fopen_std_file(STDOUT, FALSE); COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL NonStop Operating System 0 1 2 3 SUBVOL.FILE VST 206.VSD Figure 2-6 through Figure 2-9 repeat the same sequence as shown in Figure 2-2 through Figure 2-5.
Sharing Standard Files Using the CRE CRE Services Figure 2-6. Using the CRE—Quiescent State With Standard Output Open COBOL: TAL: C: COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL NonStop Operating System 0 1 2 3 SUBVOL.FILE VST 207.
Sharing Standard Files Using the CRE CRE Services Figure 2-7. Using the CRE—The COBOL Routine Writes to the File $VOL.SUBVOL.FILE COBOL: DISPLAY “A” TAL: C: COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL NonStop Operating System 0 A 1 2 3 SUBVOL.FILE VST 208.
Sharing Standard Files Using the CRE CRE Services Figure 2-8. Using the CRE—The TAL Routine Writes to the File $VOL.SUBVOL.FILE COBOL: TAL: CALL CRE_File_Output_(fn, “B”); C: COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL NonStop Operating System 0 A 1 B 2 3 SUBVOL.FILE VST 209.
Using CRE Functions to Access the Standard Files CRE Services Figure 2-9. Using the CRE—The C Routine Writes to the File $VOL.SUBVOL.FILE COBOL: TAL: C: printf(“C\n”); COBOL Run-Time Library C Run-Time Library Common Run-Time Environment Library $VOL NonStop Operating System 0 A 1 B 3 2 C SUBVOL.FILE VST 210.VSD Using CRE Functions to Access the Standard Files Except under unusual circumstances, use only high-level language constructs to access standard files.
Determining When Standard Files Are Opened CRE Services Determining When Standard Files Are Opened The language in which the main routine is written determines when and if standard files are opened. If the main routine is written in C, the C run-time library opens the three standard files as part of program initialization unless the C main routine specifies the nostdfiles pragma.
Standard Input CRE Services Figure 2-10. Process Startup Message Layout -1 vol name Msg Code subvol name Process Defaults vol name subvol name file name vol name INFILE subvol name file name OUTFILE Cmd-Line String VST 21 1.VSD Standard Input Standard input is a special file that is available to all programs that use the CRE. You must open it for read-only access. The device for standard input must support sequential read access.
Standard Input CRE Services If you do not specify the IN parameter, TACL passes the name of your terminal as the IN parameter, which has the same effect as explicitly specifying your home terminal as the IN parameter: PARAM EXECUTION-LOG AFILE RUN myprog • The name of your program’s home terminal and you specify an asterisk for the EXECUTION-LOG, the CRE does not open a file for standard input.
Standard Output CRE Services If you start your program from a TACL command line or a TACL macro, the INFILE in the startup message is the name you specify in the TACL IN parameter or, if you do not specify an IN parameter, then the name by which TACL knows your terminal. If a program other than TACL starts your program, INFILE in the startup message contains whatever file name the other program stores when it creates the startup message.
Standard Output CRE Services time your program writes to standard output, the CRE discards the record and indicates a successful write: PARAM EXECUTION-LOG * RUN myprog / OUT $TERM, ..... • / The name of your program’s home terminal and you specify the program’s home terminal as the EXECUTION-LOG, the CRE uses the file you specify for the EXECUTION-LOG as standard output. Note. The CRE does not recognize a TACL ASSIGN for a logical file called STDOUT. Figure 2-12.
Standard Log CRE Services Standard Log Standard log is a special file that is available to all programs that use the CRE. If you open standard log explicitly, you must open it for write-only access. Your program does not have to declare it or specify its attributes although it can do so. The CRE and runtime libraries write messages to standard log such as error messages, warnings, and informational messages. A user program can also send messages to standard log by calling CRE_Log_Message_.
Using $RECEIVE CRE Services The flow chart in Figure 2-13 on page 2-34 shows how the CRE determines the name of standard log. Figure 2-13.
$RECEIVE and Program Initialization CRE Services PARAM messages; the CRE, therefore, does not process such messages when it runs in the OSS environment. $RECEIVE and Program Initialization During program initialization, the CRE reads initialization messages from $RECEIVE. At the end of program initialization, the CRE closes $RECEIVE. $RECEIVE remains closed until the CRE receives a request to open it or the CRE itself needs to open it.
Using a Spooler Collector CRE Services $RECEIVE, the CRE will not be able to open $RECEIVE because it requires exclusive access. To access $RECEIVE, a COBOL or FORTRAN run-time library function, or C/C++, TAL, or pTAL routine opens $RECEIVE by calling CRE_Receive_Open_Close_ with the open variant. The run-time library function or other-language routine reads messages from $RECEIVE by calling CRE_Receive_Read_ and replies to messages from $RECEIVE by calling CRE_Receive_Write_.
Memory Organization CRE Services Memory Organization This subsection describes the overall layout of memory for programs that use the services of the CRE, and the data spaces that your program can use to share data. TNS CRE Memory In the TNS CRE, the data spaces that your program can use to share data are: • • • The extended stack The user heap Global data The CRE allocates memory using the same layout in the OSS and Guardian environments.
TNS CRE Memory CRE Services • • • TNS CRE data in the upper 32K words includes pointers to additional data items, some of which might be in extended memory. The TNS CRE maintains a pointer at word 0 of the user data segment (G[0]) to the TNS CRE’s Master Control Block (MCB). The TNS CRE and the run-time libraries use the MCB pointer at G[0] to locate their private data. The TNS CRE maintains a pointer at word 1 of the user data segment (G[1]) to the TNS CRE’s Heap Control Block (HCB). Figure 2-14.
TNS CRE Memory CRE Services Figure 2-15. Organization of a Large-Memory- or Wide-Memory Model Program Running in the TNS CRE 64K CRE Data Run-Time Library Data User Heap [#HEAP] 32K User Data Stack G[2] G[1] User Global Data Heap Control Block (HCB) Pointer G[0] Ma ster Control Block (MCB) Pointer User Data Segment Extended Data Se gment VST 21 6.VSD The Extended Stack The TNS CRE works with the extended stack model used by both TAL and FORTRAN. No other languages use this model.
TNS CRE Memory CRE Services heap space. TAL routines cannot access the TNS CRE functions that allocate heap space. Data allocated on the heap by a routine written in one language can be accessed by a routine written in another language by passing the address of the data from one routine to another. Routines that access the same data on the heap must specify the same data layout, even if you must use language-specific syntax in each language to describe the same data.
Native CRE Memory CRE Services Accessing Heap Data: • • C and TAL routines can reference data allocated on the heap by storing the address of the data into a pointer and referencing the pointer in an expression. Routines written in COBOL and FORTRAN must call C or TAL routines to reference heap data. A TAL routine can call a C routine to allocate or free heap space. The following code fragment shows a TAL routine, Do_It, that calls a C routine, GETSPACE, to get space from the heap.
Native CRE Memory CRE Services the amount of memory available in the OSS environment might be somewhat different than the amount available to the same process running in the Guardian environment. Overall Memory Organization The following table shows the maximum size for the memory segments in the native run-time environment.
Using the Native Heap Managers CRE Services Requesting Space on the Heap C routines request heap space by calling the C malloc() function, and return heap space by calling the C free() function. pTAL routines do the same. C++ routines request heap space by calling the new() function, and return heap space by calling the delete() function.
CRE Services • Undetected Logic Errors Can Exist in Code that Uses the Original Heap Manager The original heap manager, contained in product T8431G09 (Native CRE/RTL). This heap manager is not available on H-series systems.
Using the Programmatic Heap-Management Attributes CRE Services Guardian Commands to Enable Overwrite To enable the overwrite released-space feature, use either the ADD DEFINE or the PARAM command: • ADD DEFINE =_ERASE_ON_FREE_, CLASS MAP, FILE ON This DEFINE activates the overwrite released-space feature for each process subsequently initiated by that TACL session. Note that this DEFINE influences processes and is propagated or suppressed according to the rules for all DEFINEs.
Using the Programmatic Heap-Management Attributes CRE Services Setting Heap-Management Attributes You can set five heap attributes: minimum block, erase on free, erase on get, segment threshold, and segments max. The C syntax of the routine for setting a heap-management attribute is: int RTL_heap_setattribute_ ( int Attribute, size_t Value ) ; Attribute is an ordinal that specifies the heap attribute. Table 2-5 on page 2-46 defines the ordinals for Attribute.
TNS CRE Traps and Exceptions CRE Services Table 2-5. Heap-Management Attributes for the High-Performance Heap Manager (page 2 of 2) Attribute Name Definition and Default Value Attribute Value RTL^Heap^segments^max The number of flat extended segments that can be allocated subsequently. Default value: 0 Range of values: 0 to 32. 4D RTL^Heap^space^size The heap space area size in bytes.
Errors in Program Logic CRE Services • • • Using ARMTRAP Writing messages to standard log Handling errors in TNS CRE-supported languages In the Guardian environment, the TNS CRE performs the tasks described in this subsection. In the OSS environment on G-series systems, the TNS CRE does not process traps or exceptions. Traps are a feature of the Guardian environment. Signals provide an analogous capability in the OSS environment.
Hardware Traps CRE Services If an error occurs in a math function and traps are disabled in the routine that called the math function, control is returned to the caller: REAL r, s; r := -1.0E0; CALL disable_overflow_traps; s := RTL_Sqrt_Real32_( r ); IF $OVERFLOW THEN BEGIN ...
TNS CRE Trap Handler CRE Services The CRE and the run-time libraries validate portions of their data at strategic points of execution to ensure that the data values are not only valid, but that they are meaningful in the context in which they are used. The CRE defines an error in which its data has been corrupted or its logic state has been compromised to be a catastrophic error.
Using ARMTRAP CRE Services See the Guardian Programmer’s Guide for more information on establishing the debugger program for your process. • • If the TNS CRE cannot write a diagnostic message to standard log, but it can write to your home terminal, it writes message 61, “Standard log file error (error),” to your home terminal. error appears only if the TNS CRE has an error number it can report. See message 61 in Section 10, Run-Time Diagnostic Messages, for more details.
Language-Specific Error Handling CRE Services Although the TNS CRE does not determine the effects of, or suggest how to recover from, errors that occur in routines that your program invokes—for example, in string functions, math functions, and so forth—the messages in Section 10, Run-Time Diagnostic Messages, give you some guidance. Consult the language manual for the function that caused the error to determine the error’s effect and how to recover from the error.
COBOL Routines CRE Services • A trap occurs. However, your program can retain control if an arithmetic trap (trap 4) occurs by using the C trap_overflows() library function: trap_overflows( enable_flag ) Caution. The C trap_overflows() library function takes the following actions: • • It sets or resets the trap enable bit (bit 8) in the TNS environment register.
FORTRAN Routines CRE Services FORTRAN Routines If an error occurs in a TNS CRE or run-time library function called from a FORTRAN routine, the TNS CRE returns control to the FORTRAN run-time library. If the error occurred when your program executed an I/O statement and you specified either the IOSTAT or ERR parameters on the I/O statement, the FORTRAN run-time library returns control to your FORTRAN program; otherwise, the run-time library terminates the program.
Native CRE Signals and Exceptions CRE Services Figure 2-16. Writing a CRE Error Message in the OSS Environment Start Write to file associated with File Descriptor 2 yes Write Successful? no Write to home terminal (might fail) Call PROCESS_STOP_ VST 21 7.VSD Native CRE Signals and Exceptions For Guardian processes, the native CRE library provides a default signal handler for all signals whose default action is not signal ignore.
Using CRE Services CRE Services Using CRE Services Table 2-6. TNS CRE Services Available in the OSS and Guardian Environments Function or Function Group OSS Environment (G-Series Systems) Guardian Environment CRE Standard Files No Yes $RECEIVE Limited Yes CRE_Terminator_ Yes Yes Exception (Trap) Handling No Yes Process Pairs No Yes Signal Handling Yes No Table 2-7.
CRE and RTL Prefixes CRE Services native CRE library functions are intended for the use of the C and C++ run-time libraries, not for use by user-written C, C++, and pTAL routines. Only make explicit calls to the CRE library when the language’s semantics do not provide the desired CRE service.
CRE and RTL Prefixes CRE Services corresponding function name. See the Guardian Native C Library Calls Reference Manual for descriptions of these functions. CRE_ Functions A function whose name begins with CRE_ is integral to the CRE. For example, the CRE provides services that manage I/O, $RECEIVE, and traps. These are the services that the CRE provides. CRE_ functions often require access to information from previous CRE operations and save information that is used during subsequent calls to the CRE.
Type Suffixes CRE Services occurred. The RTL_ version does not save the errno field nor does it save the number of the error that occurred. Type Suffixes Many standard functions are represented by multiple versions, depending on the types of the function’s parameters and the result returned by the function.
Language Support for Process Pairs CRE Services • • • • The program’s main routine must specify that it can run as a process pair. The routine’s compiler sets this attribute in your program’s object file based on how you set the NONSTOP compiler directive. Your TACL environment must not specify PARAM NONSTOP OFF. You do not need to specify PARAM NONSTOP ON because ON is the default value for the NONSTOP parameter.
Results of Operations That Support Process Pairs CRE Services with CRE support for process pairs). Therefore, a process pair can include C routines only if those routines do not depend on run-time library resources. That is, C routines: • Cannot request or return heap space. Note. A program that runs as a process pair cannot use the heap because only C routines can allocate space from the heap but C is prohibited from allocating heap space in a process pair.
Using the Inspect, Native Inspect, and Visual Inspect Symbolic Debuggers With CRE Programs CRE Services Table 2-10. Status Codes Returned by CRE Functions That Support Process Pairs (page 2 of 2) Status Code Meaning 3nnn A call to FILE_OPEN_CHKPT_ failed. nnn is a file system error code.* 4nnn PROCESS_CREATE_ failed. nnn is a file system error code.* Status codes between 4900 and 4999 represent the value returned by the PROCESS_CREATE_ system procedure.
Selecting a Debugger CRE Services Selecting a Debugger You can use the Inspect, Native Inspect, or Visual Inspect symbolic debugger to debug a program that uses the CRE. • To specify Inspect or Native Inspect as the debugger, run your program using the RUND TACL command; for example: RUND mtro ... • To specify Visual Inspect as the debugger, use the RUNV TACL command, as follows: RUNV mtro ...
Locating the Corrupter of TNS CRE Pointers CRE Services Considerations for Using Visual Inspect If you are using Visual Inspect with the CRE, note the following considerations: • Visual Inspect can find a global variable of any language independent of the language of the scope in the Program Control View. To find a global identifier, open a Display dialog and then select the Global radio button. Type your variable or expression in the Expression box and click OK.
Locating the Corrupter of TNS CRE Pointers CRE Services memory access breakpoint, the debugger displays a message that shows which statement overwrote the data. Example 2-1 on page 2-65 shows the source code of a C program. The statement at line 7 of the program overwrites the TNS CRE’s pointer at G[0] to the MCB. Example 2-2 on page 2-65 shows the information written to standard log when the program is run.
Circumventing the CRE CRE Services Example 2-3. Inspect Session for C Program That Overwrites the MCB Pointer mysubv 46> rund mtro <-- Run with Inspect. INSPECT - Symbolic Debugger - T9673D10 - (08JUN92) System \ASYS Copyright HP Computers Incorporated 1983, 1985-1992 INSPECT 175,03,00147 MTRO #_MAIN.#10.001(MTR) -MTRO-b #main <-- Set breakpoint Breakpoint created: 1 Code #main.#4(MTR) at start user code. -MTRO-resume <-- Resume execution. PID: 3,147 \ASYS.$FACE.MYSUBV.
CRE Services Circumventing the CRE with great caution. If you call system procedures to modify a resource that the CRE is managing, for example, a standard file, the CRE cannot ensure that subsequent access to the resource will produce the results you expect. For standard files, CRE functions provide most of the functionality you need. The CRE includes functions that execute an operating system CONTROL operation (CRE_File_Control_), a SETMODE operation (CRE_File_Setmode_), and so forth.
CRE Services Circumventing the CRE Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 2- 68
3 Compiling and Binding Programs for the TNS CRE Read this section for information about compiling and binding TNS and accelerated programs that run in the Common Run-Time Environment (CRE). This section describes both the Guardian and OSS environments, but focuses on the Guardian environment. Refer to the C/C++ Programmer’s Guide and COBOL Manual for TNS and TNS/R Programs for information about compiling and binding in the OSS environment on G-series systems.
Specifying a Run-Time Environment Compiling and Binding Programs for the TNS CRE Table 3-1. ENV Options and the Availability of Run-Time Libraries ENV Option Available Run-Time Library COMMON CRE library OLD A COBOL and FORTRAN run-time library LIBRARY CRE library NEUTRAL None EMBEDDED None LIBSPACE None All language features are available to routines that run in user code space.
Compiling and Binding Programs for the TNS CRE Specifying a Run-Time Environment Table 3-3.
Compiling and Binding Programs for the TNS CRE Sourcing-in CRELIB Function Declarations The C compilers generate programs that run in the CRE. The TNS COBOL, FORTRAN, and TAL compilers generate programs that can run in either a languagespecific run-time environment or the CRE. To produce TNS COBOL, FORTRAN, or TAL programs that run in the CRE, you must compile with the ENV COMMON directive.
CRE Data Blocks Compiling and Binding Programs for the TNS CRE CRE Data Blocks When a compilation unit contains a main procedure, the C compilers allocate and initialize special data blocks required by the CRE. When a compilation unit contains a main procedure and you have specified an ENV COMMON directive, the TNS COBOL, FORTRAN, and TAL compilers allocate and initialize these special data blocks. Table 3-5 on page 3-5 lists the special data blocks. Table 3-5.
Binding Programs for the CRE Compiling and Binding Programs for the TNS CRE Table 3-6.
Run-Time Libraries Compiling and Binding Programs for the TNS CRE Use the Binder INFO command with the DETAIL clause to show the ENV attribute of a particular data or code block. For example: @ add * from test @ info *, detail TEST^PROCEDURE LANG: TAL ENV: NEUTRAL 167 TIME: 1992-06-19 09:48 Run-Time Libraries The TNS C, COBOL85, FORTRAN, and TAL products each consist of a compiler and a set of separately packaged run-time functions called a run-time library.
Compiling and Binding Programs for the TNS CRE Sample Binder Sessions Section 6, CRE Service Functions, and Section 7, Math Functions. The TNS C, TNS COBOL, and FORTRAN run-time libraries call the functions in CRELIB. If you bind the appropriate languages’ run-time libraries into your program, you must also bind in CRELIB.
Compiling and Binding Programs for the TNS CRE ° ° ° ° Bind-Time Validation for Mixed-Language Programs Word address Extended address Two-byte procedure parameter Four-byte procedure parameter Only C supports the passing of structured parameters by value. Such parameters cannot match parameters passed from any other language. • Return types (values returned on the stack) for both interlanguage and intralanguage calls must belong to the same class.
Compiling and Binding Programs for the TNS CRE Bind-Time Validation for Mixed-Language Programs that two routines in the same object file cannot have the same name, even if they are written in different languages. Refer to the Binder Manual for more information.
4 Compiling and Linking Programs for the Native CRE Read this section for information about compiling and linking native programs that run in the Common Run-Time Environment (CRE). This section describes both the Guardian and OSS environments, but focuses on the Guardian environment. Refer to the Open System Services Shell and Utilities Reference Manual and the C/C++ Programmer’s Guide for information about compiling and linking in the OSS environment.
Sourcing In CRE External Declarations for pTAL Modules Compiling and Linking Programs for the Native CRE Table 4-1.
Linking Modules Compiling and Linking Programs for the Native CRE does not require any ENV directives. The compiler issues a warning for any ENV directives that it finds. If your pTAL routines call CRE functions, you must compile the routines with a SOURCE directive that references the external declarations file for the CRE function as follows: If the Function Name Begins With: Specify This File: CRE_ CRERDECS RTL_ RTLRDECS CLU_ CLURDECS These external declarations files are located in $SYSTEM.
Compiling and Linking Programs for the Native CRE • Linking Modules When the main routine is written in TNS/E native C, link in the TNS/E native C runtime library object file, CCPLMAIN Unlike the Binder product, the native linker utilities do not perform any special checking for mixed-language programs or programs that use the CRE. Examples of Compiling and Linking 1. In this example, the pTAL compiler compiles the pTAL source file PTALSRC and generates the object file PTALOBJ.
Compiling and Linking Programs for the Native CRE Linking Modules replaces the Guardian environment CCOMP and ELD commands, as shown in the following sequence of OSS commands: gtacl -p "eptal / in eptalsrc, out $s.
Compiling and Linking Programs for the Native CRE Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 4 -6 Linking Modules
5 Using the Common Language Utility (CLU) Library This section describes the services provided by the Common Language Utility (CLU) library. It explains how to use the services of the Saved Message Utility (SMU), part of the CLU library, in COBOL, FORTRAN, and TAL routines in the TNS environment, and in C, C++, COBOL, and pTAL routines in a native environment. CLU library routines can be used only in the Guardian API.
Using the Common Language Utility (CLU) Library Compiling and Binding or Linking Programs That Use the CLU Library Compiling and Binding or Linking Programs That Use the CLU Library For the TNS CRE, you must explicitly bind into your program’s object file all CLU functions referenced by your program. To bind the CLU functions into your object file, specify the following Binder command: SELECT SEARCH $SYSTEM.SYSTEM.
Using the Common Language Utility (CLU) Library Using the Saved Message Utility Functions your process by the process that starts your process. The SMU functions can be called by COBOL, FORTRAN, TAL, and pTAL-compiled programs. The TNS CRE SMU functions, data, and data structure declarations in TAL are available in the CLUDECS file. The TNS/R and TNS/E native CRE SMU functions, data, and data structure declarations in pTAL are available in the CLURDECS file. Table 5-2.
Using the Common Language Utility (CLU) Library Services Provided by the Saved Message Utility TNS COBOL and FORTRAN routines can continue to use pre-D20 SMU functions. Table 5-3 on page 5-4 lists the pre-D20 SMU functions and the corresponding current SMU functions. Table 5-3.
Using the Common Language Utility (CLU) Library Services Provided by the Saved Message Utility To save these messages for manipulation with SMU functions: • • COBOL and FORTRAN programs use the SAVE compiler directive TAL programs call TAL_CRE_INITIALIZER_ and pass the OPTIONS parameter to it, as described in the TAL Programmer’s Guide.
Content of Messages Using the Common Language Utility (CLU) Library SMU functions operate on copies of the process creation messages that establish the execution environment for a program. The functions let you check, retrieve, delete, or replace portions of messages. Table 5-4 on page 5-6 lists the SMU functions by action and by type of message operated on. Table 5-4.
Using the Common Language Utility (CLU) Library Using SMU Routines to Manipulate Messages Table 5-6.
Using the Common Language Utility (CLU) Library • Using SMU Routines to Manipulate Messages Specify the message parts to retrieve. Table 5-7 on page 5-8 lists the message parts you can retrieve and the SMU function you use for each. Table 5-7.
Using the Common Language Utility (CLU) Library Using the environ Array Deleting Environment Information You can use the Delete subset of SMU functions to delete entire ASSIGN, PARAM, and startup messages. You can also delete parts of ASSIGN and PARAM messages. You cannot, however, delete parts of the startup message. Instead, you can use SMU_Startup_PutText_ to assign null values to startup message parts, thereby achieving the same effect as deleting the parts.
Using the Common Language Utility (CLU) Library Using the environ Array Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 5- 10
6 CRE Service Functions This section describes the interfaces to the CRE service functions. The service functions include: • • • • • Environment Functions on page 6-1 File-Sharing Functions on page 6-4 $RECEIVE Functions on page 6-30 CRE_Terminator_ on page 6-42 Exception-Handling Functions on page 6-44 The TNS CRE service functions, data, and data structure declarations in TAL are available in the CREDECS file.
CRE_Putenv_ CRE Service Functions name is a pointer to a null-terminated string that specifies the name of the environment variable whose value CRE_Getenv_ returns. name identifies a value established either in a PARAM command or by a previous call to CRE_Putenv_. The syntax for the native CRE environment is: EXTADDR PROC CRE_GETENV_=”getenv”( Var_name ) LANGUAGE C; STRING .
CRE_Putenv_ CRE Service Functions name-value is a null-terminated string that contains the name of an environment variable followed by an equal sign (=), followed by the value to store in the specified environment variable, as follows: name=value For example, the following string in name-value, stores the string “ABCDEFGH” in the environment variable “ALPHABET”: ALPHABET=ABCDEFGH0 where the zero (0) is a null byte that terminates the name-value string.
File-Sharing Functions CRE Service Functions If name (TNS CRE) exists, CRE_Putenv_ stores value in the name environment variable. If Var_string (native CRE) exists, CRE_Putenv_ stores string in the Var environment variable. If name (TNS CRE) does not exist, CRE_Putenv_ creates a new environment variable called name and associates value with it. If Var_string (native CRE) does not exist, CRE_Putenv_ creates a new environment variable called Var and associates string with it.
CRE Service Functions CRE_File_Close_ CRE_File_Close_ The CRE_File_Close_ function closes the standard file that you specify. The syntax for the TNS CRE environment: is: INT PROC CRE_File_Close_( file_ordinal, disposition, cplist ) EXTENSIBLE; INT file_ordinal; ! in, required INT disposition; ! in, optional INT(32) .
CRE_File_Control_ CRE Service Functions • A negative number, which is the negation of a CRE error number from the following table: Error Code Cause 16 Checkpoint list exhausted 55 Missing or invalid parameter 63 Undefined shared file Considerations CRE_File_Close_ decrements its count of the number of connections it has granted. If after decrementing its count by one, the number of outstanding connections is nonzero, CRE_File_Close_ returns to its caller without taking further action.
CRE_File_Control_ CRE Service Functions param is the param parameter to pass to the CONTROL or SPOOLCONTROL system procedures.
CRE_File_Input_ CRE Service Functions CRE_File_Input_ The CRE_File_Input_ function reads a record from a standard file. INT PROC CRE_File_Input_( file_ordinal, buffer:read_count, count_read, write_count ) EXTENSIBLE; INT file_ordinal; ! in, required STRING .EXT buffer; ! out, required INT read_count; ! in, required INT .EXT count_read; ! out, optional INT write_count; ! in, optional TNS,native file_ordinal identifies the standard file from which to read.
CRE Service Functions CRE_File_Message_ Considerations CRE_File_Input_ reads the next sequential record from the file referenced by file_ordinal unless file_ordinal specifies a null file in which case CRE_File_Input_ returns end of file without taking any other action. If file_ordinal does not reference a null file, CRE_File_Input_ reads the next sequential record by calling: • • • • READEDIT if the file is an EDIT file that was opened by calling OPENEDIT.
CRE_File_Message_ CRE Service Functions indent_bytes if present, specifies whether or not CRE_File_Message_ should write your message on multiple lines, if necessary and, if so, the indentation to use for all lines after the first. CRE_File_Message_ alters the contents of buffer as follows, if your message requires more than one line: • • • • If indent_bytes > 0, each message line after the first line is indented by indent_bytes characters.
CRE_File_Open_ CRE Service Functions Error Code Cause (continued) 57 Parameter value not accepted 63 Undefined shared file 64 File not open Considerations CRE_File_Message_ retries operations that return an error and are recoverable. CRE_File_Open_ The CRE_File_Open_ function opens a standard file.
CRE Service Functions CRE_File_Open_ file_ordinal identifies the standard file to open. You can use the following symbolic names for file_ordinal: CRE File Ordinal Symbolic Names CRE^Standard^Input CRE^Standard^Output CRE^Standard^Log flags if present, specifies CRE options. flags.<0:13> must be 0. flags.<14:15> specifies the buffering attribute for a spooler collector. If flags is not passed, CRE_File_Open_ assumes its value to be 0.
CRE Service Functions CRE_File_Open_ exclusion corresponds to the exclusion parameter to the FILE_OPEN_ system procedure. Refer to the FILE_OPEN_ procedure in the Guardian Procedure Calls Reference Manual for valid access parameter values. no_wait if present, is the nowait parameter to pass to the FILE_OPEN_ system procedure. CRE_File_Open_ returns an error if you specify a nonzero value for no_wait. If you do not specify no_wait, CRE_File_Open_ uses a value of zero.
CRE_File_Open_ CRE Service Functions • • A positive number, which is a file system error number A negative number, which is the negation of one of the following CRE error numbers: Error Code Cause 16 Checkpoint list exhausted 17 Cannot obtain control space 20 Cannot utilize file name 55 Missing or invalid parameter 57 Parameter value not accepted 63 Undefined shared file 65 Invalid attribute value 66 Unsupported file device 67 Access mode not accepted 68 Nowait value not accepted 69
CRE Service Functions CRE_File_Open_ The device type for standard output and standard log must be a process, the operator console, a disk, a printer, or a terminal. If you specify different values for the exclusion, sync_receive_depth, or options parameters on any open after the first open, the CRE returns an error stating that the requested attributes are incompatible with existing attributes, unless the requested attributes are a subset of the existing attributes.
CRE_File_Open_ CRE Service Functions Figure 6-1. Using Connections to Share a File Open User Routine User Routine User Routine User Process Run-Time Library Routine Run-Time Library Routine Run-Time Library Routine Language-Specific Run-Time Libraries CRE_File_Open_ Shared File Standard Input Guardian File Name $myterm Connections $myterm 3 Standard Output $vol.subvol.log Standard Log 3 1 I/O File Table Common Run-Time Environment Library FILE_OPEN_ Guardian File System VST 601 .
CRE Service Functions • CRE_File_Open_ Opening terminals and processes A standard file can access a terminal or a process (except a spooler collector) for both input and output. If the file you specify for standard input is the same as the file you specify for standard output or standard log, the CRE opens the operating system file only once, although you must invoke CRE_File_Open_ once for the read component of the open, and once for the write component of the open.
CRE_File_Open_ CRE Service Functions • ° An EDIT file if your program’s main routine is written in C/C++, pTAL, or TAL, or if your program’s main routine is written in COBOL or FORTRAN and does not specify that it is to run as a process pair. ° An entry-sequenced file if your program’s main routine is written in COBOL or FORTRAN and specifies that it is to run as a process pair (regardless of whether your program is currently running as a process pair).
CRE Service Functions ° ° CRE_File_Open_ The CRE is unable to allocate a buffer for spooled output. Undecided Spooling If you specify CRE^Undecided^spooling, pass zeroes for flags, or do not specify flags, the CRE converts your request to CRE^Simple^spooling if: ° ° file_ordinal specifies standard log. The CRE is unable to allocate a buffer for spooled output.
CRE_File_Output_ CRE Service Functions Figure 6-2. Determining Spooler Buffering in CRE_File_Open_ Flags= Buffered Spooling? Start yes no no Flags= Simple Spooling? Flags=Undecided Spooling yes no Nowait=0? yes yes yes yes File Ordinal =Standard Log? no Can Allocate Buffer no Can Allocate Buffer yes yes Use Buffered Spooling File Ordinal =Standard Log? no no Error Nowait=0? Use Simple Spooling Spooling Undecided VST 602 .VSD .
CRE_File_Output_ CRE Service Functions file_ordinal identifies the standard file to which to write. You can use the following symbolic names for file_ordinal: CRE File Ordinal Symbolic Names CRE^Standard^Output CRE^Standard^Log buffer:write_count is the record to transmit (buffer) and its length in bytes (write_count). count_written if present, is the number of bytes written when the record is transmitted. If a record is not transmitted, count_written is zero.
CRE_File_Retrycheck_ CRE Service Functions • A negative number, which is the negation of a CRE error number from the following table: Error Code Cause 55 Missing or invalid parameter 57 Parameter value not accepted 63 Undefined shared file 64 File not open Considerations • • • • • • If the file referenced by file_ordinal is a spooler collector, the current spooling state is either buffered spooling or undecided spooling, and the spooler has not been initialized, CRE_File_Output_ calls the CRE
CRE Service Functions CRE_File_Setmode_ error if present and greater than or equal to zero, is a file system error code; otherwise, if present and less than zero, error is a negated CRE error ordinal. Return Value CRE_File_Retrycheck_ returns 0 if file_ordinal is not valid or if error is present and has a negative value; otherwise, CRE_File_Retrycheck_ returns the value returned to it from a call to the FILEERROR system procedure.
CRE_Hometerm_Open_ CRE Service Functions param1 is the param1 parameter for a SETMODE or SPOOLSETMODE system procedure. param2 is the param2 parameter for a SETMODE or SPOOLSETMODE system procedure.
CRE_Log_Message_ CRE Service Functions Return Value CRE_Hometerm_Open_ returns one of the following: • • • 0 if the open operation is successful A positive number, which is a file system error number A negative number, which is the negation of a CRE error number from the following table: Error Code Cause 20 Cannot utilize file name Considerations • • • CRE_Hometerm_Open_ opens your process’s home terminal and returns its file number in file_number.
CRE_Log_Message_ CRE Service Functions count_read if present, is the number of bytes in the response. For details on the parameters to CRE_Log_Message_, see the descriptions of the corresponding parameters in the CRE_File_Message_ procedure.
CRE Service Functions CRE_Spool_Start_ CRE_Spool_Start_ The CRE_Spool_Start_ function invokes the SPOOLSTART system procedure. INT PROC CRE_Spool_Start_(file_ordinal, buffering, location:loc_bytes, form_name:form_bytes, report_name:report_bytes, number_of_copies, page_size, flags, owner, max_lines,max_pages) EXTENSIBLE; INT file_ordinal; ! in, required INT buffering; ! in, optional STRING .EXT location; ! in, optional INT loc_bytes; ! in, optional STRING .
CRE Service Functions CRE_Spool_Start_ location:location_bytes if present, specifies the location for the spooler job and its length in bytes. CRE_Spool_Start_ passes this parameter to the SPOOLSTART system procedure’s location parameter. CRE_Spool_Start_ ensures that the string it passes to SPOOLSTART is 16 bytes long by truncating or adding blank characters to the string you specify. form_name:form_bytes if present, specifies the form name for the spooler job.
CRE_Spool_Start_ CRE Service Functions max_pages if present, specifies the maximum number of pages to allow for the spooler job. CRE_Spool_Start_ passes max_pages to the max-pages SPOOLSTART parameter.
$RECEIVE Functions CRE Service Functions Figure 6-3.
CRE_Receive_Open_Close_ CRE Service Functions Table 6-4. $RECEIVE Functions Function Name Function Action CRE_Receive_Open_Close_ on page 6-31 Opens or closes $RECEIVE. CRE_Receive_Read_ on page 6-38 Reads a message from $RECEIVE by calling READUPDATE. CRE_Receive_Write_ on page 6-41 Replies to a message from $RECEIVE by calling REPLYX. CRE_Receive_Open_Close_ CRE_Receive_Open_Close_ provides a logical open or close of $RECEIVE on behalf of its caller.
CRE_Receive_Open_Close_ CRE Service Functions Return Value CRE_Receive_Open_Close_ returns one of the following: • • • 0 if the input operation is successful A positive number, which is a file system error number A negative number, which is the negation of a CRE error number from the following table: Error Code Cause 17 Cannot obtain control space 55 Missing or invalid parameter 57 Parameter value not accepted 65 Invalid attribute value 71 Inconsistent attribute value Specifying the Receive
CRE_Receive_Open_Close_ CRE Service Functions RFOA field Effect (continued) Maximum^syncdepth The server can support requesters that issue up to four I/O requests to the server between calls to a checkpoint system procedure such as CHECKPOINT, CHECKPOINTX, CHECKPOINTMANYX, and so forth. (value 4) Maximum^reply (value 24 bytes) Receive^depth The server can store replies that are up to 24 bytes long, as shown in each Reply table.
CRE_Receive_Open_Close_ CRE Service Functions Figure 6-4. Structure Allocation to Support Requesters Running as Process Pairs Requesters Requester A Requester B Requester C loop: ... WRITE to server ... WRITE to server ... WRITE to server ... WRITE to server loop: ... WRITE to server ... WRITE to server ... WRITE to server ... WRITE to server loop: ... WRITE to server ... WRITE to server ... WRITE to server ...
CRE Service Functions CRE_Receive_Open_Close_ CHECKPOINTX, CHECKPOINTMANY, CHECKPOINTMANYX, and so forth. Note that the CRE allocates enough space to accommodate the maximum number of retained replies times the maximum number of requesters times the maximum number of bytes per saved reply.
CRE_Receive_Open_Close_ CRE Service Functions Table 6-5.
CRE_Receive_Open_Close_ CRE Service Functions rcv_param.Report^flags[2] := 0; rcv_param.Report^flags[3] := 0; rcv_param.Report^flags[0] := CRE^cpu^down^mask CRE^cpu^up^mask CRE^settime^mask CRE^power^on^mask LOR LOR LOR ; rcv_param.Report^flags[1] := CRE^CONTROL^mask CRE^SETMODE^mask LOR ; rcv_param.
CRE_Receive_Read_ CRE Service Functions CRE_Receive_Read_ CRE_Receive_Read_ calls the READUPDATE system procedure to request a record from $RECEIVE. INT PROC CRE_Receive_Read_( buffer:read_count, count_read, time_out, sender_info, flags ) EXTENSIBLE; STRING .EXT buffer; ! out, required INT read_count; ! in, required INT .EXT count_read; ! out, required INT(32) time_out; ! in, optional INT .
CRE_Receive_Read_ CRE Service Functions INT END; Dialog^Flags; ! CRE^sender^model ! See following description Dialog^Flags is used by context-sensitive Pathway servers. It provides dialog information about the server-class send operation that a requestor initiated by means of a Pathsend procedure call. The bits of Dialog^Flags have the following meanings: <0:11> Reserved <12:13> Dialog status. Indicates the last operation performed by the message sender.
CRE Service Functions CRE_Receive_Read_ Handling Generic System Messages Generic system messages describe changes in the environment in which your program is running such as a SETTIME message or a CPU down message. Generic system messages do not apply to a specific requester although they might affect your process’s requesters. The CRE updates its state information if it receives a generic system message.
CRE_Receive_Write_ CRE Service Functions Return Value CRE_Receive_Read_ returns one of the following: • • • 0 if the input operation is successful A positive number, which is a file system error number A negative number, which is the negation of a CRE error number from the following table: Error Code Cause 55 Missing or invalid parameter 64 File not open CRE_Receive_Write_ CRE_Receive_Write_ calls the REPLYX system procedure to reply to a message from $RECEIVE.
CRE_Terminator_ CRE Service Functions If you do not specify reply^depth when you call CRE_Receive_Open_Close_ or you specify a depth of one, you must specify zero for the message_number parameter.
CRE Service Functions CRE_Terminator_ The meanings of completion codes are: CRE^Completion^normal specifies that your program completed either by reaching the end of its main routine or by invoking a language-specific normal termination verb such as STOP RUN in COBOL. CRE^Completion^warning specifies that your program reported warnings during its execution. CRE^Completion^error specifies that termination was due to a logic error in your program.
Exception-Handling Functions CRE Service Functions spi_ssid is an optional reference parameter. If present, its address is passed to the PROCESS_STOP_ system procedure for its spi-ssid parameter. spi_ssid must reference a valid 12-character subsystem identifier (ssid). See PROCESS_STOP_ in the Guardian Procedure Calls Reference Manual for more information. Refer to the PROCESS_STOP_ procedure in the Guardian Procedure Calls Reference Manual for more information about the spi_ssid parameter.
CRE_Log_GetPrefix_ CRE Service Functions Table 6-8. Exception-Handling Functions Function Name Function Action CRE_Log_GetPrefix_ on page 6-45 Returns to its caller the text that precedes each message in standard log. CRE_Stacktrace_ on page 6-45 Writes a stack trace to either a standard file or to an operating system file. CRE_Log_GetPrefix_ CRE_Log_GetPrefix_ returns to its caller the default prefix text that precedes each line of error or warning information written to standard log.
CRE_Stacktrace_ CRE Service Functions The syntax for the TNS environment is: INT PROC CRE_Stacktrace_( file_ordinal, prefix_bytes, EXTENSIBLE; INT file_ordinal; ! in, STRING .EXT buffer; ! in/out, INT buffer_bytes; ! in, INT prefix_bytes; ! in, INT .
CRE_Stacktrace_ CRE Service Functions prefix_bytes > Meaning (continued) -1 Do not include prefix bytes with any line of stack trace. 0 Do not include prefix bytes with any line of stack trace. 0 Include the first prefix_bytes of buffer:buffer_bytes on the first line of stack trace and prefix_bytes blanks on each subsequent line of stack trace. stack_mark (TNS CRE only) if present, specifies the L-register word of the first stack marker to display in the stack trace.
CRE Service Functions CRE_Stacktrace_ Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 6- 48
7 Math Functions This section describes the interfaces to the math functions. It describes: • • • • • Arithmetic Overflow Handling on page 7-1 Standard Math Functions on page 7-1 Sixty-Four-Bit Logical Operations (Bit Manipulation Functions) on page 7-23 Remainder on page 7-25 Decimal Conversion Functions on page 7-25 Each function described in this section begins with the prefix RTL_ or CRE_. Refer to Using Standard Functions on page 2-56 for more information.
Standard Math Functions Math Functions Table 7-1. TNS CRE Standard Math Functions (page 1 of 2) Function Name Function Action Arccos on page 7-4 Returns an arccosine expressed in radians. Arcsin on page 7-5 Returns an arcsine expressed in radians. Arctan on page 7-5 Returns an arctangent expressed in radians. Arctan2 on page 7-6 Returns the arctangent, expressed in radians, of the quotient of its parameters. Cos on page 7-7 Returns the cosine of an angle whose size is expressed in radians.
Standard Math Functions Math Functions Table 7-1. TNS CRE Standard Math Functions (page 2 of 2) Function Name Function Action Sign on page 7-18 Returns its first parameter with the sign set according to its second parameter. Sin on page 7-19 Returns the sine of an angle whose size is expressed in radians. Sinh on page 7-19 Returns a hyperbolic sine. Split on page 7-20 Separates a floating-point number into integral and fractional parts. Sqrt on page 7-20 Returns the square root of a number.
Arccos Math Functions Table 7-2.
Arcsin Math Functions Return Value The Arccos functions return the angle, expressed in radians, whose cosine is cos. The value returned is in the range 0 less than or equal to arccos( cos ) less than or equal to pi Arcsin The Arcsin functions return the arcsine of their parameter.
Arctan2 Math Functions Return Value The Arctan functions return the angle, expressed in radians, whose tangent is tan. The value returned is in the range: -pi/2 less than or equal to arctan( tan ) less than or equal to pi/2 Arctan2 The Arctan2 functions return the arctangent of the quotient of their parameters.
Cos Math Functions Cos The Cos functions return the cosine of an angle. REAL(32) PROC RTL_Cos_Real32_( angle ); REAL(32) angle; ! in TNS only REAL(64) PROC RTL_Cos_Real64_( angle ); REAL(64) angle; ! in TNS only angle is the angle, expressed in radians, who cosine is returned. Return Value The Cos functions return the cosine of angle. The cosine is in the range: -1.0 less than or equal to cos( angle ) less than or equal to 1.0 Cosh The Cosh functions return a hyperbolic cosine.
Exp Math Functions Exp The Exp functions return e—the natural logarithm base—raised to the power passed as a parameter to Exp. REAL(32) PROC { CRE_Exp_Real32_ } ( number ); { RTL_Exp_Real32_ } REAL(32) number; ! in TNS only REAL(64) PROC { CRE_Exp_Real64_ } ( number ); { RTL_Exp_Real64_ } REAL(64) number; ! in TNS only number is the exponent to which e is raised. Return Value The Exp functions return enumber where e is the natural logarithm base, approximately 2.718281828459045.
Log10 Math Functions e is the natural logarithm base, approximately 2.718281828459045. Considerations An arithmetic fault occurs if number is less than or equal to 0. Examples REAL(32) r1, r2, r3; r1 := CRE_Ln_Real32_( 7.389056096 ); ! r1 is approx 2. r2 := CRE_Ln_Real32_( 20.08553691 ); ! r2 is approx 3. r3 := CRE_Ln_Real32_( 54.59814999 ); ! r3 is approx 4. The values returned in R1, R2, and R3 derive from the following: 2 ln(7.389056096) ≅ 2. That is, e ≅ 7.389056096 3 ln(20.08553691) ≅ 3.
Lower Math Functions The values returned in R1, R2, and R3 derive from the following: log10(100) = 2. That is, 10 log10(1000) = 3. That is, 10 log10(10000) = 4. That is, 10 2 3 4 = 100 = 1000 = 10000 Lower The Lower function returns the largest integer that is not greater than the value of its parameter. REAL(64) PROC RTL_Lower_Real64_( number ); REAL(64) number; ! in TNS only number is the number for which Lower returns its value.
Mod Math Functions Mod The Mod functions return the result of dividing their first parameter by their second parameter using integer division if their parameters are integers, or using floating-point division if their parameters are floating-point numbers.
Normalize Math Functions Example INT i, j, k; REAL(32) r, s, t; i := 17; j := 5; k := RTL_Mod_Int16_(i, j); r := 17.2E0; s := 0.5E0; t := RTL_Mod_Real32_(r, s); ! k gets 2 ! t gets 0.2E0 Normalize The Normalize function splits a floating-point number into a normalized fraction and an integer power of two. This function is not available in the native CRE library. REAL(64) PROC RTL_Normalize_Real64_( number, power ); REAL(64) number; ! in INT .EXT power; ! out TNS only number is the number to split.
Odd Math Functions Odd The Odd function determines whether a number is even or odd. This function is not available in the native CRE library. INT PROC RTL_Odd_Int32_( number ); INT(32) number; ! in TNS only number is the number that is examined to see if it is even or odd.
Positive_Diff Math Functions x is the minuend, the number from which the subtrahend is subtracted. y is the subtrahend, the number to subtract from the minuend.
Power Math Functions Power The Power functions raise a number to a specified power. These functions are not available in the native CRE library.
Power2 Math Functions Considerations The Power functions cause a fault if: • • • base = 0 and exponent is less than or equal to 0 base < 0 and exponent has a floating-point type An intermediate calculation causes an arithmetic overflow Example INT i, j, k; i := 2; j := 3; k := RTL_Power_Int16_to_Int16_(i, j); ! k gets 8 Power2 The Power2 functions multiply a number by an integral power of 2. These functions are not available in the native CRE library.
Random_Set, Random_Next Math Functions i := 3; s := RTL_Power2_Real64_(r, i); ! s gets 56.0L0 Random_Set, Random_Next The Random_Set function sets a seed—the value of the initial random number—for a pseudo-random number generator. The Random_Next function returns the next pseudo-random number in the current sequence. These functions are not available in the native CRE library.
Sign Math Functions Sign The Sign functions return their first parameter with the sign adjusted according to the value specified in their second parameter. These functions are not available in the native CRE library.
Sin Math Functions Sin The Sin functions return the sine of an angle. REAL(32) PROC RTL_Sin_Real32_( angle ); REAL(32) angle; ! in TNS only REAL(64) PROC RTL_Sin_Real64_( angle ); REAL(64) angle; ! in TNS only angle is the angle, expressed in radians, whose sine is returned. Return Value The Sin functions return the sin of angle. The return value is in the range: -1.0 less than or equal to sin(angle) less than or equal to 1.0 Sinh The Sinh functions return a hyperbolic sine.
Split Math Functions Split The Split function separates a 64-bit floating-point number into integral and fractional parts. REAL(64) PROC RTL_Split_Real64_(number,integral_part); REAL(64) number; ! in REAL(64) .EXT integral_part; ! out TNS only number is the number to separate into an integral and fractional part. integral_part is a reference parameter into which Split stores the integral part of number. Return Value Split returns the fractional part of number.
Tan Math Functions Considerations An arithmetic fault occurs if number is less than zero. Example REAL(64) r, s; r := 25.0L0; s := RTL_Sqrt_Real64_(r); ! s gets 5.0L0 Tan The Tan functions return the tangent of an angle. REAL(32) PROC RTL_Tan_Real32_( angle ); REAL(32) angle; ! in TNS only REAL(64) PROC RTL_Tan_Real64_( angle ); REAL(64) angle; ! in TNS only angle is the angle, expressed in radians, whose tangent is returned.
Truncate Math Functions Return Value The Tanh functions return the hyperbolic tangent of number. The value returned is: tanh = sinh( number ) cosh( number )) Considerations An arithmetic fault occurs if an intermediate calculation causes an overflow. Truncate The Truncate functions return the nonfractional part of a number. These functions are not available in the native CRE library.
Sixty-Four-Bit Logical Operations (Bit Manipulation Functions) Math Functions number is the number to which the Upper function is applied. Return Value Upper returns the smallest integer that is not less than number. Example REAL(64) r; r := RTL_Upper_Real64_(1.8L0); r := RTL_Upper_Real64_(-1.8L0); ! r gets 2.0L0 ! r gets -1.0L0 Sixty-Four-Bit Logical Operations (Bit Manipulation Functions) This subsection describes the functions that manipulate 64-bit integer operands.
Return Value Math Functions You can manipulate bits in 64-bit operands using the following functions.
Remainder Math Functions i := RTL_And_Int64_(bits, %55555555F); i := RTL_Or_Int64_( bits, %55555555F); i := RTL_Xor_Int64_(bits, %55555555F); ! I = %054541010F ! I = %077557755F ! I = %023016745F Remainder The Remainder function returns the 64-bit integer remainder from the integer division of its parameters. INT(64) PROC RTL_Remainder_Int64_( dividend, divisor ); INT(64) dividend, divisor; ! in TNS only dividend is the 64-bit dividend. divisor is the 64-bit divisor.
Decimal_to_Int Math Functions Decimal_to_Int The Decimal_to_Int functions convert a string of decimal digits represented in ASCII characters to a binary value of type INT, INT(32), or INT(64). These functions are not available in the native CRE library. INT PROC RTL_Decimal_to_Int16_( str, len, result ); STRING .EXT str; ! in INT len; ! in INT .EXT result; ! out TNS only INT PROC RTL_Decimal_to_Int32_( str, len, result ); STRING .EXT str; ! in INT len; ! in INT(32) .
Int_to_Decimal Math Functions INT err; s ':=' "1234"; err := RTL_Decimal_to_Int16_(s, 4, r); ! R = 1234; s ':=' %hB1323334; err := RTL_Decimal_to_Int16_(s, 5, r); ! R = -1234; Int_to_Decimal The Int_to_Decimal functions convert an integer to a character string whose contents represent a decimal number. You can specify the format in which the sign of the number is stored in the character string. These functions are not available in the native CRE library.
Int_to_Decimal Math Functions Return Value The Int_to_Decimal functions return one of the following values: Return Value Meaning 0 The operation was successful. 1 The size of the destination was not large enough to hold the value. Significant digits were truncated. 2 len was invalid. len must be greater than zero and less than or equal to 19. 3 You specified an unsigned DECIMAL result, but the source was a negative number. You need to specify a signed result.
Int_to_Decimal Math Functions Table 7-5. Sign Types Sign_type Sign Storage RTL^Unsigned A sign is not stored. The result is an unsigned string of digits. RTL^Leading^embedded The leftmost bit of the first byte is set to 1 to indicate a negative value. RTL^Leading^separate A “+” or “-” character occupies the first byte. “+” indicates a positive value, “-” indicates a negative value. RTL^Trailing^embedded The leftmost bit of the last byte is set to 1 for a negative value.
Int_to_Decimal Math Functions Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 7- 30
8 String and Memory Block Functions This section describes the string and memory block functions supported by the CRE. The term “white space” in a function description includes spaces, newline characters, horizontal tabs, vertical tabs, and form feeds. String Functions This subsection describes the string functions supported by the TNS CRE. Each function described in this section begins with the prefix RTL_ or CRE_. Refer to Using Standard Functions on page 2-56 for more information. Table 8-1.
String and Memory Block Functions String Functions Table 8-1. TNS CRE String Functions (page 2 of 2) Function Name Function Action Strcat on page 8-16 Concatenates two strings. Strchr on page 8-17 Scans a string for the first occurrence of a specified character. Strcmp on page 8-18 Compares two strings. Strcpy on page 8-19 Copies one string to another. Strcspn on page 8-20 Scans a string until it finds a character that is present in another specified string.
Atoi, Atol, Atof String and Memory Block Functions See the Guardian Native C Library Calls Reference Manual for descriptions of these functions. Table 8-2. Native CRE String Functions Function Name Native CRE Library Function Name strcat Concatenates two strings. strchr Scans a string for the first occurrence of a specified character. strcmp Compares two strings. strcpy Copies one string to another. strcspn Scans a string until it finds a character that is present in another specified string.
Stcarg String and Memory Block Functions Return Value The Atoi, Atol, and Atof functions return the converted value of str. They return zero if the first non-white-space character in str is not a sign character (“+” or “-”), a decimal digit, or, for Atof, a decimal point. Considerations • • • • The Atoi, Atol, and Atof functions skip leading white-space characters in str. The first non-white-space character can be optionally a plus sign or a minus sign.
Stccpy String and Memory Block Functions Return Value The Stcarg functions return the number of bytes scanned at the beginning of str before a character in stop_chars was encountered. If no characters from stop_chars are found in str, the Stcarg functions return the length of str. Considerations • • • The Stcarg functions scan str until any character in stop_chars is found in str or until they encounter a zero (null) byte in str.
Stcd_I String and Memory Block Functions max_bytes specifies the maximum number of bytes to copy. max_bytes must be a positive number. Return Value The Stccpy functions return the number of characters copied from source to dest. Considerations • • source must be terminated by a zero (null) byte to stop the scan. The Stccpy functions terminate dest with a null byte, independent of whether the maximum count or a null byte in source stopped the copy operation. Example INT i; STRING .des[0:7]; STRING .
Stcd_L String and Memory Block Functions Considerations • • • The string to convert can contain an optional sign before the string of digits. The Stcd_I functions do not skip leading white space. The Stcd_I functions stop scanning if they encounter a non-decimal character or a zero (null) byte. Example INT count; STRING .s[0:7] := ["17xy",0]; INT i; count := RTL_Stcd_I_(s, i); ! count gets 2, i gets 17 Stcd_L The Stcd_L functions convert a string of decimal characters to a 32-bit integer.
Stch_I String and Memory Block Functions Example INT count; STRING .s[0:17] := ["128456xq7",0]; INT(32) d; count := RTL_Stcd_L_(s, d); ! count gets 6, d gets 128456 Stch_I The Stch_I functions convert a string of hexadecimal characters to an integer. These functions are not available in the native CRE library. INT PROC RTL_Stch_I_( str, integer ); STRING .str; ! in INT .integer; ! out TNS only INT PROC RTL_Stch_IX_( str, integer ); STRING .EXT str; ! in INT .
Stci_D String and Memory Block Functions Stci_D The Stci_D functions convert a signed integer to a string of decimal characters. These functions are not available in the native CRE library. INT PROC RTL_Stci_D_( str, integer, max_bytes ); STRING .str; ! out INT integer; ! in INT max_bytes; ! in TNS only INT PROC RTL_Stci_DX_( str, STRING .EXT str; INT integer; INT max_bytes; TNS only integer, max_bytes ); ! out ! in ! in str is a pointer to the converted decimal string.
Stcpm String and Memory Block Functions If all digits are not stored, the digits stored are the least significant digits of the converted integer. Integer Negative? Max Bytes Max Digits Stored No N N-1 Yes N N-2 Example INT count; STRING .s[0:7]; INT i := 17; ! count gets 2, s gets ["17",0] count := RTL_Stci_D_(s, i, 8); Stcpm The Stcpm functions scan a string for the first occurrence of a substring that matches a specified pattern. This function is not available in the native CRE library.
Stcpma String and Memory Block Functions Return Value The Stcpm functions return the length of the first matching substring, if a match was found. If a match was not found, the functions returns -1. Considerations • • • The ends of str and pat are defined by the location of a zero (null) byte. You can use a backslash (\) as an escape character if you need to match a special character (?, *, or +). Note that match must be a pointer to a character pointer. Example STRING .
Stcu_D String and Memory Block Functions pat is a pointer to the pattern string. The pattern is specified using regular expression notation: ? matches any character. s* matches zero or more occurrences of s. s+ matches one or more occurrences of s. s matches s. Return Value The Stcpma functions return the length of the matching substring, if found. If a matching substring is not found, they returns -1.
Stpblk String and Memory Block Functions integer is the integer to convert. max_bytes is the number of bytes allocated at str for the conversion. Return Value The Stcu_D functions return the length of the resulting string, excluding the terminating null character. Considerations • • • • • The Stcu_D functions do not produce leading zeros in the output string. If integer is negative, the output string is preceded by a minus sign. str is terminated with a null byte.
Stpsym String and Memory Block Functions Return Value The Stpblk functions return the address of the first non-white-space character in str. Considerations The end of str is defined by the location of a zero (null) byte. Example STRING .s[0:17] := [" STRING .start; Skip Spaces",0]; !@start gets @s[2] @start := RTL_Stpblk_(s); Stpsym The Stpsym functions copy a symbol from one string to another string. A symbol consists of an alphabetic character followed by zero or more alphanumeric characters.
String and Memory Block Functions Stptok Considerations • A symbol consists of an alphabetic character followed by zero or more alphanumeric characters and terminated by a blank character. • • • White space is not skipped. The end of str is defined by the location of a zero (null) byte. To ensure space for a null byte after the symbol, the value you pass in symlen must be at least one greater than the longest symbol that can be scanned. Example STRING .s[0:17] := ["ident1 ident2",0]; STRING .
Strcat String and Memory Block Functions tokenlen specifies the number of bytes allocated in token for the token. Tokens greater than this length are truncated. stop_chars is a pointer to a string that consists of token separator characters; that is, characters that are not part of the token. Return Value The Stptok functions return the address of the next character in str after the token (the delimiter that stopped the scan).
Strchr String and Memory Block Functions second is a pointer to the string that is concatenated to the first string. Return Value The Strcat functions return the address of the resulting string, @first. Considerations • • Both first and second must be terminated by a zero (null) byte to stop the scan. You must ensure that there are enough bytes at the end of first to accommodate the bytes in second. • The Strcat functions append a null byte to the result.
Strcmp String and Memory Block Functions Return Value The Strchr functions return the address of the first occurrence in str of char. If str does not contain char, zero is returned. Considerations str must be terminated by a zero (null) byte to stop the scan. Example STRING .s[0:100] := ["Find me",0]; STRING .char_ptr; ! @char_ptr gets @s[5] @char_ptr := RTL_Strchr_(s, "m"); Strcmp The Strcmp functions compare two strings. INT PROC RTL_Strcmp_( str1, str2 ); STRING .str1; ! in STRING .
Strcpy String and Memory Block Functions • If str1 and str2 have different lengths but match to the end of the shorter string, the shorter string is defined to be less than the longer string. Example INT sign; STRING .s1[0:100] := ["Opus is a penguin",0]; STRING .s2[0:100] := ["Opus is a flightless water fowl",0]; sign := RTL_Strcmp_(s1, s2); ! sign gets a positive number Strcpy The Strcpy functions copy one string to another. INT PROC RTL_Strcpy_( dest, source ); STRING .dest; ! out STRING .
Strcspn String and Memory Block Functions Figure 8-1. Strings in Memory Before Copying Source to Destination source A dest B C D E F G H I J K L VST 801.VSD Figure 8-2. Strings in Memory After Copying Source to Destination source A dest B C D A B C D A B C D VST 802.VSD Example STRING .des[0:10]; STRING .
Strlen String and Memory Block Functions stop_chars is a pointer to a string containing the characters to scan for in str. Return Value The Strcspn functions return the number of bytes scanned at the beginning of str before a character in stop_chars was encountered. If no characters from stop_chars are found in str, the length of str is returned. Considerations Both str and stop_chars must be terminated by a zero (null) byte to stop the scan. Example INT count; STRING .
Strncat String and Memory Block Functions i := RTL_Strlen_(s); ! i gets 7 Strncat The Strncat functions concatenate not more than a specified number of characters from one string to another. INT PROC RTL_Strncat_( first, second, max_bytes ); STRING .first; ! out STRING .second; ! in INT max_bytes; ! in only INT(32) PROC RTL_StrncatX_( STRING .EXT first; STRING .
Strncmp String and Memory Block Functions ! fir gets ["FrontBa",0] @temp := RTL_Strncat_(fir, sec, 2); Strncmp The Strncmp functions compare two strings for a specified maximum number of characters. INT PROC RTL_Strncmp_( str1, str2, max_bytes ); STRING .str1; ! in STRING .str2; ! in INT max_bytes; ! in TNS only INT PROC RTL_StrncmpX_( str1, STRING .EXT str1; ! STRING .EXT str2; ! INT(32) max_bytes; ! TNS only str2, max_bytes ); in in in str1 is a pointer to the first string.
Strncpy String and Memory Block Functions • If max_bytes is greater than the length of both strings and if the two strings have different lengths but match to the end of the shorter string, the shorter string is defined to be less than the longer string. Example INT sign; STRING .s1[0:100] := ["Opus is a penguin",0]; STRING .
Strpbrk String and Memory Block Functions • • If the length of source is greater than max_bytes, the functions do not store a null character. The Strncpy functions copy bytes from source to dest until max_bytes have been copied or a null byte is encountered in source: ° If max_bytes are copied without encountering a null byte in source, does a null byte is not stored in dest.
Strrchr String and Memory Block Functions Example STRING .s[0:100] := ["800-555-1212",0]; STRING .tar[0:100] := [" -;,.",0]; STRING .char_ptr; ! @char_ptr gets @s[3] @char_ptr := RTL_Strpbrk_(s, tar); Strrchr The Strrchr functions scan a string backwards for the last occurrence of a specified character. INT PROC RTL_Strrchr_( str, char ); STRING .str; ! in INT char; ! in TNS only INT(32) PROC RTL_StrrchrX_( str, char ); STRING .
Strspn String and Memory Block Functions Strspn The Strspn functions scan a string until they find a character in the string that does not appear in a second string. INT PROC RTL_Strspn_( str, span_chars ); STRING .str; ! in STRING .span_chars; ! in TNS only INT(32) PROC RTL_StrspnX_( str, span_chars ); STRING .EXT str; ! in STRING .EXT span_chars; ! in TNS only str is a pointer to the string to scan. span_chars is a pointer to the string containing the characters to scan for in str.
Strtod String and Memory Block Functions str is a pointer to the string to scan. substr is a pointer to the substring to scan for in str. Return Value The Strstr functions return: • • The address of substring within str if substr is found. Zero if substr is not found within str. Considerations Both str and substr must be terminated by a zero (null) byte to stop the scan. Example STRING .s[0:17] := ["FORTUNE 500",0]; STRING .subs[0:4] := ["500",0]; STRING .
Strtol String and Memory Block Functions Considerations • • • • str must be terminated by a zero (null) byte to stop the scan. Leading white space is skipped. str is a string of digits, optionally preceded by a sign. The functions stop scanning if they encounter an unrecognized character. Example STRING .s[0:7] := ["52431",0]; STRING .scanend; REAL(64) d; ! d gets 52431.
Strtoul String and Memory Block Functions • • If base is greater than 1 and less than or equal to 36, it specifies the radix of the string of characters at str. For values of base greater than 10, the letter A represents 10, the letter B represents 11, and so forth, through the letter Z which represents 35. Strtol treats uppercase and lowercase alphabetic characters in str interchangeably. If base is less than 0, equal to 1, or greater than 36, the Strtol functions do not convert str.
String and Memory Block Functions Strtoul end_scan is the address within str where the conversion ended. The pointer returned through end_scan points to the character immediately after the last converted character. base specifies the radix of the digits at str. It must be in the range: 0 less than or equal base less than or equal to 36 • • • If base is zero, the leading characters of str determine the radix: ° ° ° 0X or 0x indicates a hexadecimal number. 0 indicates an octal number.
String and Memory Block Functions Substring_Search Substring_Search The Substring_Search function determines whether one string is a substring of another string. This function is not available in the native CRE library. INT PROC RTL_Substring_Search_( substr, substr_len str, str_len ); STRING .EXT substr; ! in INT substr_len; ! in STRING .EXT str; ! in INT str_len; ! in TNS only substr is a pointer to the substring to scan for in str. substr_len is the length of substr in bytes.
Memory Block Functions String and Memory Block Functions Memory Block Functions This subsection describes the memory block functions. Table 8-3 lists the memory block functions supported by the TNS CRE. Each function described in this section begins with the prefix RTL_ or CRE_. Refer to Using Standard Functions on page 2-56 for more information. Table 8-3. TNS CRE Memory Block Functions Standard Function Name Function Action memchr Searches for a character in a block of memory.
String and Memory Block Functions Memory_Compare Memory_Compare The Memory_Compare functions compare two blocks of memory. These functions are not available in the native CRE library. INT PROC RTL_Memory_Compare_( buf1, buf2, num_bytes ); STRING .buf1; ! in STRING .buf2; ! in INT num_bytes; ! in TNS only INT PROC RTL_Memory_CompareX_( buf1, buf2, num_bytes ); STRING .EXT buf1; ! in STRING .EXT buf2; ! in INT(32) num_bytes; ! in TNS only buf1 is a pointer to the first block of memory.
String and Memory Block Functions Memory_Copy Memory_Copy The Memory_Copy functions copy a block of memory. These functions are not available in the native CRE library. INT PROC RTL_Memory_Copy_( dest, source, num_bytes ); STRING .dest; ! out STRING .source; ! in INT num_bytes; ! in TNS only INT(32) PROC RTL_Memory_CopyX_( dest, source, num_bytes ); STRING .EXT dest; ! out STRING .EXT source; ! in INT(32) num_bytes; ! in TNS only dest is a pointer to the destination to which the block is copied.
String and Memory Block Functions Memory_Findchar Memory_Findchar The Memory_Findchar functions search for a character in a block of memory. These functions are not available in the native CRE library. INT PROC RTL_Memory_Findchar_( buf, char, num_bytes ); STRING .buf; ! in INT char; ! in INT num_bytes; ! in TNS only INT(32) PROC RTL_Memory_FindcharX_( buf, char, num_bytes ); STRING .EXT buf; ! in INT char; ! in INT(32) num_bytes; ! in TNS only buf is a pointer to the block of memory to search.
String and Memory Block Functions Memory_Move Memory_Move The Memory_Move functions move a block of memory. These functions are not available in the native CRE library. INT PROC RTL_Memory_Move_( dest, source, num_bytes ); STRING .dest; ! out STRING .source; ! in INT num_bytes; ! in TNS only INT(32) PROC RTL_Memory_MoveX_( dest, source, num_bytes ); STRING .EXT dest; ! out STRING .EXT source; ! in INT(32) num_bytes; ! in TNS only dest is a pointer to the destination to which the block is moved.
Memory_Repeat String and Memory Block Functions Memory_Repeat The Memory_Repeat procedures fill a block of memory with a block of values a specified number of times. These functions are not available in the native CRE library. PROC RTL_Memory_Repeat_(dest, STRING .dest; ! STRING .values; ! INT values_len; ! INT num_rep; ! only values, values_len, num_rep ); out in in in TNS PROC RTL_Memory_RepeatX_(dest, values, values_len, num_rep); STRING .EXT dest; ! out STRING .
String and Memory Block Functions Memory_Set Memory_Set The Memory_Set functions initialize a block of memory to a specified character. These functions are not available in the native CRE library. INT PROC RTL_Memory_Set_( buf, char, num_bytes ); STRING .buf; ! out INT char; ! in INT num_bytes; ! in only TNS INT(32) PROC RTL_Memory_SetX_( buf, char, num_bytes ); STRING .EXT buf; ! out INT char; ! in INT(32) num_bytes; ! in TNS only buf is a pointer to the block to initialize.
Memory_Swap String and Memory Block Functions Memory_Swap The Memory_Swap functions exchange one block of memory with a second block of memory. These functions are not available in the native CRE library. PROC RTL_Memory_Swap_( buf1, buf2, num_bytes ); STRING .buf1; ! in/out STRING .buf2; ! in/out INT num_bytes; ! in only PROC RTL_Memory_SwapX_( buf1, STRING .EXT buf1; ! STRING .
9 Common Language Utility (CLU) Library Functions This section presents a set of Common Language Utility (CLU) library functions provided in the CRE.
Common Language Utility (CLU) Library Functions CLU_Process_Create_ The function declaration is presented first, followed by COBOL and FORTRAN considerations.
Common Language Utility (CLU) Library Functions CLU_Process_Create_ clu_options if present, specifies function options. The bits in clu_options are defined as follows: Bits in clu_options Meaning 12 PROCESS_STOP option: 0: If PROCESS_CREATE_ returns 14 (undefined externals), stop the created process and return 14 as the function value. 1: If PROCESS_CREATE_ returns 14 (undefined externals), consider process creation successful. Unless a failure occurs in a later step, return 14 as the function value.
Common Language Utility (CLU) Library Functions Return Value Return Value CLU_Process_Create_ returns one of the following values: Return Value Meaning -4 A file management error occurred due to failure of FILE_OPEN or WRITEREAD [X]; the error value is returned in error_detail. -3 A Startup message cannot be made because the IN file, OUT file, or default volume name cannot be edited into the corresponding message field (this can occur if the name cannot be converted to network form).
Common Language Utility (CLU) Library Functions COBOL Considerations program-file is an alphanumeric operand containing a string value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. The compiler implicitly computes and transmits the size, in bytes, of program-file to the function. If a string value does not completely fill its operand, the first unused character must be a blank (space character).
Common Language Utility (CLU) Library Functions COBOL Considerations processor is an actual parameter that evaluates to a numerica1 value appropriate for the PROCESS_CREATE_ parameter to which it corresponds, such as a COMPUTATIONAL, DISPLAY, or NATIVE numeric data item, a numeric literal, or an expression enclosed in parentheses. If the parameter does not mathematically evaluate to an integer, the compiler changes the result into an integer value.
Common Language Utility (CLU) Library Functions COBOL Considerations process-descr-bytes is a NATIVE-2 data item or a COMPUTATIONAL numeric data item described with one to four 9s preceded by an S; for example: PICTURE S9(4) nowait-tag is an actual parameter that evaluates to a numerica1 value appropriate for the PROCESS_CREATE_ parameter to which it corresponds, such as a COMPUTATIONAL, DISPLAY, or NATIVE numeric data item, a numeric literal, or an expression enclosed in parentheses.
Common Language Utility (CLU) Library Functions FORTRAN Considerations defines is an alphanumeric operand containing a string value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. The compiler implicitly computes and transmits the size, in bytes, of defines to the function. If a string value does not completely fill its operand, the first unused character must be a blank (space character).
Common Language Utility (CLU) Library Functions FORTRAN Considerations result is a 2-byte integer variable (INTEGER*2). cluoptions is an integer expression that evaluates to a numeric value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. programfile is a character operand containing a string value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. The compiler implicitly computes and transmits the size, in bytes, of programfile to the function.
Common Language Utility (CLU) Library Functions FORTRAN Considerations priority is an integer expression that evaluates to a numeric value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. processor is an integer expression that evaluates to a numeric value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. processhandle is a 2-byte integer array with at least ten elements; for example: INTEGER*2 PROCESSHANDLE (10).
Common Language Utility (CLU) Library Functions FORTRAN Considerations hometerm is a character operand containing a string value appropriate for the PROCESS_CREATE_ parameter to which it corresponds. The compiler implicitly computes and transmits the size, in bytes, of hometerm to the function. If a string value does not completely fill its operand, the first unused character must be a blank (space character).
CLU_Process_File_Name_ Common Language Utility (CLU) Library Functions CLU_Process_File_Name_ The CLU_Process_File_Name_ function processes COBOL and FORTRAN file connectors. The native CRE does not support this function. You can use this function either in the TNS CRE or in a COBOL or FORTRAN run-time environment. The function declaration is presented first, followed by COBOL and FORTRAN considerations.
Common Language Utility (CLU) Library Functions CLU_Process_File_Name_ tdm_file_name • If call_type is 0, tdm_file_name is a variable to contain the retrieved Guardian file name of the located FCB. The retrieved file name is in external format; for example, $A.B.C or =XYZ. If the variable is larger than the file name, the function left-justifies the name and fills the remainder of the variable with space characters.
Common Language Utility (CLU) Library Functions Return Value open_flag If call_type is 0, open_flag is a variable to contain the retrieved open mode value of the FCB. The retrieved value is one of the following: 0 Closed The FCB is not in an open mode. 1 Locked The FCB is not in an open mode. A COBOL variant of Closed. 2 Input The FCB is open for input operations. 4 Output The FCB is open for output operations. 5 Extend The FCB is open for output operations. A COBOL variant of Output.
Common Language Utility (CLU) Library Functions COBOL Considerations COBOL Considerations You can use CLU_Process_File_Name_ for programs that run in the TNS CRE or in a COBOL run-time environment. The COBOL format for invoking this function is: ENTER [ TAL ] "CLU_Process_File_Name_" [ OF library-reference ] USING call-type, fcb-address, tdm-file-name, file-name, open-flag [ GIVING result ] TAL Generates more efficient code.
Common Language Utility (CLU) Library Functions FORTRAN Considerations file-name If call-type is 0, file-name is an alphanumeric data item to contain the retrieved logical file name. If call-type is 1, file-name is ignored. The compiler implicitly computes and transmits the size, in bytes, of file-name to the function. open-flag is a NATIVE-2 data item or a COMPUTATIONAL numeric data item described with one to four 9s preceded by an S; for example: PICTURE S9(9) result is a numeric data item.
Common Language Utility (CLU) Library Functions SMU Functions fcbaddress is a 4-byte integer variable (INTEGER*4). tdmfilename If calltype is 0, tdmfilename is a character variable to contain the retrieved Guardian file name. If calltype is 1, tdmfilename is a character value that supplies a Guardian file name. The compiler implicitly computes and transmits the size, in bytes, of tdmfilename to the function.
Common Language Utility (CLU) Library Functions SMU_Assign_CheckName_ Table 9-1. SMU Functions Name Action SMU_Assign_CheckName_ on page 9-18 Checks whether an ASSIGN message with a given logical file name exists. SMU_Assign_Delete_ on page 9-19 Deletes a portion or all of an ASSIGN message. SMU_Assign_GetText_ on page 9-21 Retrieves a portion of an ASSIGN message as text and assigns it to a string variable.
Common Language Utility (CLU) Library Functions SMU_Assign_Delete_ name is a logical file name of an ASSIGN message. If name includes a program name, name must have one of the following forms (maximum 63 characters): programname.filename *.filename If name does not include a program name, name must have the following form (maximum 31 characters): filename name_bytes is the size of name, in bytes, and must have a value greater than 0.
Common Language Utility (CLU) Library Functions SMU_Assign_Delete_ message_number is an integer expression that identifies an ASSIGN message. message_number must be a value greater than 0. portion is the identifier of an ASSIGN message integer part to delete.
Common Language Utility (CLU) Library Functions SMU_Assign_GetText_ SMU_Assign_GetText_ The SMU_Assign_GetText_ function retrieves a part of an ASSIGN message as text and assigns it to a string variable. INT PROC SMU_Assign_GetText_( message_number, portion:portion_bytes, text:max_text_bytes ) EXTENSIBLE; INT message_number; ! in, required STRING .EXT portion; ! in, required INT portion_bytes; ! in, required STRING .
Common Language Utility (CLU) Library Functions SMU_Assign_GetValue_ max_text_bytes is the maximum size of text, in bytes, and must be a non-negative value. For TAL, you must supply this value if text is present; for COBOL and FORTRAN, the compiler implicitly computes and transmits this value to the function. Return Value SMU_Assign_GetText_ returns one of the following values: Return Value Meaning 0 The operation is successful. The retrieved Tandem file name is all blanks.
Common Language Utility (CLU) Library Functions FILECODE File code PRIEXT Primary extent size RECSIZE Record size SECEXT Secondary extent size SMU_Assign_PutText_ portion_bytes is the size of portion, in bytes, and must be a value greater than 0. For TAL, you must supply this value; for COBOL and FORTRAN, the compiler implicitly computes and transmits this value to the function.
Common Language Utility (CLU) Library Functions SMU_Assign_PutText_ message_number is an integer expression that identifies the ASSIGN message in which to replace text. message_number must be a value greater than 0. portion is the identifier of a message part. portion is one of: LOGICALNAME Creates or replaces the logical file name. TANDEMNAME Creates or replaces the Guardian file name. portion_bytes is the size of portion, in bytes, and must be a value greater than 0.
Common Language Utility (CLU) Library Functions SMU_Assign_PutValue_ Return Value: • SMU_Assign_PutText_ returns one of the following values: Return Value 0 Meaning The operation is successful. text contains a null string. >0 The operation is successful. The return value gives the length, in bytes, of the assigned text after blank truncation. -1 The operation failed because of a logic error, such as: • • • • message_number, portion_bytes, or text_bytes has an invalid value.
Common Language Utility (CLU) Library Functions SMU_Message_CheckNumber_ EXCLUSION Exclusion mode—0 for shared, 1 for protected, and 3 for exclusive FILECODE File code PRIEXT Primary extent size RECSIZE Record size SECEXT Secondary extent size portion_bytes is the size of portion, in bytes, and must be a value greater than 0. For TAL, you must supply this value; for COBOL and FORTRAN, the compiler implicitly computes and transmits this value to the function.
Common Language Utility (CLU) Library Functions SMU_Param_Delete_ message_number is an integer expression that identifies the message to check.
Common Language Utility (CLU) Library Functions SMU_Param_GetText_ Return Value SMU_Param_Delete_ returns one of the following values: Return Value Meaning 0 The operation is successful. -1 The operation failed because portion-bytes has an invalid value. -2 The operation failed because making changes would invalidate the backup process. SMU_Param_GetText_ The SMU_Param_GetText_ function obtains a part of the PARAM message as text and assigns it to a string variable.
Common Language Utility (CLU) Library Functions SMU_Param_PutText_ max_text_bytes is the maximum size of text, in bytes, and must be a non-negative value. For TAL, you must supply this value, if text is present; for COBOL and FORTRAN, the compiler implicitly computes and transmits this value to the function. Return Value SMU_Param_GetText_ returns one of the following values: Return Value Meaning >0 The operation is successful.
Common Language Utility (CLU) Library Functions SMU_Startup_Delete_ text_bytes is the size of text, in bytes, and must be a non-negative value. For TAL, you must supply this value, if text is present; for COBOL and FORTRAN, the compiler implicitly computes and transmits this value to the function. If the specified parameter name exists, the function assigns text as the associated parameter value.
Common Language Utility (CLU) Library Functions SMU_Startup_GetText_ portion_bytes is the size of portion, in bytes, and must be a value greater than 0. For TAL, you must supply this value; for COBOL and FORTRAN, the compiler implicitly computes and transmits this value to the function. If portion_bytes exceeds the number of characters in portion, the first unused character of portion must be a space character.
Common Language Utility (CLU) Library Functions VOLUME SMU_Startup_GetText_ Retrieves the default volume part. If it includes a system name, the text appears as follows (maximum 25 characters): \system.$volume.subvolume If it omits a system name, the text appears as follows (maximum 17 characters): $volume.subvolume *ALL* Retrieves the entire startup message as a string (a sequence of bytes). portion_bytes is the size of portion, in bytes, and must be a value greater than 0.
Common Language Utility (CLU) Library Functions SMU_Startup_PutText_ SMU_Startup_PutText_ The SMU_Startup_PutText_ function creates or replaces a part of the startup message with text obtained from a string variable. INT PROC SMU_Startup_PutText_( portion:portion_bytes, text:text_bytes ) EXTENSIBLE; STRING .EXT portion; ! in, required INT portion_bytes; ! in, required STRING .
Common Language Utility (CLU) Library Functions VOLUME SMU Function Considerations The text is the new default volume part. If it includes a system name, the text must have the following format (maximum 25 characters): \system.$volume.subvolume If it does not include a system name, the text must have the following format (maximum 17 characters): $volume.subvolume text_bytes is the size of text, in bytes, and must be a non-negative value.
Common Language Utility (CLU) Library Functions COBOL Considerations COBOL Considerations You can use the SMU functions in the TNS CRE, in a COBOL run-time environment, or in the native CRE. Rules for using the pre-D20 SMU functions (and the ENV directive) are given in the COBOL Manual for TNS and TNS/R Programs. The current SMU functions in this section differ from the pre-D20 SMU functions only in minor ways. These differences are described in the following paragraphs.
COBOL Considerations Common Language Utility (CLU) Library Functions value is a NATIVE-2 data item or a COMPUTATIONAL numeric data item described with one-to-four 9s preceded by an S; for example: PICTURE S9(4) message_number is any actual COBOL parameter that evaluates to a number in the range -32768 through 32767, as permitted by a particular function. message_number can be a COMPUTATIONAL, DISPLAY, or NATIVE numeric data item, a numeric literal, or an expression enclosed in parentheses.
FORTRAN Considerations Common Language Utility (CLU) Library Functions ENTER "PutAssignValue" USING portion, value, cplist, message-number ENTER TAL "SMU_Param_Delete_" USING portion ENTER "DeleteParam" USING portion, cplist GIVING result GIVING result GIVING result ENTER TAL "SMU_Param_GetText_" USING portion, text GIVING result ENTER "GetParamText" USING portion, text GIVING result ENTER TAL "SMU_Param_PutText_" USING portion, text ENTER "PutParamText" USING portion, text, cplist GIVING result GIVING
Common Language Utility (CLU) Library Functions FORTRAN Considerations You invoke the current SMU functions as follows: result = functionname ( parameter [ , parameter ] ... ) result is an integer variable as described in the FORTRAN Reference Manual for the old SMU functions. functionname is the name of a current SMU function. parameter is one of the SMU function parameters in this section. (The cplist parameter of pre-D20 SMU functions is not a part of the new SMU functions.
Common Language Utility (CLU) Library Functions TAL Considerations result = SMU_Assign_GetValue_ (messagenumber, portion, value) result = GetAssignValue (portion, value, messagenumber) result = SMU_Assign_PutText_ (messagenumber, portion, text) result = PutAssignText (portion, text, cplist, messagenumber) result = SMU_Assign_PutValue_ (messagenumber, portion, value) result = PutAssignValue (portion, value, cplist, messagenumber) result = SMU_Param_Delete_ (portion) result = DeleteParam (portion, cplist) r
Common Language Utility (CLU) Library Functions pTAL Considerations The file CLURDECS, which is usually in the $SYSTEM.SYSTEM subvolume, contains the current SMU function declarations. All other usage considerations applicable to EpTAL are included in the function descriptions in this section.
10 Run-Time Diagnostic Messages This section lists in numerical order the run-time diagnostic messages that you can see in your log file when you run a program that uses the Common Run-Time Environment (CRE).
Format of Messages in This Section Run-Time Diagnostic Messages • Spooler Programmer’s Guide For messages that the CRE reports on behalf of routines that call it, the descriptions are less precise because the effect on your program and possible recovery actions are language and application dependent. For more information on errors that are reported by individual languages, refer to the language reference manual for the routine that caused the error.
Trap and Signal Messages Run-Time Diagnostic Messages bottom_of_stack shows the name of the first procedure—the main procedure—of the process in which the error occurred, the offset within the procedure, and the number of the code segment in which procedure’s code is located. The stack trace includes all procedures between top_of_stack and bottom_of_stack.
Run-Time Diagnostic Messages Trap and Signal Messages manuals for the routines in your program for additional detail. The Guardian Programmer’s Guide describes traps and signals. 1 Unknown trap The CRE trap processing function was called with an unknown trap number. 2 Illegal address reference An address was specified that was not within either the virtual code area or the virtual data area allocated to the process.
Run-Time Diagnostic Messages • Trap and Signal Messages There was not enough remaining virtual data space for a system procedure to execute. • The native environment exceeded the maximum stack space available. The amount of virtual data space available is G[0] through G[32767]. System procedures require approximately 350 words of user-data stack space to execute. 6 Process loop-timer timeout The new time limit specified in the latest call to SETLOOPTIMER has expired.
Run-Time Diagnostic Messages CRE Service Function Messages CRE Service Function Messages The CRE writes the messages in this subsection if an error occurs during its own processing or if it receives a request from a run-time library to report a specific message. 11 Corrupted environment Cause. CRE or run-time library data is invalid. Effect. The CRE invokes PROCESS_STOP_, specifying the ABEND variant and the text “Corrupted environment.” Recovery.
Run-Time Diagnostic Messages CRE Service Function Messages 13 MCB pointer corrupt Cause. The pointer at location G[0] of the program’s user data segment to its primary data structure—the Master Control Block (MCB)—does not point to the MCB. Both the CRE and run-time libraries can report this error. In the native environment, this error can occur if the MCB run-time data structure has been corrupted. Effect. The CRE attempts to restore the pointer at G[0] and to write a message to the standard log file.
Run-Time Diagnostic Messages CRE Service Function Messages list. Use a symbolic debugger appropriate for the type of code to help isolate the problem. 16 Checkpoint list exhausted Cause. The CRE did not have enough room to store all of the checkpoint information required by the program. Effect. Program behavior is language and application dependent. Recovery. Increase the checkpoint list object’s size. See the language manual for the routine that allocates your checkpoint list.
Run-Time Diagnostic Messages CRE Service Function Messages Recovery. Check that the file names in the program are valid Guardian file names. 21 Cannot read initialization messages ( error ) Cause. During program initialization, the CRE could not read all of the messages (start-up message, PARAM message, ASSIGN messages, and so forth) it expected from the file system. error is the file-system error number the CRE received when it couldn’t read an initialization message. Effect.
Run-Time Diagnostic Messages CRE Service Function Messages 24 Conflict in application of ASSIGN program_name.logical_name Cause. ASSIGN values in your TACL environment conflict with each other. For example: ASSIGN A, $B1.C.D ASSIGN *.A, $B2.C.D The first ASSIGN specifies that the logical name A can appear in no more than one program file. The second assign specifies that the name A can appear in an arbitrary number of program files. The CRE cannot determine whether to use the file C.
Run-Time Diagnostic Messages CRE Service Function Messages Effect. The CRE terminates the program. Recovery. Modify the PARAM text and rerun your program. See the HP Tandem Advanced Command Language (TACL) Reference Manual for more information on using PARAMs. 27 Ambiguity in application of PARAM PARAM name 'value' Cause. A PARAM specifies a value that is ambiguous in the current context.
Run-Time Diagnostic Messages Heap-Management Messages Heap-Management Messages The CRE or run-time libraries report the messages in this subsection if they detect an error while accessing the heap. 30 Unknown heap error Cause. A heap-management routine was called with an invalid error number. Effect. The CRE terminates the program. Recovery. Refer to the reference manual that corresponds to the language in which the routine that requests heap space is written.
Run-Time Diagnostic Messages Heap-Management Messages memory model, the heap is allocated in the lower 32K words of the user data segment. In a large memory model, the heap is allocated in an extended memory segment. Check the program’s logic. Use Inspect or Visual Inspect to help isolate the problem or consult your system administrator. If this error occurs in the native environment, use Native Inspect or Visual Inspect to help isolate the problem.
Run-Time Diagnostic Messages Function Parameter Message 36 Invalid operation for heap Cause. The request you made is not compatible with the heap that you referenced. Effect. Program behavior is language and application dependent. Recovery. Consult your system administrator. 37 Mark address or space corrupt Cause. An address passed as a heap marker does not point to a mark. Effect. Program behavior is language and application dependent. Recovery.
Run-Time Diagnostic Messages Math Function Messages Math Function Messages Run-time libraries report the messages in this subsection if an error is detected in a math function. 41 Range fault Cause. An arithmetic overflow or underflow occurred while evaluating an arithmetic function. Effect. Program behavior is language and application dependent. Recovery. Modify the program to pass values to the arithmetic functions that do not cause overflow. 42 Arccos domain fault Cause.
Run-Time Diagnostic Messages Math Function Messages 46 Logarithm function domain fault Cause. The parameter passed to a logarithm function was less than or equal to zero. The parameter to a logarithm function must be greater than zero. Effect. Program behavior is language and application dependent. Recovery. Modify the program to pass a valid value to the logarithm function. 47 Modulo function domain fault Cause. The value of the second parameter to a modulo function was zero.
Run-Time Diagnostic Messages Function Parameter Messages Function Parameter Messages The CRE or run-time libraries report the messages in this subsection if there is a problem with the parameters passed to a function. 55 Missing or invalid parameter Cause. A required parameter is missing or too many parameters were passed. Effect. Program behavior depends on the function that was called and the language in which it is written. Recovery. Correct the program to pass a valid parameter.
Run-Time Diagnostic Messages Input/Output Messages Input/Output Messages The CRE or run-time libraries report the messages in this subsection if an error occurs when calling an I/O function. 59 Standard input file error ( error ) Unable to open Cause. The file system reported an error when a routine tried to access the standard input file. error is a file-system error number.
Run-Time Diagnostic Messages Input/Output Messages this manual and in the language manual for the routine in your program that detected the error. If the error was caused by a write request from the CRE, consult your system administrator. If the error was caused during program initialization, specify an acceptable output file when executing your program. 61 Standard log file error ( error ) Unable to open filename Cause.
Run-Time Diagnostic Messages Input/Output Messages 64 File not open Cause. A request to open a file failed because the file device is not supported. Effect. Program behavior is language and application dependent. Recovery. Consult your system administrator. 65 Invalid attribute value Cause. A parameter to an open operation was not a meaningful value. For example, the CRE_File_Open_ sync_receive_depth parameter must be a nonnegative number.
Run-Time Diagnostic Messages Input/Output Messages 68 Nowait value not accepted Cause. The value of the no_wait parameter to an open operation was not valid in the context in which it was used. For example, it is invalid to specify a nonzero value for no_wait for a device that does not support nowait operations. Effect. Program behavior is language and application dependent. Recovery. Consult your system administrator. 69 Syncdepth not accepted Cause.
Run-Time Diagnostic Messages Input/Output Messages 75 Cannot obtain buffer space Cause. A routine was not able to obtain buffer space. Effect. Program behavior is language and application dependent. Recovery. Program recovery is language and application dependent. 76 Invalid external filename ( error ) Cause. A value that was expected to be a Guardian external file name is not in the correct format. Effect. Program behavior is language and application dependent. Recovery.
Run-Time Diagnostic Messages Input/Output Messages 79 OpenEdit failed ( error ) Cause. A call to OPENEDIT_ failed. error, if present, is the error returned by OPENEDIT_. A negative number is a format error. A positive number is a file-system error number. Effect. Program behavior is language and application dependent. Recovery. See the Guardian Procedure Calls Reference Manual for more information. 80 Spooler initialization failed ( error ) Cause.
Run-Time Diagnostic Messages Input/Output Messages 83 Operation incompatible with file type or status (error) Cause. The program attempted an operation on a file whose type or current status is unsuitable for execution of that operation. For example, a COBOL program calls a file manipulation utility for a file that is using Fast I/O. (error), if present, is a file-system error number. Effect. Program behavior is language and application dependent. Recovery.
Run-Time Diagnostic Messages COBOL Messages COBOL Messages See the appropriate manual for the compiler for a description of the messages produced and for more information on CRE error handling for COBOL: • • COBOL Manual for TNS and TNS/R Programs COBOL Manual for TNS/E Programs FORTRAN Messages The FORTRAN run-time library reports messages if an error occurs while a FORTRAN module is running.
Mapping Message Numbers Between Run-Time Environments Run-Time Diagnostic Messages Mapping Message Numbers Between Run-Time Environments The tables in this subsection show the correspondence between the message numbers written to standard log when a program runs in language-specific run-time environment to when a program runs in the CRE. The text in the column titled “Original Message Text” shows the message text emitted by the original language-specific run-time libraries. Table 10-1.
Run-Time Diagnostic Messages Mapping Message Numbers Between Run-Time Environments Table 10-2.
Run-Time Diagnostic Messages Mapping Message Numbers Between Run-Time Environments Table 10-2.
Run-Time Diagnostic Messages Mapping Message Numbers Between Run-Time Environments Table 10-2.
Run-Time Diagnostic Messages Mapping Message Numbers Between Run-Time Environments Table 10-2.
Mapping Message Numbers Between Run-Time Environments Run-Time Diagnostic Messages Table 10-2. COBOL85 Message Mapping (page 6 of 6) COBOL85 Message Number CRE Message Number Original Message Text 128 83 Operation incompatible with the file type or status (error) 129 83 Operation incompatible with file type or status 130 40 Invalid function parameter 131 11 or 13 Corrupted environment Table 10-3.
Run-Time Diagnostic Messages Mapping Message Numbers Between Run-Time Environments Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 10 -32
A Data Type Correspondence The following tables contain the return value size generated by HP language compilers for each data type. Use this information when you need to specify values with the Accelerator ReturnValSize option. These tables are also useful if your programs use data from files created by programs in another language, or your programs pass parameters to programs written in callable languages.
Data Type Correspondence Table A-1. Integer Types, Part 1 (page 2 of 2) Language 8-Bit Integer 16-Bit Integer 32-Bit Integer SQL CHAR NUMERIC(1)… NUMERIC(4) NUMERIC(5)… NUMERIC(9) PIC 9(1) COMP… PIC 9(4) COMP PIC 9(1) COMP …PIC 9(9) COMP SMALLINT INTEGER INT(32) TAL STRING INT pTAL UNSIGNED(8) INT(16) UNSIGNED(16) Return Value Size (Words) 1 1 2 1. Unsigned Integer. 2. Index Data Item is a 16-bit integer in COBOL 74 and a 32-bit integer in HP COBOL. 3. HP COBOL only. 4.
Data Type Correspondence Table A-2.
Data Type Correspondence Table A-3.
Data Type Correspondence Table A-4. Character Types Language Character Character String Varying Length Character String BASIC STRING STRING -- C signed char unsigned char pointer to char struct { int len; char val [n] }; COBOL Alphabetic Numeric DISPLAY Alphanumeric-Edited Alphanumeric Numeric-Edited Alphabetic Numeric DISPLAY Alphanumeric-Edited Alphanumeric Numeric-Edited 01 name. 03 len USAGE IS NATIVE-21 03 val PIC X(n).
Data Type Correspondence Table A-5.
Data Type Correspondence Table A-6.
Data Type Correspondence Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 A- 8
Glossary accelerate. To speed up emulated execution of a TNS object file by applying the Accelerator on TNS/R systems or the Object Code Accelerator (OCA) on TNS/E systems before running the object file. accelerated mode. See TNS accelerated mode. accelerated object code.
binding Glossary binding. The operation of collecting, connecting, and relocating code and data blocks from one or more separately compiled TNS object files to produce a target object file. breakpoint. An object code location at which execution will be suspended so that you can interactively examine and modify the process state. With symbolic debuggers, breakpoints are usually at source line or statement boundaries.
CRE Glossary CRE. See Common Run-Time Environment (CRE) CREDECS. A file, provided by the TNS CRE, that contains external declarations for CRELIB functions whose names begin with CRE_. CRERDECS. A file, provided by the native CRE, that contains external declarations for CRE function, data, and data structure declarations in pTAL. DEFINE command. A TACL command that lets you specify a named set of attributes and values to pass to a process. eld utility.
global data Glossary • • Subvolume name File ID global data. Data declarations that appear before the first procedure declaration; identifiers that are accessible to all compilations units in a binding session. Guardian. An environment or API available for interactive or programmatic use with the NonStop operating system.
local data Glossary local data. Data that you declare within a procedure; identifiers that are accessible only from within that procedure. lower 32K-word area. The lower half of the user data segment. The global, local, and sublocal storage areas. main routine. The first routine to execute when a program is run. The main routine determines the run-time environment for a program. It is the routine declared with the MAIN or PROGRAM keyword. Master Control Block (MCB). A structure that holds CRE data. MCB.
native-mode library Glossary native-mode library. A native-compiled loadfile associated with one or more other nativecompiled loadfiles. A native-mode process can have any number of associated nativemode libraries. See also TNS user library, TNS/R native user library, and TNS/E library. native-mode source code. High-level language routines that can be compiled with either TNS/R native compilers or TNS/E native compilers. These two sets of compilers accept the same language dialects. native object code.
OCA-accelerated object file Glossary OCA-accelerated object file. A TNS object file that has been augmented by the TNS Object Code Accelerator (OCA) with equivalent but faster Itanium instructions. An OCA-accelerated object file contains the original TNS object code, the OCAaccelerated object code and related address map tables, and any Binder and symbol information from the original TNS object file.
pTAL compiler Glossary language excludes architecture-specific TAL constructs and includes new constructs that replace the architecture-specific constructs. Contrast with TAL. pTAL compiler. An optimizing native-mode compiler for the pTAL language. public dynamic-link library (public DLL). Optional native-mode executable code modules available to all native user processes. A TNS/E public library that is specified in the public library registry, supplied by HP or, optionally, a user.
Saved Message Utility Glossary set and the process terminates abnormally. Other debuggers can create a save file but refer to the result as a process snapshot file. See also process snapshot file. Saved Message Utility. See SMU functions shared file. A standard file that your program can open multiple times. Each time your program opens the file, it is granted a connection to the same Guardian file open. Shared files are managed by the CRE.
standard output Glossary standard output. A file to which a program can write sequential records. The program defines how standard output is used according to the needs of the application. Standard output is analogous to the file STDOUT in C. sublocal data. Data that you declare within a subprocedure; identifiers that are accessible only from within that subprocedure. system procedure. A procedure supplied as part of the operating system. TAL. See Transaction Application Language (TAL) TNS.
TNS fixup Glossary emulation software includes the TNS Object Code Interpreter (OCI), the TNS Object Code Accelerator (OCA), and various millicode libraries. On a TNS/R system, the TNS emulation software includes the TNS Object Code Interpreter (OCI), the Accelerator, and various millicode libraries. TNS fixup. A task performed at process startup time when executing a TNS object file.
TNS procedure label Glossary the TNS Object Code Accelerator (OCA) to produce to produce accelerated object files. A TNS object file can be run on TNS, TNS/R, and TNS/E systems. TNS procedure label. A 16-bit identifier for an internal or external procedure used by the TNS object code of a TNS process. The most-significant 7 bits are a TNS code segment identifier: 2 bits for the TNS code space and 5 bits for the TNS code segment index.
TNS/E native compiler Glossary TNS/E native compiler. A compiler in the TNS/E development environment that generates TNS/E native object code, following the TNS/E native-mode conventions for memory, stack, registers, and call linkage. The TNS/E native C compiler is an example of such a compiler. Contrast with TNS compiler and TNS/R native compiler. TNS/E native mode.
Glossary TNS/R native object code Contrast with TNS interpreted mode and TNS accelerated mode. See also TNS/E native mode. TNS/R native object code. The MIPS RISC instructions that result from processing program source code with a TNS/R native compiler. TNS/R native object code executes only on TNS/R systems, not on TNS systems or TNS/E systems. TNS/R native object file.
word Glossary specified using the linker at link time or in a later change command, or at run time using the process creation interfaces. (The /LIB …/ option to the RUN command in TACL uses these interfaces.) word. An instruction-set-defined unit of memory that corresponds to the width of registers and to the most common and efficient size of memory operations. A TNS word is 2 bytes (16 bits) wide, beginning on any 2-byte boundary in memory.
word Glossary Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 Glossary -16
Index A|B|C|D|E|F|G|H|I|L|M|N|O|P|R|S|T|U|V|W|Z Special Characters A Advantages of the CRE 1-8 Arccos 7-4 Arcsin 7-5 Arctan 7-5 Arctan2 7-6 Arithmetic overflow 7-1 ARMTRAP 2-51 ASCII to numeric function Atof 8-3 Atoi 8-3 Atol 8-3 ASSIGN message changing 9-23, 9-25 creating 9-23, 9-25 deleting 9-19 finding greatest message number 9-26 parts 5-6 retrieving 9-21, 9-22 Atof 8-3 Atoi 8-3 Atol 8-3 B Binder INFO command 3-7 language-consistency checking 3-9 parameter checking 3-8 return-value checking 3-8 Bindin
C Index CLU_Process_Create_ function 9-1 CLU_Process_File_Name_ function 5-2, 9-1, 9-12 COBOL binding 3-5 locating file connectors 9-1 main routine 2-10 messages 10-26/10-31 program initialization 2-12, 2-13 program termination 2-16 requesting heap space 2-40, 2-43 run-time environment 1-1 run-time library 3-7 SMU functions 9-1 traps 2-53 using the CRE 3-4 $RECEIVE and 2-35 COMMON Binder group 3-5 Common Language Utility library see also Saved Message Utility compared to CRE 9-1 compared to the CRE 5-1 fu
D Index CRE_File_Close_ 6-5 CRE_File_Control_ 6-6 CRE_File_Input_ 6-8 CRE_File_Message_ 6-9 CRE_File_Open_ 6-11 CRE_File_Output_ 6-20 CRE_File_Retrycheck_ 6-22 CRE_File_Setmode_ 6-23 CRE_Getenv_ 5-9, 6-1 CRE_GLOBALS 3-5 CRE_HEAP 3-5 CRE_Log_GetPrefix_ 6-45 CRE_Log_Message_ 6-25 CRE_Putenv_ 5-9, 6-2 CRE_Receive_Open_Close_ 6-31 CRE_Receive_Read_ 6-38 CRE_Receive_Write_ 6-41 CRE_Spool_Start_ 6-27 CRE_Stacktrace_ 6-45 CRE_Terminator_ 6-42 CRE_Terminator_ procedure 2-16 D Data blocks 3-5 Data types A-1 Decim
F Index F Fault tolerance, CRE See Process Pairs File connectors identifying 5-2 locating 5-2 native CRE and 2-6 processing 9-1, 9-12 File sharing see Sharing standard files File-sharing function CRE_File_Close_ 6-5 CRE_File_Control_ 6-6 CRE_File_Input_ 6-8 CRE_File_Message_ 6-9 CRE_File_Open_ 6-11 CRE_File_Output_ 6-20 CRE_File_Retrycheck_ 6-22 CRE_File_Setmode_ 6-23 CRE_Log_Message_ 6-25 CRE_Receive_Open_Close_ 6-31 CRE_Receive_Read_ 6-38 CRE_Receive_Write_ 6-41 CRE_Spool_Start_ 6-27 File_Close_ 6-5 Fil
I Index I INFILE in startup message 2-29 Initialization in CRE 2-10 Input/output messages 10-18/10-24 Inspect, using with the CRE 2-62 Int_to_Decimal 7-27 I/O with the CRE 2-19 without the CRE 2-17 L Language support 1-8 Language-specific run-time environment definition 1-1 Language-specific run-time libraries definition 1-1 LIBRARY Binder environment option 3-5 LIBSPACE Binder environment option 3-5 Ln 7-8 Log10 7-9 Logic errors, CRE handling of 2-48 Log_GetPrefix_ 6-45 Log_Message_ 6-25 Lower 7-10 M M
N Index Memory-block function Memory_Compare_ 8-34 Memory_Copy_ 8-35 Memory_Findchar_ 8-36 Memory_Move_ 8-37 Memory_Repeat_ 8-38 Memory_Set_ 8-39 Memory_Swap_ 8-40 Memory_Compare_ 8-34 Memory_Copy_ 8-35 Memory_Findchar_ 8-36 Memory_Move_ 8-37 Memory_Repeat_ 8-38 Memory_Set_ 8-39 Memory_Swap_ 8-40 Messages C 10-26 CRE service 10-6/10-11 format of 10-2 FORTRAN 10-25/10-31 function parameter 10-14, 10-17 heap management 10-12/10-14 input/output 10-18/10-24 mapping message numbers between run-time environment
P Index P PARAM command EXECUTION-LOG program initialization and 2-33 SAVE-ENVIRONMENT environ array and 5-9 using 5-7 PARAM message see also PARAM command changing 9-29 creating 9-29 deleting 9-27 parts 5-7 retrieving 9-28 Positive_Diff 7-13 Power 7-15 Power2 7-16 Process pairs 2-59 C 2-60 CRE control of 2-59 in general 2-59 in the OSS environment compared to Guardian environment 2-6 language support for 2-60 native CRE and 2-6 requirements for using 2-59 status codes 2-61 Program initialization in gener
S Index Saved Message Utility see also Common Language Utility library description 5-3, 9-17 environment information 5-7 environment values 5-7 functions SMU_Assign_CheckName_ 9-18 SMU_Assign_Delete_ 9-19 SMU_Assign_GetText_ 9-21 SMU_Assign_GetValue_ 9-22 SMU_Assign_PutText_ 9-23 SMU_Assign_PutValue_ 9-25 SMU_Message_CheckNumber_ 926 SMU_Param_Delete_ 9-27 SMU_Param_GetText_ 9-28 SMU_Param_PutText_ 9-29 SMU_Startup_Delete_ 9-30 SMU_Startup_GetText_ 9-31 SMU_Startup_PutText_ 9-33 messages content 5-6 savin
S Index Standard functions in the OSS environment compared to Guardian environment 2-5 using 2-56 Standard input 2-29 Standard log FORTRAN and 2-33 in general 2-33 Standard output 2-31 Startup message changing 9-33 creating 9-33 deleting 9-30 in general 2-29 retrieving 9-31 Statistics, heap 2-41 Stcarg 8-4 Stccpy 8-5 Stcd_I 8-6 Stcd_L 8-7 Stch_I 8-8 Stci_D 8-9 Stcpm 8-10 Stcpma 8-11 Stcu_D 8-12 STDERR and standard log 2-33 stdfiles C directive 2-13 STDIN, not recognized 2-30 STDOUT, not recognized 2-32 St
T Index Strtol 8-29 Strtoul 8-30 Substring_Search 8-32 System library 3-7 T TAL binding 3-5 ENV NEUTRAL directive 3-6 INITIALIZER system procedure 2-6 main routine 2-10 program initialization 2-12, 2-13 program termination 2-16 requesting heap space 2-40, 2-43 run-time environment 1-1 run-time library 3-7 selecting ENV directive 2-6 Sequential I/O (SIO) routines 2-6 SMU functions 9-1 TALLIB 3-7 traps 2-54 user data segment 2-6 using the CRE 3-4 using with the CRE 2-6 $RECEIVE and 2-35 TALLIB 1-4, 3-7 TAL
Special Characters Index $RECEIVE (continued) in the OSS environment compared to Guardian environment 2-3 messages received from 2-35 OSS environment and 2-34 program initialization 2-10, 2-35 reading 2-35 TAL routines 2-35, 2-36 TAL routines and 2-36 using 2-34 _ERASE_ON_FREE_ DEFINE 2-45 Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 Index- 11
Index Special Characters Common Run-Time Environment (CRE) Programmer’s Guide —528146-004 Index -12