next up previous contents index
Next: Using PAW as Up: Global sections and Previous: Memory communication

Mapping global sections on VMS

hcreategVALUE = hcreateg(global_name,base_common,size)

Action: Function to create and map a global section .

The function first opens a file with UFO option (using HST\_OPEN\_GBL), then creates and maps the global section using SYS$CRMPSC. Open the file using SYS$SETDFPROT to set protection loose.

Input parameters:
global_name
Name of the section to be mapped
base_common
First word of COMMON to be mapped.
size
size of the COMMON in words.

The function value returned is equal to the global section length (pages) if the procedure was successful or an errorcode <0 if an error occurred.

HCREATEG$DIR is a LOGICAL which, if defined, gives the directory for the mapping file of the global section. In this case, the file is not deleted upon closing.

hmapgVALUE = hmapg(global_name,base_common,offset)

Action: Function to dynamically map to an existing global section.

The function maps to the global section using SYS$MGBLSC, allocating pages in the p0 region with the sec$m_expreg option.

Input parameters:
global_name
Name of the section to be mapped
base_common
First word of reference COMMON to be mapped.
offset
Offset with respect to BASE\_COMMON of the mapped section in words,
i.e. BASE\_COMMON(OFFSET) is the first word.

The function value returned is equal to the global section length (pages) if the procedure was successful or is an errorcode <0 if an error occurred.

hfreeVALUE = hfree(global_size,base_common,offset)

Action: Function to dynamically delete/unmap global section space using the service SYS$DELTVA.

Input parameters:
global_size
Size of the section to be freed (pages).
base_common
First word of reference COMMON.
offset
Offset with respect to BASE\_COMMON of the mapped section in words,
i.e. BASE\_COMMON(OFFSET) is the first word.

The function value returned is equal to the global section length (pages) if the procedure was successful or is an errorcode <0 if an error occurred.



next up previous contents index
Next: Using PAW as Up: Global sections and Previous: Memory communication

Last update: Tue May 16 09:09:27 METDST 1995