1 02/02/84  suffixed_name_
  2 
  3 This subroutine handles storage system entrynames.  It provides an
  4 entry point that creates a properly suffixed name from a user-supplied
  5 name that might or might not include a suffix, an entry point that
  6 changes the suffix on a user-supplied name that might or might not
  7 include the original suffix, and an entry point that finds a segment, a
  8 directory, or a multisegment file whose name matches a user-supplied
  9 name that might or might not include a suffix.  It is intended to be
 10 used by commands that deal with segments with a standard suffix, but
 11 that do not require the user to supply the suffix in the command
 12 arguments.
 13 
 14 
 15 Entry points in suffixed_name_:
 16    (List is generated by the help command)
 17 
 18 
 19 :Entry:  find:  02/02/84 suffixed_name_$find
 20 
 21 
 22 Function: attempts to find a directory entry whose name matches a
 23 user-supplied name that might or might not include a suffix.  This
 24 directory entry can be a segment, directory, or a multisegment file.
 25 
 26 
 27 Syntax:
 28 declare suffixed_name_$find entry (char(*), char(*), char(*), char(32),
 29      fixed bin(2), fixed bin(5), fixed bin(35));
 30 call suffixed_name_$find (directory, name, suffix, entry, type, mode,
 31      code);
 32 
 33 
 34 Arguments:
 35 directory
 36    is the name of the directory in which the entry is to be found.
 37    (Input)
 38 name
 39    is the name that has been supplied by the user, and that might or
 40    might not include a suffix.  (Input)
 41 suffix
 42    is the suffix that is supposed to be part of name.  It should not
 43    contain a leading period.  (Input)
 44 entry
 45    is a version of name that includes a suffix.  It is returned even if
 46    the directory entry does not exist.  (Output)
 47 
 48 
 49 type
 50    is a switch indicating the type of directory entry that was found.
 51    (Output)
 52    0   no entry was found.
 53    1   a segment was found.
 54    2   a directory was found.
 55    3   a multisegment file was found.
 56 mode
 57    is the caller's access mode to the directory entry that was found.
 58    See the hcs_$append_branch entry point for a description of mode.
 59    The caller's access mode to the multisegment file directory is
 60    returned for a multisegment file.  (Output)
 61 
 62 
 63 code
 64    is a standard status code.  (Output) It can be one of the following:
 65    error_table_$noentry
 66       no directory entry that matches name was found.
 67    error_table_$no_info
 68       no directory entry that matches name was found, and furthermore,
 69       the caller does not have status permission to the directory.
 70    error_table_$incorrect_access
 71       a directory entry that matches name was found, but the caller has
 72       null access to this entry, and to the directory containing this
 73       entry.
 74    error_table_$entlong
 75       the properly suffixed name that was made is longer than 32
 76       characters.
 77 
 78 
 79 :Entry:  make:  02/02/84 suffixed_name_$make
 80 
 81 
 82 Function: makes a properly suffixed name out of a name supplied by the
 83 user that might or might not include a suffix.
 84 
 85 
 86 Syntax:
 87 declare suffixed_name_$make entry (char(*), char(*), char(32),
 88      fixed bin(35));
 89 call suffixed_name_$make (name, suffix, proper_name, code);
 90 
 91 
 92 Arguments:
 93 name
 94    is the name that has been supplied by the user, and that might or
 95    might not include a suffix.  (Input)
 96 suffix
 97    is the suffix that is supposed to be part of name.  It should not
 98    contain a leading period.  (Input)
 99 proper_name
100    is the suffixed version of name.  (Output)
101 code
102    is a standard status code.  (Output) It can be:
103    error_table_$entlong
104       the properly suffixed name that was made is longer than
105       proper_name; proper_name contains only a part of the properly
106       suffixed name.
107 
108 
109 :Entry:  new_suffix:  02/02/84 suffixed_name_$new_suffix
110 
111 
112 Function: creates a name with a new suffix by changing the (possibly
113 existing) suffix on a user-supplied name to the new suffix.  If there
114 is no suffix on the user-supplied name, then the new suffix is merely
115 appended to the user-supplied name.
116 
117 
118 Syntax:
119 declare suffixed_name_$new_suffix entry (char(*), char(*), char(*),
120      char(32), fixed bin(35));
121 call suffixed_name_$new_suffix (name, suffix, new_suffix, new_name,
122      code);
123 
124 
125 Arguments:
126 name
127    is the name that has been supplied by the user, and that might or
128    might not include a suffix.  (Input)
129 suffix
130    is the suffix that might or might not already be on name.
131 new_suffix
132    is the new suffix.  (Input)
133 new_name
134    is the name that was created.  If name ends with .suffix, then
135    .new_suffix replaces .suffix in new_name.  Otherwise, new_name is
136    formed by appending .new_suffix to name.  (Output)
137 
138 
139 code
140    is a standard status code.  (Output)   It can be:
141    error_table_$entlong
142       meaning that the suffixed new name is longer than new_name and
143       therefore new_name contains only part of the suffixed new name.
144 
145 
146 Notes:  If error_table_$no_s_permission is encountered during the
147 processing for suffixed_name_$find, it is ignored and is not returned
148 in the status code.