



		    convert_new_oncode_.pl1         11/04/82  1913.1rew 11/04/82  1614.4       11286



/* ***********************************************************
   *                                                         *
   * Copyright, (C) Honeywell Information Systems Inc., 1982 *
   *                                                         *
   * Copyright (c) 1972 by Massachusetts Institute of        *
   * Technology and Honeywell Information Systems, Inc.      *
   *                                                         *
   *********************************************************** */


convert_new_oncode_: proc (newoc, oldoc);

/* This procedure is given either an old ow new (error_table_) style oncode value and
   returns the corresponding old value. */

dcl (newoc, oldoc) fixed bin (35);
dcl  oldoc_ptr ptr;
dcl (addr, addrel, bin, ptr) builtin;
dcl  error_table_$ ext fixed bin;

dcl 1 word aligned based,
    2 (left, right) bit (18) unaligned;

	if newoc > 1000 then do;			/* have standard code */
	     oldoc_ptr = addrel (ptr (addr (error_table_$), addr (newoc) -> word.right), -3);
						/* code contains offset of message info */
	     oldoc = bin (oldoc_ptr -> word.right, 18);	/* oncode is in right half of 3rd word before long msg */
	end;
	else oldoc = newoc;				/* still old version oncode */

	return;
     end;
  



		    cv_entry_.pl1                   11/20/86  1404.5rew 11/20/86  1148.6      100125



/****^  ***********************************************************
        *                                                         *
        * Copyright, (C) Honeywell Information Systems Inc., 1982 *
        *                                                         *
        * Copyright (c) 1972 by Massachusetts Institute of        *
        * Technology and Honeywell Information Systems, Inc.      *
        *                                                         *
        *********************************************************** */


	

/****^  HISTORY COMMENTS:
  1) change(86-05-02,Elhard), approve(86-05-02,MCR7391),
     audit(86-07-18,DGHowe), install(86-11-20,MR12.0-1222):
     Modified to call object_lib_$initiate to initiate segments or MSFs
     referenced by pathname.
                                                   END HISTORY COMMENTS */


/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
	/*									*/
	/* NAME:  cv_entry_								*/
	/*									*/
	/*      This subroutine converts virtual entry character strings to entry values.	*/
	/*									*/
	/* Status:								*/
	/*									*/
	/* 0) Created by  Gary C. Dixon  on October 22, 1976.				*/
	/* 1) Modified by Bernard S. Greenberg on July 6, 1977 for refname => refname$refname	*/
	/* 2) Modified by Steve Herbst on May 10, 1979 to ignore trailing blanks.		*/
	/* 3) Modified by Gary Dixon on October 23, 1979 - support path$entry_pt, cleanup code	*/
          /* 4) Modified by Paul W. Benjamin on November 5, 1981 - remove entrypoint name validation*/
	/*									*/
	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */



/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */


cv_entry_:		procedure (string, Pref, Acode)
		returns 	(entry);

     dcl						/*	Parameters			*/
     	string			char (*),		/* virtual pointer character string. (In)	*/
	Pref			ptr,		/* ptr to segment in referencing_dir. (In)	*/
	Acode			fixed bin(35);	/* status code. (Out)			*/

     dcl						/*	Automatic Variables			*/
	E			entry variable,	/* entry variable which is returned.		*/
         (Lsegment_id, Lword_offset)	fixed bin,	/* length of various parts of virtual pointer.	*/
         (Psegment_id, Pword_offset, Pdelim)
				ptr,		/* pointer to various parts of virtual pointer.	*/
	P			ptr,		/* returned pointer.			*/
	code			fixed bin(35),
	dir			char(168),	/* dir part of segment's pathname.		*/
	ent			char(32),		/* entry part of segment's pathname.		*/
	i			fixed bin,
	id_case			fixed bin,	/* type of segment identifier in virtual pointer.	*/
						/*   1 = PATHNAME, 2 = REF_NAME.		*/
	offset_case		fixed bin,	/* type of offset value in virtual pointer.	*/
						/*   5 = MISSING, 6 = WORD, 7 = ENTRY_PT_DEFAULT,	*/
						/*   8 = ENTRY_PT.				*/
	word			fixed bin(35);	/* numeric value of word offset.		*/

     dcl						/*	Based Variables			*/
	delim			char(1) based (Pdelim),
	segment_id		char(Lsegment_id) based (Psegment_id),
	string_array (length(string))	char(1) based (Psegment_id),
	word_offset		char(Lword_offset) based (Pword_offset),
	word_offset_array (Lword_offset)
				char(1) based (Pword_offset);
 
     dcl (addr, length, null, ptr, reverse, rtrim, search, verify)
				builtin;

     dcl						/*	Entries				*/
	cu_$decode_entry_value	entry (entry, ptr, ptr),
	cu_$make_entry_value	entry (ptr, entry),
	cv_oct_check_		entry (char(*), fixed bin(35)) returns (fixed bin(35)),
	expand_pathname_		entry (char(*), char(*), char(*), fixed bin(35)),
	hcs_$make_entry		entry (ptr, char(*), char(*), entry, fixed bin(35)),
	object_lib_$initiate	entry (char(*), char(*), char(*), bit(1), ptr,
				      fixed bin(24), bit(1), fixed bin(35));

     dcl						/*	Static Variables and Constants	*/
         (PATHNAME			init(1),		/* acceptable values which id_case may take on.	*/
	REF_NAME			init(2),
	MISSING			init(5),		/* acceptable values offset_case may take on.	*/
	WORD			init(6),
	ENTRY_PT_DEFAULT		init(7),
	ENTRY_PT			init(8)) fixed bin int static options(constant),
	V_BAR			char(1) int static options(constant) init("|"),
         (error_table_$bad_conversion,
	error_table_$bigarg,
	error_table_$entlong,
          error_table_$improper_data_format,
	error_table_$out_of_bounds)	fixed bin(35) ext static,
	sys_info$max_seg_size	fixed bin(35) ext static;


/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */

	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
	/*									*/
	/* Acceptable virtual pointer strings have the following forms:			*/
	/*									*/
	/* CASES									*/
	/*  I O	FORM			COMMENT					*/
	/* -----	-----------------------	------------------------------------------	*/
	/*  1 5	path|			= path|0					*/
	/*  1 6	path|W			octal word W of path			*/
	/*  1 7	path			= path|[entry path]				*/
	/*  1 8	path|entry_pt		word identified by entry point entry_pt in path	*/
	/*  1 8	path$entry_pt		word identified by entry point entry_pt in path	*/
	/*				  (path must contain < or > chars.		*/
	/*									*/
	/*  2 5	ref_name$			= ref_name$0				*/
	/*  2 6	ref_name$W		octal word W of seg with reference name ref_name.	*/
	/*  2 8	ref_name$entry_pt		word identified by entry point entry_pt in seg	*/
	/*				with reference name ref_name			*/
	/*									*/
	/* CASES:  I = segment identifier case (id_case), O = offset value case (offset_case).	*/
	/*	 I = 1 => PATHNAME			O = 5 => MISSING (no offset given)	*/
	/*	   = 2 => REF_NAME			  = 6 => WORD			*/
	/*					  = 7 => ENTRY_PT_DEFAULT		*/
	/*					  = 8 => ENTRY_PT			*/
	/*									*/
	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

	Acode = 0;				/* initialize return code.			*/
	code = error_table_$improper_data_format;	/* initialize format error code.		*/
	id_case = PATHNAME;				/* start by assuming we have a path segment	*/
	offset_case = ENTRY_PT_DEFAULT;		/*   identifier, and no offset value.		*/

	Psegment_id = addr(string);			/* Split identifier into seg_id, delim, & offset. */
	i = search (reverse(string), "|$");		/* Look for the delimiter.			*/
	if i > 0 then i = length(string) - (i-1);
	if i = 0 then do;				/* CASE: No delimiter.			*/
	     Pdelim = addr(V_BAR);			/*   Assume |.				*/
	     Lsegment_id = length(rtrim(string));	/*   Address seg_id.			*/
	     Pword_offset = addr(Pword_offset);		/*   Indicate no word offset.			*/
	     Lword_offset = 0;
	     end;
	else do;					/* CASE: Delimiter found.			*/
	     Pdelim = addr(string_array(i));		/*   Remember delimiter.			*/
	     Lsegment_id = i-1;			/*   Address seg_id.			*/
	     Lsegment_id = length(rtrim(segment_id));
	     if i < length(string) then do;		/*   Look for word offset.			*/
		Pword_offset = addr(string_array(i+1)); /*     Remember where word offset is.		*/
		Lword_offset = length(string) - i;
		Lword_offset = length(rtrim(word_offset));
		i = verify(word_offset, " ");
		if i > 1 then do;
		     Pword_offset = addr(word_offset_array(i));
		     Lword_offset = Lword_offset - (i-1);
		     end;
		if length(word_offset) = 0 then
		     offset_case = MISSING;
		end;
	     else do;				/*   No word offset.			*/
		Pword_offset = addr(Pword_offset);
		Lword_offset = 0;
		offset_case = MISSING;		/*   path  ==> path$[entry path], but		*/
		end;				/*   path| ==> path|0			*/
	     end;

	if  (delim = "$") & (search (segment_id, "><") > 0)  then do;
						/* CASE: seg_id is a pathname.		*/
	     if length(segment_id) > 168 then do;
		code = error_table_$bigarg;
		go to ERROR;
		end;
	     end;
	else if delim = "$" then do;			/* CASE: seg_id is a ref_name.		*/
	     id_case = REF_NAME;
	     if length(segment_id) > 32 then do;
		code = error_table_$entlong;
		go to ERROR;
		end;
	     end;
	else if delim = "|" then;			/* CASE: seg_id is path.			*/
	else go to ERROR;				/* CASE: seg_id followed by bad delim.  We should	*/
						/*   never get to this line.			*/

	if length(word_offset) > 0 then do;		/* Evaluate word offset.			*/
	     offset_case = WORD;			/*   Start by assuming word offset.		*/
	     i = verify (word_offset, "01234567");	/*   Check for octal word offset.		*/
	     if i = 0 then;				/*   CASE: only word offset given.		*/
	     else do;				/*   CASE: no word offset, just entry_pt.	*/
		offset_case = ENTRY_PT;
		if length(word_offset) > 256 then do;	/*     Validate entry point length.		*/
		     code = error_table_$entlong;
		     go to ERROR;
		     end;
		end;
	     end;
	if  (delim = "$") & (id_case = PATHNAME) & (offset_case ^= ENTRY_PT) then do;
	     code = error_table_$improper_data_format;
	     go to ERROR;
	     end;
	if  (delim = "|") & (id_case = PATHNAME) & (offset_case = ENTRY_PT_DEFAULT) &
	    (search (segment_id, "><") = 0) then do;
	     id_case = REF_NAME;
	     if length(segment_id) > 32 then do;
		code = error_table_$entlong;
		go to ERROR;
		end;
	     end;

	if id_case = PATHNAME then do;		/* CASE: seg_id is path			*/
	     call expand_pathname_ (segment_id, dir, ent, code);
	     if code ^= 0 then go to ERROR;		/*     Expand the pathname given in virtual ptr.	*/
	     call object_lib_$initiate (dir, ent, ent, ""b, P, (0), (""b), code);
	     if P = null then go to ERROR;
	     end;
	else ent = segment_id;			/* CASE: seg_id = ref_name			*/


	if offset_case = MISSING then do;		/* No offset was given.			*/
	     call hcs_$make_entry (Pref, ent, "", E, code);
	     if code ^= 0 then go to ERROR;		/*     Get ptr to beginning of segment.		*/
	     end;
	else if offset_case = ENTRY_PT then do;		/* An entry point was given.			*/
	     call hcs_$make_entry (Pref, ent, word_offset, E, code);
	     if code ^= 0 then go to ERROR;
	     end;
	else if offset_case = ENTRY_PT_DEFAULT then do;	/* Default entry point name for a pathname given.	*/
	     call hcs_$make_entry (Pref, ent, ent, E, code);
	     if code ^= 0 then go to ERROR;
	     end;
	else do;					/* A word was given.			*/
	     word = cv_oct_check_ (word_offset, code);	/*     Convert/validate word offset.		*/
	     if code ^= 0 then do;
		code = error_table_$bad_conversion;
		go to ERROR;
		end;
	     if (0 <= word) & (word <= sys_info$max_seg_size) then;
	     else do;
		code = error_table_$out_of_bounds;
		go to ERROR;
		end;
	     call hcs_$make_entry (Pref, ent, "", E, code);
	     if code ^= 0 then go to ERROR;		/*     Get ptr to base of segment.		*/
						/*     Cause linkage to be combined.		*/
	     call cu_$decode_entry_value (E, P, null);	/*     Convert entry value into a pointer.	*/
	     P = ptr (P, word);			/*     Apply word offset to pointer.		*/
	     call cu_$make_entry_value (P, E);		/*     Convert pointer back to entry value.	*/
	     end;

	return (E);

/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */


ERROR:	Acode = code;
	return (cv_entry_);				/* return ptr to us, along with error code.	*/

/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */

	end cv_entry_;
   



		    cv_ptr_.pl1                     11/20/86  1404.5rew 11/20/86  1141.5      131877



/****^  ***********************************************************
        *                                                         *
        * Copyright, (C) Honeywell Information Systems Inc., 1982 *
        *                                                         *
        * Copyright (c) 1972 by Massachusetts Institute of        *
        * Technology and Honeywell Information Systems, Inc.      *
        *                                                         *
        *********************************************************** */


	

/****^  HISTORY COMMENTS:
  1) change(86-03-12,Ranzenbach), approve(86-03-12,MCR7143),
     audit(86-03-12,GWMay), install(86-05-01,MR12.0-1051):
     modified to support archive component names.
  2) change(86-07-08,Elhard), approve(86-07-08,MCR7391),
     audit(86-07-18,DGHowe), install(86-11-20,MR12.0-1222):
     Modified to call object_lib_$initiate to initiate non-archive pathname
     references, and to call object_lib_$get_def_target to perform definition
     search on segments or MSFs.
                                                   END HISTORY COMMENTS */


	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
	/*									*/
	/* NAME:  cv_ptr_								*/
	/*									*/
	/*      This subroutine converts virtual pointer character strings to pointer values.	*/
	/*									*/
	/* Status:								*/
	/*									*/
	/* 0) Created by  Gary C. Dixon  on October 22, 1976.				*/
	/* 1) Modified by Gary C. Dixon  on October 22, 1979 - support path$entry_pt, cleanup code*/
	/* 2) Modified by Paul W. Benjamin on August 31, 1981 - remove entrypoint name validation */
	/* 3) Modified 841128 by E. A. Ranzenbach for archive pathname support...		*/
	/*									*/
	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */



/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */


cv_ptr_:	procedure (string, Acode)
	returns 	(ptr);

     dcl						/*	Parameters			*/
     	string			char (*),		/* virtual pointer character string. (In)	*/
	Acode			fixed bin(35),	/* status code. (Out)			*/
	Aptr			ptr;		/* ptr to seg to be terminated. (In)		*/

     dcl						/*	Automatic Variables			*/
         (Lbit_offset, Lsegment_id, Lword_offset)
				fixed bin,	/* length of various parts of virtual pointer.	*/
         (Pbit_offset, Psegment_id, Pword_offset, Pdelim)
				ptr,		/* pointer to various parts of virtual pointer.	*/
	P			ptr,		/* returned pointer.			*/
	Ptarget			ptr,		/* pointer to target of searched definition	*/
	bc			fixed bin(24),	/* bit count of target segment.		*/
         (bit, segno, word)		fixed bin(35),	/* numeric parts of virtual pointer.		*/
	code			fixed bin(35),
	dir			char(168),	/* dir part of segment's pathname.		*/
	ent			char(32),		/* entry part of segment's pathname.		*/
	component			char(32),		/* component name...			*/
	i			fixed bin,
	id_case			fixed bin,	/* type of segment identifier in virtual pointer.	*/
						/*   1 = PATHNAME, 2 = REF_NAME, 3 = SEGNO.	*/
	offset_case		fixed bin;	/* type of offset value in virtual pointer.	*/
						/*   5 = MISSING, 6 = WORD, 7 = WORD_AND_BIT,	*/
						/*   8 = ENTRY_PT.				*/

     dcl						/*	Based Variables			*/
     	bit_offset		char(Lbit_offset) based (Pbit_offset),
	bit_offset_array (Lbit_offset) char(1) based(Pbit_offset),
     	bits (36)			bit(1) unaligned based,
	delim			char(1) based (Pdelim),
	segment_id		char(Lsegment_id) based (Psegment_id),
	string_array (length(string))	char(1) based (addr (string)),
	word_offset		char(Lword_offset) based (Pword_offset),
	word_offset_array (Lword_offset)
				char(1) based (Pword_offset);
 
     dcl (addr, baseno, baseptr, length, null, ptr, reverse, rtrim, search, verify)
				builtin;

     dcl						/*	Entries				*/
	cv_dec_check_		entry (char(*), fixed bin(35)) returns (fixed bin(35)),
	cv_oct_check_		entry (char(*), fixed bin(35)) returns (fixed bin(35)),
	expand_pathname_$component	entry (char(*), char(*), char(*), char(*), fixed bin(35)),
	initiate_file_$component	entry (char(*), char(*), char(*), bit(*), ptr, fixed bin(24), fixed bin(35)),
	hcs_$fs_get_path_name	entry (ptr, char(*), fixed bin, char(*), fixed bin(35)),
	hcs_$fs_get_seg_ptr		entry (char(*), ptr, fixed bin(35)),
	object_lib_$initiate	entry (char(*), char(*), char(*), bit(1), ptr, fixed bin(24), bit(1), fixed bin(35)),
	object_lib_$get_def_target	entry (ptr, fixed bin(24), char(*), char(*), bit(1), ptr, fixed bin(35)),
	terminate_file_		entry (ptr, fixed bin(24), bit(*), fixed bin(35));

     dcl						/*	Static Variables and Constants	*/
         (PATHNAME			init(1),		/* acceptable values which id_case may take on.	*/
	REF_NAME			init(2),
	SEGNO			init(3),
	MISSING			init(5),		/* acceptable values offset_case may take on.	*/
	WORD			init(6),
	WORD_AND_BIT		init(7),
	ENTRY_PT			init(8)) fixed bin int static options(constant),
	V_BAR			char(1) int static options(constant) init("|"),
         (error_table_$bad_conversion,
	error_table_$bigarg,
	error_table_$entlong,
          error_table_$improper_data_format,
	error_table_$out_of_bounds)	fixed bin(35) ext static,
	sys_info$max_seg_size	fixed bin(35) ext static;


%include access_mode_values;
%page;
%include definition;
%page;
%include object_info;
%page;
%include terminate_file;

/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */

	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
	/*									*/
	/* Acceptable virtual pointer strings have the following forms:			*/
	/*									*/
	/* CASES									*/
	/*  I O	FORM			COMMENT					*/
	/* -----	-----------------------	------------------------------------------	*/
	/*  1 5	path			= path|0(0)				*/
	/*  1 5	path|			= path|0(0)				*/
	/*  1 6	path|W			= path|W(0)				*/
	/*  1 7	path|W(B)			octal word W, decimal bit B of path		*/
	/*  1 8	path|entry_pt		word identified by entry point entry_pt in path	*/
	/*  1 8	path$entry_pt		word identified by entry point entry_pt in seg	*/
	/*				with pathname pat				*/
	/*									*/
	/*  2 5	ref_name$			= ref_name$0(0)				*/
	/*  2 6	ref_name$W		= ref_name$W(0)				*/
	/*  2 7	ref_name$W(B)		octal word W, decimal bit B of seg with reference	*/
	/*				name ref_name.				*/
	/*  2 8	ref_name$entry_pt		word identified by entry point entry_pt in seg	*/
	/*				with reference name ref_name			*/
	/*									*/
	/*  3 5	segno			= segno|0(0)				*/
	/*  3 5	segno|			= segno|0(0)				*/
	/*  3 6	segno|W			= segno|W(0)				*/
	/*  3 7	segno|W(B)		octal word W, decimal bit B of seg known by segno	*/
	/*  3 8	segno|entry_pt		word identified by entry point entry_pt in seg	*/
	/*				known by segno				*/
	/*									*/
	/* CASES:  I = segment identifier case (id_case), O = offset value case (offset_case).	*/
	/*	 I = 1 => PATHNAME			O = 5 => MISSING (no offset given)	*/
	/*	   = 2 => REF_NAME			  = 6 => WORD			*/
	/*	   = 3 => SEGNO			  = 7 => WORD_AND_BIT		*/
	/*					  = 8 => ENTRY_PT			*/
	/*									*/
	/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

	Acode = 0;				/* initialize return code.			*/
	code = error_table_$improper_data_format;	/* initialize format error code.		*/
	id_case = PATHNAME;				/* start by assuming we have a path segment	*/
	offset_case = MISSING;			/*   identifier, and no offset value.		*/
	component = "";

	Psegment_id = addr(string);			/* Split identifier into seg_id, delim, & offset. */
	i = search (reverse(string), "|$");		/* Look for the delimiter.			*/
	if i > 0 then i = length(string) - (i-1);
	if i = 0 then do;				/* CASE: No delimiter.			*/
	     Pdelim = addr(V_BAR);			/*   Assume |.				*/
	     Lsegment_id = length(rtrim(string));	/*   Address seg_id.			*/
	     Pword_offset = addr(Pword_offset);		/*   Indicate no word offset.			*/
	     Lword_offset = 0;
	     end;
	else do;					/* CASE: Delimiter found.			*/
	     Pdelim = addr(string_array(i));		/*   Remember delimiter.			*/
	     Lsegment_id = i-1;			/*   Address seg_id.			*/
	     Lsegment_id = length(rtrim(segment_id));
	     if i < length(string) then do;		/*   Look for word offset.			*/
		Pword_offset = addr(string_array(i+1)); /*     Remember where word offset is.		*/
		Lword_offset = length(string) - i;
		Lword_offset = length(rtrim(word_offset));
		i = verify(word_offset, " ");
		if i > 1 then do;
		     Pword_offset = addr(word_offset_array(i));
		     Lword_offset = Lword_offset - (i-1);
		     end;
		end;
	     else do;				/*   No word offset.			*/
		Pword_offset = addr(Pword_offset);
		Lword_offset = 0;
		end;
	     end;

	if verify (segment_id, "01234567") = 0 then	/* check for segno identifier.		*/
	     id_case = SEGNO;
	else if segment_id = "-1" then		/*     this includes null pointer segno.	*/
	     id_case = SEGNO;

	if  (delim = "$") & (search (segment_id, "><") > 0)  then do;
	     if id_case ^= PATHNAME then go to ERROR;	/* CASE: seg_id is a pathname.		*/
	     if length(segment_id) > 168 then do;
		code = error_table_$bigarg;
		go to ERROR;
		end;
	     end;
	else if delim = "$" then do;			/* CASE: seg_id is a ref_name.		*/
	     id_case = REF_NAME;
	     if length(segment_id) > 32 then do;
		code = error_table_$entlong;
		go to ERROR;
		end;
	     end;
	else if delim = "|" then;			/* CASE: seg_id is path or segno.		*/
	else go to ERROR;				/* CASE: seg_id followed by bad delim.  We should	*/
						/*   never get to this line.			*/

	if length(word_offset) > 0 then do;		/* Evaluate word offset.			*/
	     offset_case = WORD;			/*   Start by assuming word offset.		*/
	     i = verify (word_offset, "01234567");	/*   Check for octal word offset.		*/
	     if i = 0 then;				/*   CASE: only word offset given.		*/
	     else if (word_offset_array(i) = "(")  then do;
		code = error_table_$bad_conversion;
		offset_case = WORD_AND_BIT;
		if word_offset_array(Lword_offset) ^= ")" then
		     go to ERROR;
		Pbit_offset = addr(word_offset_array(i+1));
		Lbit_offset = Lword_offset - i - 1;	/*     Overlay the bit offset.		*/
		Lbit_offset = length(rtrim(bit_offset));
		Lword_offset = i - 1;		/*     Exclude bit from word offset.	*/
		Lword_offset = length(rtrim(word_offset));
		i = verify(bit_offset, " ");
		if i > 1 then do;
		     Pbit_offset = addr(bit_offset_array(i));
		     Lbit_offset = Lbit_offset - (i-1);
		     end;
		if verify (bit_offset, "0123456789") ^= 0 then do;
		     code = error_table_$bad_conversion;
		     go to ERROR;
		end;
	     end;
	     else do;			/*   CASE: no word offset, just entry_pt.	*/
		offset_case = ENTRY_PT;
		if length(word_offset) > 256 then do;	/*     Validate entry point length.		*/
		     code = error_table_$entlong;
		     go to ERROR;
		     end;
		end;
	     end;
	if  (delim = "$") & (id_case = PATHNAME) & (offset_case ^= ENTRY_PT) then do;
	     code = error_table_$improper_data_format;
	     go to ERROR;
	     end;

	if id_case = PATHNAME then do;		/* id_case = PATHNAME			*/
	     call expand_pathname_$component (segment_id, dir, ent, component, code);
	     if code ^= 0 then go to ERROR;		/*     Expand the pathname given in virtual ptr.	*/
	     end;

	else do;
	     if id_case = REF_NAME then do;		/* id_case = REF_NAME.			*/
		call hcs_$fs_get_seg_ptr (segment_id, P, code);
		if code ^= 0 then go to ERROR;	/*     Convert reference name to a pointer.	*/
		end;
	     else do;				/* id_case = SEGNO				*/
		segno = cv_oct_check_ (segment_id, code);
		if code ^= 0 then do;
		     code = error_table_$bad_conversion;
		     go to ERROR;
		     end;
		P = baseptr (segno);		/*     Convert segment number to a pointer.	*/
		if (segment_id = "-1") | (segment_id = "77777") | (segment_id = "777777") then do;
						/*     Special case null pointers.		*/
		     if offset_case = MISSING then return (null);
		     if offset_case = ENTRY_PT then do;
			code = error_table_$improper_data_format;
			go to ERROR;
			end;
		     go to OFFSET;
		     end;
		end;

	     call hcs_$fs_get_path_name (P, dir, 0, ent, code);
	     if code ^= 0 then go to ERROR;		/*     Convert pointer to a pathname.		*/
	     end;

	if component = "" then call object_lib_$initiate (dir, ent, "", ""b, P, bc, (""b), code);
	else call initiate_file_$component (dir, ent, component, R_ACCESS, P, bc, code);
	if P = null then go to ERROR;			/* Initiate segment identified by pathname	*/
	else code = 0;
						/*   with a null reference name.		*/

OFFSET:	if offset_case = MISSING then;		/* No offset was given.			*/
	else if offset_case = ENTRY_PT then do;		/* An entry point was given.			*/
	     if id_case = REF_NAME then
	          call object_lib_$get_def_target (P, bc, segment_id, word_offset, ""b, Ptarget, code);
	     else if component = "" then
		call object_lib_$get_def_target (P, bc, ent, word_offset, ""b, Ptarget, code);
	     else call object_lib_$get_def_target (P, bc, component, word_offset, ""b, Ptarget, code);

	     if code ^= 0 then goto ERROR;
	     P = Ptarget;
	end;
	else do;					/* A word, or word and bit offset was given.	*/
	     word = cv_oct_check_ (word_offset, code);	/*     Convert/validate word offset.		*/
	     if code ^= 0 then do;
		code = error_table_$bad_conversion;
		go to ERROR;
		end;
	     if (0 <= word) & (word <= sys_info$max_seg_size) then;
	     else do;
		code = error_table_$out_of_bounds;
		go to ERROR;
		end;
	     P = ptr (P, word);			/*     Apply word offset to pointer.		*/
	     if offset_case = WORD_AND_BIT then do;	/*     A bit offset was also given.		*/
		bit = cv_dec_check_ (bit_offset, code);	/*	 Convert/validate bit offset.		*/
		if code ^= 0 then do;
		     code = error_table_$bad_conversion;
		     go to ERROR;
		     end;
		if (0 <= bit) & (bit <= 35) then;
		else do;
		     code = error_table_$out_of_bounds;
		     go to ERROR;
		     end;
		P = addr (P -> bits (bit+1));		/*     Apply the bit offset.			*/
		end;
	     end;

	return (P);				/* return the pointer.			*/

/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */

/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */


ERROR:	Acode = code;
	return (null);				/* return a null pointer, with the error code.	*/

/*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  **  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */


terminate:	entry (Aptr);			/* Entry to terminate segs initiated by cv_ptr_.	*/

	if baseno(Aptr) = baseno(null) then return;	/* Do nothing about terminating null pointers.	*/
	call terminate_file_ (Aptr, 0, TERM_FILE_TERM, code);

	end cv_ptr_;






		    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

