PNOTICE_fdoc.alm 04/13/83 1542.9r w 04/13/83 1542.9 2448 dec 1 "version 1 structure dec 1 "no. of pnotices dec 3 "no. of STIs dec 56 "lgth of all pnotices + no. of pnotices acc "Copyright, (C) Honeywell Information Systems Inc., 1981" aci "W1FDOM0A2000" aci "W2FDOM0A2000" aci "W3FDOM0A2000" end  format_document.pl1 11/01/84 1436.7r w 11/01/84 1304.2 76410 /* *********************************************************** * * * * * Copyright, (C) Honeywell Information Systems Inc., 1981 * * * * * *********************************************************** */ format_document: fdoc: proc; /* command to do simple text formatting, i.e. compose without much of its capabilities and associated overhead. Written 79.01.12 by Paul W. Benjamin Re-written 81.02.10 by PWB. Modified 83.02.15 by PWB to explicitly set 3 new switches (dont_compress_sw, force_break_sw and max_line_length_sw) to "0"b. Modified 83.03.01 by PWB to set dont_break_indented_lines_sw to "0"b. Modified 83.03.03 by PWB to set sub_err_sw to "0"b. Modified 83.06.07 by PWB to set dont_fill_sw to "0"b. Modified 83.06.09 by PWB to implement -hyphenate. Modified 83.08.30 by PWB to add -no_hyphenate, every ying deserving a yang. */ /* entries */ dcl com_err_ entry options (variable); dcl cu_$arg_count entry (fixed bin); dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); dcl expand_pathname_ entry (char (*), char (*), char (*), fixed bin (35)); dcl expand_pathname_$add_suffix entry (char (*), char (*), char (*), char (*), fixed bin (35)); dcl format_document_ entry (char (*), char (*), char (*), char (*), ptr, fixed bin (35)); dcl format_document_$switch entry (char (*), char (*), ptr, ptr, fixed bin (35)); /* external static */ dcl error_table_$bad_arg external static fixed bin (35); dcl error_table_$badopt external static fixed bin (35); dcl error_table_$incorrect_access fixed bin(35) ext static; dcl error_table_$mdc_path_dup_args fixed bin(35) ext static; dcl error_table_$moderr fixed bin(35) ext static; dcl error_table_$noarg external static fixed bin (35); dcl iox_$user_output ptr ext static; /* automatic */ dcl alen fixed bin; /* length of input argument */ dcl aptr ptr; /* ptr to input argument */ dcl code fixed bin (35); /* system status code */ dcl filout bit (1); /* output will go to file */ dcl i fixed bin; /* do group index */ dcl in_dname char (168); /* input file directory */ dcl in_ename char (32); /* input file name */ dcl in_path char (168); /* relative pathname of input file */ dcl last_arg char (13) varying; /* temporary for last input arg */ dcl nargs fixed bin; /* number of input arguments */ dcl out_dname char (168); /* output file directory */ dcl out_ename char (32); /* output file name */ dcl out_path char (168); /* relative pathname of output file */ dcl 1 auto_fdoc_options like format_document_options; /* structure to be passed to format_document_ */ /* based */ dcl arg char (alen) based (aptr); /* input argument */ /* builtin */ dcl (addr, binary, length, rtrim, substr, verify) builtin; %include format_document_options; /* program */ format_document_options_ptr = addr (auto_fdoc_options); /* initialize */ format_document_options.version_number = format_document_version_2; format_document_options.indentation = 0; format_document_options.line_length = 65; format_document_options.pgno_sw = "0"b; format_document_options.adj_sw = "1"b; format_document_options.galley_sw = "0"b; format_document_options.error_sw = "1"b; format_document_options.literal_sw = "0"b; format_document_options.dont_compress_sw = "0"b; format_document_options.break_word_sw = "0"b; format_document_options.max_line_length_sw = "0"b; format_document_options.dont_break_indented_lines_sw = "0"b; format_document_options.sub_err_sw = "0"b; format_document_options.dont_fill_sw = "0"b; format_document_options.hyphenation_sw = "0"b; format_document_options.mbz = "0"b; format_document_options.syllable_size = 2; in_path = ""; out_path = ""; filout = "0"b; call cu_$arg_count (nargs); /* process command line */ if nargs < 1 then do; print_usage: call com_err_ (0, "format_document", "Usage: format_document path {-indent(-ind) N} {-output_file(-of) {path}} {-page_numbers(-pgno)}"); goto done; end; do i = 1 to nargs; call cu_$arg_ptr (i, aptr, alen, code); if code ^= 0 then do; call com_err_ (code, "format_document"); goto done; end; if substr (arg, 1, 1) ^= "-" then do; if in_path = "" then in_path = arg; else do; call com_err_ (error_table_$mdc_path_dup_args, "format_document"); goto print_usage; end; end; else if arg = "-page_numbers" | arg = "-pgno" then format_document_options.pgno_sw = "1"b; else if arg = "-output_file" | arg = "-of" then do; filout = "1"b; if i ^= nargs then do; i = i + 1; call cu_$arg_ptr (i, aptr, alen, code); if code ^= 0 then do; call com_err_ (code, "format_document"); goto done; end; if substr (arg, 1, 1) = "-" then i = i - 1; else out_path = arg; end; end; else if arg = "-indent" | arg = "-ind" | arg = "-in" then do; i = i + 1; if i > nargs then do; /* no indentation number given */ call com_err_ (error_table_$noarg, "format_document", "Following ^a", arg); goto done; end; last_arg = arg; call cu_$arg_ptr (i, aptr, alen, code); if code ^= 0 then do; call com_err_ (code, "format_document"); goto done; end; if verify (arg, "1234567890") ^= 0 then do; call com_err_ (error_table_$bad_arg, "format_document", "Following ^a", last_arg); goto done; end; format_document_options.indentation = binary (arg); end; else if arg = "-hyphenate" | arg = "-hph" | /* undocumented */ arg = "-hyph" then do; format_document_options.hyphenation_sw = "1"b; if i ^= nargs then do; last_arg = arg; i = i + 1; call cu_$arg_ptr (i, aptr, alen, code); if code ^= 0 then do; call com_err_ (code, "format_document"); goto done; end; if substr (arg, 1, 1) = "-" then i = i - 1; else if verify (arg, "1234567890") ^= 0 then do; call com_err_ (error_table_$bad_arg, "format_document", "Following ^a", last_arg); goto done; end; else format_document_options.syllable_size = binary (arg); end; end; else if arg = "-no_hyphenate" | arg = "-nhph" then format_document_options.hyphenation_sw = "0"b; else do; call com_err_ (error_table_$badopt, "format_document", "^a", arg); goto done; end; end; if in_path = "" then goto print_usage; call expand_pathname_$add_suffix (in_path, "fdocin", in_dname, in_ename, code); if code ^= 0 then do; call com_err_ (code, "format_document", "^a", in_path); goto done; end; if filout then do; if out_path = "" /* no output file name given, use default */ then do; call expand_pathname_$add_suffix ( substr (in_ename, 1, length (rtrim (in_ename)) - 7), "fdocout", out_dname, out_ename, code); if code ^= 0 then do; call com_err_ (code, "format_document", "^a", substr (in_ename, 1, length (rtrim (in_ename)) - 7) || ".fdocout"); goto done; end; end; else do; call expand_pathname_ (out_path, out_dname, out_ename, code); if code ^= 0 then do; call com_err_ (code, "format_document", "^a", out_path); goto done; end; end; end; if filout /* call subroutine to do actual work */ then call format_document_ (in_dname, in_ename, out_dname, out_ename, format_document_options_ptr, code); else call format_document_$switch (in_dname, in_ename, iox_$user_output, format_document_options_ptr, code); if code ^= 0 /* examine code */ then do; /* report error if found */ if filout & format_document_options.file_sw & code = error_table_$incorrect_access then code = error_table_$moderr; /* tssi crapped out */ if filout /* tell him which file */ then call com_err_ (code, "format_document", "^[^2s^]^a>^a", (format_document_options.file_sw = "1"b), in_dname, in_ename, out_dname, out_ename); else call com_err_ (code, /* must be input file */ "format_document", "^a>^a", in_dname, in_ename); end; done: /* and return */ end; bull_copyright_notice.txt 08/30/05 1008.4r 08/30/05 1007.3 00020025 ----------------------------------------------------------- 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