1 03/05/85  delete_
  2 
  3 
  4 The delete_ subroutine deletes segments, directories, multisegment
  5 files, and data management files and unlinks links.  If the segment,
  6 directory, multisegment file or data management file to be deleted is
  7 protected (i.e., the safety switch or copy switch is on), the
  8 subroutine requires user verification before attempting to remove the
  9 protection.  There are two entry points:  one called with a pathname,
 10 the other with a pointer to a segment.  Both have a set of switches
 11 that specify the actions to be taken by the subroutine.  If the
 12 specified entry is a segment, it is terminated using the term_
 13 subroutine.  In general, users should call the delete_ subroutine
 14 rather than directly addressing entry points in hcs_.  If a data
 15 management file is subject to a pending transaction, the data
 16 management file can not be deleted until the transaction is completed.
 17 
 18 
 19 Entry points in delete_:
 20    (List is generated by the help command)
 21 
 22 
 23 :Entry:  path:  03/05/85 delete_$path
 24 
 25 
 26 Function:  This entry point is called with the pathname of the segment,
 27 directory, multisegment file, data management file, or link to be
 28 deleted.
 29 
 30 
 31 Syntax:
 32 declare delete_$path entry (char(*), char(*), bit(6), char(*),
 33      fixed bin(35));
 34 call delete_$path (dir_name, entryname, switches, caller, code);
 35 
 36 
 37 Arguments:
 38 dir_name
 39    is the pathname of the containing directory.  (Input)
 40 entryname
 41    is the entryname of the segment, directory, multisegment file, data
 42    management file, or link.  (Input)
 43 switches
 44    are six switches that specify the actions to be taken.  (Input) The
 45    switches must be given in the order listed below.
 46    force_sw
 47       "1"b allows the entry to be deleted even if it is protected.
 48       "0"b acts according to question_sw if the entry is protected.
 49 
 50 
 51    question_sw
 52       "1"b asks the user if a protected entry should be deleted if the
 53            force_sw is "0"b; if the user gives a negative response, the
 54            subroutine returns the code
 55            error_table_$action_not_performed.  If question_sw is "1"b
 56            and the entryname argument is the name of a directory, the
 57            delete_ subroutine prints an error message for the first
 58            entry under the directory that cannot be deleted.
 59       "0"b deletes the entry without interrogating the user; if unable
 60            to delete the entry, the subroutine returns an appropriate
 61            storage system status code.
 62 
 63 
 64    The following switches allow control by the caller over which
 65    storage system entry types can be deleted:
 66    directory_sw
 67       "1"b allow the entryname argument to refer to a directory.
 68       "0"b return the code error_table_$dirseg if the entryname
 69            argument refers to a directory.
 70    segment_sw
 71       "1"b allow the entryname argument to refer to a segment,
 72            multisegment file, or data management file.
 73       "0"b return the code error_table_$nondirseg if the entryname
 74            argument refers to a segment on a multisegment file.
 75    link_sw
 76       "1"b allow the entryname argument to refer to a link (see
 77            chase_sw).
 78       "0"b return the code error_table_$not_a_branch if the entryname
 79            argument refers to a link.
 80 
 81 
 82    chase_sw
 83       "1"b allow the target of a link to be deleted, if link_sw = "1"b
 84            and the entryname argument refers to a link; the deletion of
 85            the segment or directory pointed to by the link is governed
 86            by the settings of directory_sw and segment_sw.
 87       "0"b unlink the link if link_sw ="1"b and the entryname argument
 88            refers to a link.
 89 caller
 90    is the name of the calling procedure, to be used when questions are
 91    asked.  (Input)
 92 code
 93    is a storage system status code.  (Output)
 94 
 95 
 96 :Entry:  ptr:  03/05/85 delete_$ptr
 97 
 98 
 99 Function:  The delete_$ptr entry point is similar to the delete_$path
100 entry point, except that the caller has a pointer to the actual segment
101 to be deleted.  Directories, multisegment files, Data Management files,
102 and links cannot be deleted with the delete_$ptr entry point.  The
103 directory_sw, link_sw, and chase_sw switches are not examined by this
104 entry point, but must be present.
105 
106 
107 Syntax:
108 declare delete_$ptr entry (ptr, bit(6), char(*), fixed bin(35));
109 call delete_$ptr (seg_ptr, switches, caller, code);
110 
111 
112 Arguments:
113 seg_ptr
114    is a pointer to the segment to be deleted.  (Input)
115 switches
116    are switches that specify the actions to be taken.  (Input) (See the
117    delete_$path entry point).
118 caller
119    is the name of the calling procedure, to be used when questions are
120    asked.  (Input)
121 code
122    is a storage system status code.  (Output)