1 01/18/83  terminate_file_
 2 
 3 Entry points in terminate_file_:
 4    (list is generated by the help command)
 5 
 6 
 7 :Entry:  terminate_file_:  01/18/83  terminate_file_
 8 
 9 Syntax:
10 dcl terminate_file_ entry (ptr, fixed bin (24), bit (*), fixed bin (35));
11 call terminate_file_ (seg_ptr, bit_count, switches, code);
12 
13 
14 Function:  Performs common operations after a program has finished
15 with a segment.  It optionally sets the bit count, truncates the
16 segment to a bit boundary, terminates a null reference name from the
17 segment, and ensures that modified pages of the segment are no longer
18 in main memory.  It can also be instructed to delete the segment.
19 
20 
21 Arguments:
22 seg_ptr
23    is a pointer to the segment.  If null on input, no action is taken.
24    Set to null after a null reference name on the segment is terminated.
25    (Input/Output)
26 bit_count
27    is the new bit count of the segment.  (Input)
28 switches
29    control the action of this subroutine.  See the "Notes" section.
30    (Input)
31 code
32    is a standard status code.  (Output)
33 
34 
35 Notes:  The following structure describes the meanings of the switches.
36 
37  dcl 1 terminate_file_switches based,
38        2 truncate    bit (1) unal,
39        2 set_bc      bit (1) unal,
40        2 terminate   bit (1) unal,
41        2 force_write bit (1) unal,
42        2 delete      bit (1) unal;
43 
44 This structure is declared in terminate_file.incl.pl1.  The named
45 constants in the "List of named constants" section are also declared
46 with one or more of the above bits on.
47 
48 If a request is made to delete the segment, any other options selected
49 are performed first in case it is not possible to delete the segment.
50 
51 
52 List of named constants:
53 TERM_FILE_TRUNC
54    truncate the segment to bit_count bits
55 TERM_FILE_BC
56    set the bit count to bit_count
57 TERM_FILE_TERM
58    terminate a null reference name on the segment
59 TERM_FILE_TRUNC_BC
60    truncate the segment to the bit_count bits and set the bit count
61    to bit_count
62 TERM_FILE_TRUNC_BC_TERM
63    truncate the segment to the bit_count bits, set the bit count to
64    bit_count, and terminate a null reference name on the segment
65 
66 
67 TERM_FILE_FORCE_WRITE
68    ensure that modified pages of the segment are no longer in main
69    memory
70 TERM_FILE_DELETE
71    delete the segment