CRE Programmer's Guide

CRE Service Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
6-4
File-Sharing 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_Putenv_ uses additional heap space, if needed.
CRE_Putenv_ returns 0 unless it requires, but is unable to obtain, heap space in which
case it returns error code 31. If it returns a nonzero value,
errno is set to ENOMEM.
CRE_Putenv_ is not valid in small memory model C programs. See the
C/C++
Programmer’s Guide for more information.
File-Sharing Functions
The functions described in this subsection, which are listed in Table 6-2 on page 6-4,
support file sharing in the Guardian environment. The results of calls to these functions
in the OSS environment are undefined. All of the functions listed are available in the
native CRE library.
Table 6-2. File-Sharing Functions
Function Name Function Action
CRE_File_Close_
on page 6-5 Closes a standard file.
CRE_File_Control_
on page 6-6 Sends an operating system control operation to a
standard file.
CRE_File_Input_
on page 6-8 Reads a record from standard input.
CRE_File_Message_
on page 6-9 Sends a message to a standard file.
CRE_File_Open_
on page 6-11 Opens a standard file.
CRE_File_Output_
on page 6-20 Sends a record to standard output or standard log.
CRE_File_Retrycheck_
on
page 6-22
Determines whether an operation that resulted in an
operating system error is retryable.
CRE_File_Setmode_
on page 6-23 Sends an operating system SETMODE operation to a
standard file.
CRE_Hometerm_Open_
on
page 6-24
Opens a process’s home terminal.
CRE_Log_Message_
on page 6-25 Writes a message to standard log.
CRE_Spool_Start_
on page 6-27 Invokes the SPOOLSTART system procedure.