1 /* ***********************************************************
  2    *                                                         *
  3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4    *                                                         *
  5    * Copyright (c) 1972 by Massachusetts Institute of        *
  6    * Technology and Honeywell Information Systems, Inc.      *
  7    *                                                         *
  8    *********************************************************** */
  9 
 10 
 11 copy_dump: proc;
 12 
 13 /*        copy_fdump - interface to hphcs_$copy_fdump - October, 1971 David M. Jordan
 14 
 15    This procedure interfaces to hphcs_$copy_fdump and to
 16    hphcs_$set_fdump_num.
 17 
 18    ENTRY: copy_dump$copy_dump
 19 
 20    This entry copies the contents of the dump partition into the Multics
 21    heirarchy in >dumps.  The contents are placed into up to ten segments in
 22    that directory with names of the form:
 23 
 24    mmddyy.tttt.s.eee
 25 
 26    where
 27 
 28    mmddyy is the date the dump was taken
 29    tttt   is the time the dump was taken
 30    s      is a sequence number (0, 1, 2, ... 9)
 31    eee    is the ERF number used in reporting this dump
 32 
 33    Note that copy_dump will copy a given dump only once and will return an
 34    error code if an attempt is made to re-copy a dump.
 35 
 36    ENTRY: copy_dump$set_fdump_number eee
 37    or copy_dump$sfdn eee
 38 
 39    where
 40 
 41    eee    is the ERF number to be assigned to the next FDUMP taken.
 42 
 43    This entry sets the value of the next FDUMP to be taken by changing
 44    the value associated with the ERF number in the dump partition.
 45 
 46    Note that copy_dump$set_fdump_number will modify the dump partition only
 47    after the last dump taken has been copied.  If an attempt is made to change
 48    the ERF number before a dump has been copied an error message will be returned.
 49 
 50 */
 51 
 52 declare  code fixed bin (35),                               /* error code */
 53          aptr pointer,                                      /* argument pointer */
 54          alen fixed bin,                                    /* argument length */
 55          arg char (alen) based (aptr),                      /* argument */
 56          erf_no fixed bin;                                  /* fdump erf number to be set */
 57 
 58 declare (hphcs_$copy_fdump entry (fixed bin (35)),
 59          com_err_ entry options (variable),
 60          cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)),
 61          cv_dec_check_ entry (char (*), fixed bin (35)) returns (fixed bin),
 62          error_table_$badcall fixed bin (35),
 63          error_table_$noarg fixed bin (35),
 64          hphcs_$set_fdump_num entry (fixed bin, fixed bin (35))) external;
 65 
 66 
 67           call hphcs_$copy_fdump (code);
 68 
 69           if code ^= 0
 70           then call com_err_ (code, "copy_dump");
 71           return;
 72 
 73 set_fdump_number: sfdn: entry;
 74 
 75           call cu_$arg_ptr (1, aptr, alen, code);
 76 
 77           if code ^= 0
 78           then do;
 79 
 80                call com_err_ (error_table_$noarg, "set_fdump_number",
 81                     "Usage is:^/set_fdump_number erf^/Where ""erf"" is the number of the next ERF.");
 82                return;
 83 
 84           end;
 85 
 86           erf_no = cv_dec_check_ (arg, code);
 87 
 88           if code ^= 0
 89           then do;
 90 
 91                call com_err_ (error_table_$badcall, "set_fdump_number", "Not a decimal number: ^a", aptr -> arg);
 92                return;
 93 
 94           end;
 95 
 96           call hphcs_$set_fdump_num (erf_no, code);
 97 
 98           if code ^= 0
 99           then call com_err_ (code, "set_fdump_number");
100 
101           return;
102      end copy_dump;