COMPILATION LISTING OF SEGMENT memo_repeat_ Compiled by: Multics PL/I Compiler, Release 30, of February 16, 1988 Compiled at: Honeywell Bull, Phoenix AZ, SysM Compiled on: 08/02/88 1227.7 mst Tue Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1988 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 /****^ HISTORY COMMENTS: 13* 1) change(86-07-15,Rauschelbach), approve(86-07-15,MCR7472), 14* audit(86-08-07,GJohnson), install(86-08-08,MR12.0-1122): 15* rewitten to fix misc_commands 344 TR 20424 16* memo will now reschedule only 1 cycle of a repeating memo after 17* memo -on is given. 18* 2) change(88-04-30,GDixon), approve(88-05-26,MCR7900), 19* audit(88-07-28,Lippard), install(88-08-02,MR12.2-1075): 20* Change the way the -repeat interval is applied, so that the interval is 21* applied relative to the memo maturity_time (or to the current time if 22* -repeat_when_processed was given), rather than relative to a zero clock 23* reading (Jan 1, 1901 0000. gmt.). If application of one interval still 24* leaves a maturity date in the past, reapply the interval relative to the 25* previously computed maturity_time, as the date may affect the meaning of 26* the repeat interval. For example, "-repeat 1 year" corresponds to a 27* different number of days depending upon whether the maturity_time falls 28* in a leap year or not. In another example, 29* -repeat "fri before 2mo this mo 1 this yr" 30* has a varying meaning depending upon the month/year of the maturity_time. 31* 32* Processing of frequently-encountered, fixed-length repeat intervals such 33* as "15 minutes" is optimized by having an internal interface into 34* convert_date_to_binary_ analyze the time_string to determine if it 35* consists only of fixed-length offsets. If so, then memo_repeat_ can 36* add the repeat interval directly to the prior maturity_time iteratively 37* until a time in the future is obtained. (phx21094) 38* END HISTORY COMMENTS */ 39 40 /* ************************************************************************* */ 41 /* */ 42 /* At the point in memo where this subroutine is called, any memos which */ 43 /* have matured have been run. Now if the memo was a repeating memo, this */ 44 /* program will reschedule a new memo for the next interval in the future */ 45 /* which was given with -repeat. If -repeat_when_processed was given, the */ 46 /* interval is added to to current P_memo_time_now value. Note that the */ 47 /* memo interval will not be set in relation to the -time value if */ 48 /* -repeat_when_processed is given. */ 49 /* */ 50 /* If the more than one occurrence of the interval has passed since the memo */ 51 /* has matured, then the interval will be added to the last time the memo */ 52 /* was scheduled to mature (which is in the current memo_entry) until the */ 53 /* maturity time of is greater than the time_now. Then a new memo entry */ 54 /* is given and its index is returned to the caller. */ 55 /* */ 56 /* ************************************************************************* */ 57 58 memo_repeat_: proc (P_msp, /* (input) points to the memo seg. */ 59 P_idx, /* (input) index of mature memo entry*/ 60 P_memo_time_now, /* (input) match time for maturity */ 61 P_code) /* (output) error code */ 62 returns (fixed bin); /* (output) index of new memo entry */ 63 64 65 /* PARAMETERS */ 66 67 dcl P_msp pointer parameter, 68 P_idx fixed bin parameter, 69 P_memo_time_now fixed bin (35) parameter, 70 P_code fixed bin (35) parameter; 71 72 /* AUTOMATIC */ 73 74 dcl current_mature_memo_idx fixed bin, 75 current_time fixed bin (71), 76 fixed_length_interval bit(1) aligned, 77 interval fixed bin (71), 78 maturity_memo_time fixed bin (35), 79 maturity_time fixed bin (71), 80 future_mature_memo_idx fixed bin; 81 82 /* EXTERNAL ENTRIES */ 83 84 dcl convert_date_to_binary_$analyze 85 entry (char(*) aligned, fixed bin(71), 86 fixed bin(71), bit(1) aligned, 87 fixed bin(35)), 88 convert_date_to_binary_$relative 89 entry (char (*) aligned, 90 fixed bin (71), fixed bin (71), 91 fixed bin (35)), 92 memo_set_ entry (ptr, char (*) aligned, 93 bit (36) aligned, fixed bin (35), 94 fixed bin (35), char (*) aligned) 95 returns (fixed bin), 96 memo_util_$from_gmt entry (fixed bin (71)) 97 returns (fixed bin (35)), 98 memo_util_$to_gmt entry (fixed bin (35)) 99 returns (fixed bin (71)); 100 101 /* EXTERNAL STATIC */ 102 103 dcl error_table_$action_not_performed 104 fixed bin (35) external static; 105 106 /* BUILTINS */ 107 108 dcl string builtin; 109 110 111 P_code = 0; 112 current_mature_memo_idx = P_idx; 113 current_time = 0; 114 interval = 0; 115 maturity_memo_time = 0; 116 maturity_time = 0; 117 future_mature_memo_idx = 0; 118 memo_segment_ptr = P_msp; 119 120 if memo_entry (current_mature_memo_idx).flags.per_process then 121 maturity_memo_time = P_memo_time_now; 122 else 123 maturity_memo_time = memo_entry (current_mature_memo_idx).time; 124 125 if maturity_memo_time <= P_memo_time_now then do; 126 127 maturity_time = memo_util_$to_gmt (maturity_memo_time); 128 current_time = memo_util_$to_gmt (P_memo_time_now); 129 130 call convert_date_to_binary_$analyze 131 (memo_entry (current_mature_memo_idx).repeat, maturity_time, 132 interval, fixed_length_interval, P_code); /* Repeat interval length (in microseconds) */ 133 if P_code ^= 0 then; /* may depend on maturity_time it is computed */ 134 else if fixed_length_interval then do; /* relative to. If it is fixed length, */ 135 interval = interval - maturity_time; /* remember fixed interval, and add it */ 136 maturity_time = maturity_time + interval; /* to maturity_time (perhaps more than once). */ 137 end; 138 else /* If not fixed length, then interval */ 139 maturity_time = interval; /* is first new maturity_time. */ 140 141 do while (P_code = 0 & maturity_time <= current_time); 142 /* Keep applying repeat interval until */ 143 /* a time in future is reached. */ 144 if fixed_length_interval then /* Fixed-length (unchanging) intervals can */ 145 maturity_time = maturity_time + interval; /* simply be added to prior maturity_time. */ 146 else do; /* Changable intervals (eg, 1 month) must be */ 147 call convert_date_to_binary_$relative /* recomputed relative to the prior */ 148 (memo_entry (current_mature_memo_idx).repeat, interval, 149 maturity_time, P_code); /* maturity_time. */ 150 maturity_time = interval; 151 end; 152 end; 153 154 maturity_memo_time = memo_util_$from_gmt (maturity_time); 155 156 if P_code = 0 then 157 future_mature_memo_idx = memo_set_ (P_msp, 158 memo_entry (current_mature_memo_idx).data, 159 string (memo_entry (current_mature_memo_idx).flags), 160 maturity_memo_time, 161 memo_entry (current_mature_memo_idx).exp_delta, 162 memo_entry (current_mature_memo_idx).repeat); 163 164 memo_entry (current_mature_memo_idx).flags.repeatsw = "0"b; 165 end; 166 else 167 P_code = error_table_$action_not_performed; 168 169 170 return (future_mature_memo_idx); 171 /* BEGIN INCLUDE FILE ... memo_segment.incl.pl1 ... July, 1979 ... W. Olin Sibert */ 1 2 /* * This include file describes a memo segment. Presently, this structure is still 1 3* * compatible with "old" version 3 memo segments, although it uses more of the pad 1 4* * fields; hence, it is still identified as version 3. If the conversion to version 1 5* * 4 memo segments is ever done, this will have to be changed for version 4. 1 6* */ 1 7 1 8 dcl memo_segment_ptr pointer; 1 9 1 10 dcl MAX_NUMBER_MEMOS fixed bin internal static options (constant) init (5802); 1 11 /* max number of memos in a memo segment */ 1 12 1 13 dcl MEMO_SEGMENT_VERSION_3 fixed bin internal static options (constant) init (3); 1 14 1 15 dcl 1 memo_segment aligned based (memo_segment_ptr), /* current version of whole segment */ 1 16 2 header like memo_segment_header, 1 17 2 memo_entry (MAX_NUMBER_MEMOS) like memo_segment_entry; 1 18 1 19 dcl 1 memo_segment_header aligned based, /* header for memo segment */ 1 20 2 version fixed bin (35), /* presently 3 */ 1 21 2 max_number_used fixed bin (35); /* The highest entry known to be used */ 1 22 1 23 dcl 1 memo_segment_entry aligned based, /* the entry for a single memo */ 1 24 2 taken bit (36) aligned, /* Zero if this entry free */ 1 25 2 flags aligned, /* data about this memo */ 1 26 3 print bit (1) unaligned, /* normal type memo */ 1 27 3 alarm bit (1) unaligned, /* alarm type */ 1 28 3 execute bit (1) unaligned, /* execute type */ 1 29 3 repeatsw bit (1) unaligned, /* has repeat string */ 1 30 3 expires bit (1) unaligned, /* has expiration time */ 1 31 3 remains bit (1) unaligned, /* do not delete this memo when its alarm goes off */ 1 32 3 single bit (1) unaligned, /* delete this non-alarm memo after one printing or execution */ 1 33 3 per_process bit (1) unaligned, /* causes repeat to be done from time_now, not maturity */ 1 34 3 pad1 bit (28) unaligned, /* not used */ 1 35 2 exp_delta fixed bin (35), /* delta time before memo expires */ 1 36 2 time fixed bin (35), /* time this memo matures */ 1 37 2 data char (132) aligned, /* the memo message */ 1 38 2 repeat char (32) aligned; /* the repeat string */ 1 39 1 40 /* END INCLUDE FILE memo_segment.incl.pl1 */ 171 172 173 end memo_repeat_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 08/02/88 1227.7 memo_repeat_.pl1 >special_ldd>install>1075>memo_repeat_.pl1 171 1 08/18/81 1510.4 memo_segment.incl.pl1 >ldd>include>memo_segment.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. MAX_NUMBER_MEMOS internal static fixed bin(17,0) initial dcl 1-10 ref 1-15 P_code parameter fixed bin(35,0) dcl 67 set ref 58 111* 130* 133 141 147* 156 166* P_idx parameter fixed bin(17,0) dcl 67 ref 58 112 P_memo_time_now parameter fixed bin(35,0) dcl 67 set ref 58 120 125 128* P_msp parameter pointer dcl 67 set ref 58 118 156* convert_date_to_binary_$analyze 000010 constant entry external dcl 84 ref 130 convert_date_to_binary_$relative 000012 constant entry external dcl 84 ref 147 current_mature_memo_idx 000100 automatic fixed bin(17,0) dcl 74 set ref 112* 120 122 130 147 156 156 156 156 156 164 current_time 000102 automatic fixed bin(71,0) dcl 74 set ref 113* 128* 141 data 6 based char(132) array level 3 dcl 1-15 set ref 156* error_table_$action_not_performed 000022 external static fixed bin(35,0) dcl 103 ref 166 exp_delta 4 based fixed bin(35,0) array level 3 dcl 1-15 set ref 156* fixed_length_interval 000104 automatic bit(1) dcl 74 set ref 130* 134 144 flags 3 based structure array level 3 dcl 1-15 set ref 156 156 future_mature_memo_idx 000114 automatic fixed bin(17,0) dcl 74 set ref 117* 156* 170 interval 000106 automatic fixed bin(71,0) dcl 74 set ref 114* 130* 135* 135 136 138 144 147* 150 maturity_memo_time 000110 automatic fixed bin(35,0) dcl 74 set ref 115* 120* 122* 125 127* 154* 156* maturity_time 000112 automatic fixed bin(71,0) dcl 74 set ref 116* 127* 130* 135 136* 136 138* 141 144* 144 147* 150* 154* memo_entry 2 based structure array level 2 dcl 1-15 memo_segment based structure level 1 dcl 1-15 memo_segment_entry based structure level 1 dcl 1-23 memo_segment_header based structure level 1 dcl 1-19 memo_segment_ptr 000116 automatic pointer dcl 1-8 set ref 118* 120 122 130 147 156 156 156 156 156 164 memo_set_ 000014 constant entry external dcl 84 ref 156 memo_util_$from_gmt 000016 constant entry external dcl 84 ref 154 memo_util_$to_gmt 000020 constant entry external dcl 84 ref 127 128 per_process 3(07) based bit(1) array level 4 packed packed unaligned dcl 1-15 ref 120 repeat 47 based char(32) array level 3 dcl 1-15 set ref 130* 147* 156* repeatsw 3(03) based bit(1) array level 4 packed packed unaligned dcl 1-15 set ref 164* string builtin function dcl 108 ref 156 156 time 5 based fixed bin(35,0) array level 3 dcl 1-15 ref 122 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. MEMO_SEGMENT_VERSION_3 internal static fixed bin(17,0) initial dcl 1-13 NAME DECLARED BY EXPLICIT CONTEXT. memo_repeat_ 000017 constant entry external dcl 58 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 426 452 317 436 Length 644 317 24 155 107 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME memo_repeat_ 140 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME memo_repeat_ 000100 current_mature_memo_idx memo_repeat_ 000102 current_time memo_repeat_ 000104 fixed_length_interval memo_repeat_ 000106 interval memo_repeat_ 000110 maturity_memo_time memo_repeat_ 000112 maturity_time memo_repeat_ 000114 future_mature_memo_idx memo_repeat_ 000116 memo_segment_ptr memo_repeat_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return_mac ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. convert_date_to_binary_$analyze convert_date_to_binary_$relative memo_set_ memo_util_$from_gmt memo_util_$to_gmt THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$action_not_performed LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 58 000012 111 000024 112 000026 113 000030 114 000032 115 000033 116 000034 117 000035 118 000036 120 000041 122 000052 125 000054 127 000056 128 000066 130 000100 133 000133 134 000137 135 000142 136 000145 137 000147 138 000150 141 000152 144 000160 147 000167 150 000216 152 000220 154 000221 156 000232 164 000302 165 000307 166 000310 170 000312 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved