/* *********************************************************** * * * Copyright, (C) Honeywell Information Systems Inc., 1982 * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * *********************************************************** */ expand:proc; /* This program implements the expand command and maintains the old entry point for expand (pct_ex_ is the entry point used by pl1d, pl1,and eplbsa). The expand command implements % include statements in pl1 and eplbsa syntax */ dcl pct_entry bit(1) aligned; dcl (com_err_,hcs_$initiate_count) ext entry options (variable); dcl path char(168) aligned,ent char(32) aligned; dcl code1 fixed bin(17),(segp,segp2) ptr, (bit_count,bit_count2) fixed bin(24); dcl expand_path_ ext entry(ptr,fixed bin(17),ptr,ptr,fixed bin(17)); dcl hcs_$fs_search_get_wdir ext entry(ptr,fixed bin(17)); dcl hcs_$terminate_noname ext entry(ptr,fixed bin (17)); dcl expand_ ext entry(char(168) aligned,char(32) aligned,ptr,fixed bin(24),ptr,fixed bin(24),fixed bin(17)); dcl(code,arglen,nargs) fixed bin(17),argptr ptr,name char(arglen) based(argptr); dcl cu_$arg_ptr ext entry(fixed bin(17),ptr,fixed bin(17),fixed bin(17)); dcl null builtin; pct_entry = "0"b; /* this is to keep track of whether I am a command or a subroutine */ /* as a command , there can be more than one file to be expanded */ do nargs=1 by 1; call cu_$arg_ptr(nargs,argptr,arglen,code); if code^=0 then return; /* this can only mean that there are no more arguments */ prepare: call expand_path_(addr(name),arglen,addr(path),addr(ent),code); if code^=0 then do; ent=name; /* if there was an error in expand_path_ then I must use the oldname*/ go to error; end; call hcs_$initiate_count(path,ent,"",bit_count,1,segp,code); if segp = null then go to error; call hcs_$fs_search_get_wdir(addr(path),code); call expand_(path,ent,segp,bit_count,segp2,bit_count2,code1); if segp2^=null /* this is the only way a fatal error by expand_ shows up */ then do; /* since a pointer is passed, file is not terminated */ call hcs_$terminate_noname(segp2,code); if code ^= 0 then go to error; end; cont: if pct_entry then go to old_call_return; /* we cannot terminate the original file if this is a subroutine call */ call hcs_$terminate_noname(segp,code); if code ^= 0 then go to error; cont1: end; pct_ex_:entry(nm,mode,val); /* This entry point is used by pl1d, pl1, eplbsa(or at least it used to be) nm is a relative pathname to the file to be expanded, mode is an obsolete parameter that is ignored, val is the error code - it can be either 0, or 2 depending upon whether there has been an error or not. */ dcl (nm,mode) char(*),val fixed bin(17); /* try to make it look as if we had called cu_$arg_ptr */ val=0; argptr = addr(nm); arglen = length(nm); pct_entry = "1"b; /* this will keep us out of the loop for multiple arguments, above */ go to prepare; /* enter the code for processing the command */ old_call_return: if code1 ^= 0 then val = 2; return; error: call com_err_(code,"expand","^a^/",ent); if pct_entry = "1"b then do; val = 2; go to old_call_return; end; go to cont1; end expand; */ ----------------------------------------------------------- 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 */