1 /* ******************************************************
 2    *                                                    *
 3    *                                                    *
 4    * Copyright (c) 1972 by Massachusetts Institute of   *
 5    * Technology and Honeywell Information Systems, Inc. *
 6    *                                                    *
 7    *                                                    *
 8    ****************************************************** */
 9 
10 /* FS_CHNAME - Call the File System Without Interpreting Arguments.
11           Michael A. Padlipsky as told to Noel I. Morris - 5/12/70
12 
13                                                                       */
14 
15 fs_chname:          proc;
16 
17 dcl  rcode fixed bin,                                       /* error code */
18      count fixed bin,                                       /* number of arguments */
19     (dp, ep, op, np) ptr,                                   /* pointers to names */
20     (dl, el, ol, nl) fixed bin,                             /* lengths of names */
21      dir char (dl) based (dp),                              /* directory path name */
22      entry char (el) based (ep),                            /* entry name */
23      oldname char (ol) based (op),                          /* name to be deleted */
24      newname char (nl) based (np);                          /* name to be added */
25 
26 dcl  cu_$arg_count ext entry (fixed bin),
27      cu_$arg_ptr ext entry (fixed bin, ptr, fixed bin, fixed bin),
28      com_err_ ext entry,
29      hcs_$chname ext entry,
30      ioa_ ext entry;
31 
32 
33                     /* ^L */
34 
35 /* Check for correct number of arguments. */
36 
37           call cu_$arg_count (count);
38           if count ^= 4 then do;
39                call ioa_ ("^/Usage is:^-fs_chname dir entry oldname newname^/");
40                return;
41           end;
42 
43 /* Pick up directory pathname. */
44 
45           call cu_$arg_ptr (1, dp, dl, rcode);
46           if rcode ^= 0 then do;
47 argerr:        call com_err_ (rcode, "fs_chname", "");
48                return;
49           end;
50 
51 /* Pick up entry name. */
52 
53           call cu_$arg_ptr (2, ep, el, rcode);
54           if rcode ^= 0 then go to argerr;
55 
56 /* Pick up oldname and newname. */
57 
58           call cu_$arg_ptr (3, op, ol, rcode);
59           if rcode ^= 0 then go to argerr;
60 
61           call cu_$arg_ptr (4, np, nl, rcode);
62           if rcode ^= 0 then go to argerr;
63 
64 /* Call into Ring 0. */
65 
66           call hcs_$chname (dir, entry, oldname, newname, rcode);
67           if rcode ^= 0 then
68                call com_err_ (rcode, "fs_chname", entry);
69 
70           return;
71 
72 end;