Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-06 - 43,50414/ipcf10.rnd
There are no other files named ipcf10.rnd in the archive.
.SP 1 .S 3 .AP
^^PROGRAM SPECIFICATIONS
.S 5 .C
IPCF
.S 2 .C
F\\ORTRAN-10 ^^IPCF R\\OUTINES
.S 12 .I 21
^DATE:#16-^FEB-76
.I 21
^FILE:#^^IPCF.RNO\\
.I 19
^AUTHOR:#^M.#^BARNES
.TITLE ^FORTRAN-10 ^^IPCF\\ ^ROUTINES
.ST ^ABSTRACT
.PG
.C
^ABSTRACT
.S 3
 ^THE ^^IPCF\\ PACKAGE OF SUBROUTINES ALLOWS THE ^FORTRAN-10
(OR ^MACRO, POSSIBLY ^COBOL) USER EASY ACCESS TO THE MONITOR'S
^INTER-^PROCESS ^COMMUNICATIONS ^FACILITY (^^IPCF\\).
^ROUTINES ARE PROVIDED TO ACCESS ALL ^^IPCF\\ ^^UUO\\'S
(^^IPCFR., IPCFS., IPCFQ.\\) PLUS EASY USE OF MANY ^^[SYSTEM]INFO\\
AND ^^[SYSTEM]IPCC\\ FUNCTIONS. ^THIS DOCUMENT ALSO HOPES
TO PROVIDE SOME USEFUL KNOWLEDGE ABOUT ^^IPCF\\
DIFFICULT TO OBTAIN FROM THE SECTION ON ^^IPCF\\ IN ^^DEC'\\S
^MONITOR ^CALLS ^MANUAL.
.SKIP 1
 ^ALL THE SUBROUTINES ARE TYPE INTEGER AND ALL ARGUMENTS TO THEM
ARE INTEGER, EXCEPT WHERE NOTED. ^NO ATTEMPT WAS MADE TO MAKE
THESE ROUTINES CALLABLE BY ANYTHING BUT ^FORTRAN-10 CALLING
CONVENTIONS.
.ST ^BACKGROUND ^INFORMATION
.PG
.C
^BACKGROUND ^INFORMATION
.S 3
 ^THE FOLLOWING INFORMATION IN THIS SECTION IS COPIED FROM THE
^DECSYSTEM-10 ^MONITOR ^CALLS ^MANUAL (CHAPTER 15) AND IS INTENDED
TO GIVE THE USER WHO IS UNFAMILIAR WITH ^^IPCF\\ SOME BACKGROUND
INFORMATION.
.S 2
 ^THE ^INTER-^PROCESS ^COMMUNICATION ^FACILITY (^^IPCF\\),
A FEATURE OF THE ^^DEC\\SYSTEM-10 ^MONITOR (5.07 AND LATER),
PROVIDES A CAPABILITY FOR COMMUNICATION BETWEEN JOBS RUNNING
ON THE SYSTEM. ^THIS COMMUNICATION IS ACCOMPLISHED BY THE
USE OF THREE ^^UUO\\'S: ^^IPCFS., IPCFR.,\\ AND ^^IPCFQ.\\
.S 1
 ^JOBS COMMUNICATE BY SENDING "PACKETS" OF INFORMATION
(USING THE ^^IPCFS. UUO\\) THAT CONTAIN A DESTINATION AND A
RETURN ADDRESS, SOME FLAGS, AND DATA. ^THE RECEIVER OF A
PACKET CAN FIND OUT IF A PACKET HAS BEEN SENT (^^IPCFQ.\\)
AND RETRIEVE IT (^^IPCFR.\\). ^WHEN RECEIVING A PACKET, A JOB
WILL HAVE A "MAILBOX" IN THE FORM OF A SHORT LINEAR ^^FIFO\\
QUEUE. ^PACKETS FROM A SENDER (OR SENDERS) ARE PUT IN THIS
QUEUE AND REMAIN UNTIL THE RECEIVING JOB RETRIEVES THEM.
.S 1
 ^THERE IS A SEND PACKET QUOTA AND RECEIVE PACKET QUOTA PER
JOB WHICH CAN BE SET BY EACH INSTALLATION. ^THE DEFAULT SEND
PACKET QUOTA IS TWO PER JOB; THE DEFAULT RECEIVE PACKET QUOTA
IS FIVE PER JOB. ^THESE QUOTAS PERTAIN TO OUTSTANDING SENDS
AND RECEIVES ONLY. ^FOR EXAMPLE (ASSUMING THE DEFAULT LIMIT
OF TWO), IF A JOB SENDS TWO PACKETS, NO MORE PACKETS
CAN BE SENT BY THAT JOB UNTIL ONE OR BOTH OF ITS PREVIOUSLY
SENT PACKETS HAS FIRST BEEN RETRIEVED BY THE INTENDED
RECEIVER. ^IF THE RECEIVER HAS FIVE (ASSUMING THE DEFAULT LIMIT)
PACKETS IN ITS RECEIVE QUEUE THAT IT HAS NOT YET RECEIVED,
IT CANNOT RECEIVE ANY MORE PACKETS UNTIL IT HAS RETRIEVED
AT LEAST ONE OF THE FIVE WAITING PACKETS.
.S 1
 ^THERE ARE TWO SYSTEM PROCESSES UTILIZED BY ^^IPCF:
[SYSTEM]INFO\\ AND ^^[SYSTEM]IPCC. [SYSTEM]INFO\\ ACTS AS THE
INFORMATION CENTER FOR ^^IPCF\\ AND PERFORMS SEVERAL
FUNCTIONS RELATED TO ^^PID\\'S AND NAMES. ^^[SYSTEM]IPCC\\
IS THE ^^IPCF\\ CONTROLLER, AND IT PERFORMS MANY PACKET
CONTROLLING FUNCTIONS. ^A JOB CAN SEND A PACKET TO BOTH OF THESE
SYSTEM PROCESSES.
.AP
.ST ^ABOUT ^^PID\\S
.PG
.C
^ABOUT ^^PID\\S
.S 2
 ^A ^^PID\\(PROCESS ^I.^D.) IS A 36-BIT VALUE THAT SUBSTITUTES
FOR A USER DECLARED SYMBOLIC NAME. ^THE ^^PID\\ SERVES AS A
DESTINATION OR SOURCE ADDRESS FOR A PACKET AND REMAINS ASSIGNED
TO THE NAME AS LONG AS THE USER WISHES TO USE THAT NAME. ^THE
ASSOCIATION BETWEEN A ^^PID\\ AND A NAME IS ALWAYS RELEASED
WHEN THE JOB LOGS OFF THE SYSTEM OR THROUGH A REQUEST TO
^^[SYSTEM]INFO\\. ^ALTERNATIVELY, THE JOB MAY REQUEST THAT
THE ASSOCIATION BE FREED WHEN A ^^RESET UUO\\ IS EXECUTED.
^AFTER A ^^PID\\ IS RELEASED, THE SAME VALUE IS NOT RE-USED.
^THIS PROTECTS AGAINST ANY MESSAGES BEING SENT TO THE WRONG
JOB BY ACCIDENT.
.S 1
 ^THE USER ACQUIRES A ^^PID\\ BY DECLARING A NAME (I.E. BY
NOTIFYING ^^[SYSTEM]INFO\\ OF THIS NAME) AND REQUESTING
THAT A ^^PID\\ BE ASSIGNED TO THE NAME. ^THE NAME CANNOT
DUPLICATE OTHER NAMES IN USE AT THE SAME INSTALLATION AND
HAS CERTAIN RESTRICTIONS.
.S 1
 ^THE SYMBOLIC NAME IS LIMITED TO 30 CHARACTERS AND CANNOT
CONTAIN ANY CONTROL CHARACTERS EXCEPT ^^TAB\\. ^IN ORDER
TO INITIATE COMMUNICATION BETWEEN JOBS, THERE SHOULD BE A
MUTUAL UNDERSTANDING BETWEEN THE TWO JOBS OF THE SYMBOLIC
NAMES TO BE USED. ^THIS FREES THE COMMUNICATIONS PROCEDURE
FROM ANY DEPENDENCIES ON SYSTEM CHARACTERISTICS THAT MIGHT
CHANGE BETWEEN EXECUTIONS.
.S 2
^EXAMPLES:
.S 1
.LITERAL
		[SYSTEM]PHOTOCOMP
		FILEPROCESSOR[10,1521]
		PHOTOCOMP[SYSTEM]
		TEST['ANY',151]
.END LITERAL
.S 2
 ^IN ORDER TO PREVENT A MALICIOUS OR CARELESS USER FROM ASSIGNING
A NAME THAT YOU WANT, A SMALL RESTRICTION IS PLACED ON THE
KINDS OF NAMES THAT MAY APPEAR WITHIN SQUARE BRACKETS. ^THE
ONLY THINGS THAT MAY APPEAR ARE:
.S 1
.LITERAL
		[PROJ.#,PROG.#]
		['ANY',PROG.#]
		['ANY','ANY']
		[PROJ.#,'ANY']
		[SYSTEM]
.END LITERAL
.S 1
 ^A JOB MAY SPECIFY ^^[SYSTEM]\\ AS PART OF THE NAME ONLY IF
THE JOB IS PRIVILEGED. ^WHEN TRYING TO FIND THE ^^PID\\ OF A NAME,
THE NAME MUST BE SPECIFIED EXACTLY AS IT APPEARS, CHARACTER FOR
CHARACTER.
.ST ^USING THE ^ROUTINES
.PG
.C
^USING THE ^ROUTINES
.S 3
 ^ALL THE ^FORTRAN-10 ^^IPCF\\ ROUTINES ARE AVAILABLE IN
^^IPCF10.REL\\. ^A LIST OF ALL MODULE NAMES IS GIVEN
BELOW SO THE USER CAN AVOID HAVING TO DEAL WITH
MULTIPLY DEFINED GLOBAL MODULE NAMES.
.S 1
^MODULE NAMES:
.S 2
.LITERAL
	INFCIW	INFCIG	INFCII	INFCIJ	INFCID
	INFCIR	INFCIL	INFZZA	INFZZB	INFZZC
	IPCSE	IPCSD	IPCSI	IPCSJ	IPCSR
	IPCZZA	IPCFSH	ZERBLK	IPCTAB	IPCFQ
	IPCFR	IPCFS
.END LITERAL
.S 2
 ^IN ADDITION, ^^IPCF10\\ REQUIRES AN ADDITIONAL MODULE:
^^LSH\\. ^^LSH\\ PERFORMS A LOGICAL SHIFT. ^SINCE THIS MODULE
IS COMMONLY USED, THE AUTHOR HAS DECIDED NOT TO INCLUDE
IT IN ^^IPCF10\\. ^IF ^^LSH\\ IS NOT AVAILABLE, A LISTING
IS GIVEN BELOW IN ^^MACRO\\ SO THE USER CAN HAVE ACCESS TO
IT.
.S 2
.LITERAL
			TITLE	LSH
			ENTRY	LSH
		LSH:	MOVE	1,@1(16)
			MOVE	@(16)
			LSH	(1)
			POPJ	17,
			END
.END LITERAL
.ST ^ROUTINE ^DESCRIPTIONS
.PG
.LITERAL




















.END LITERAL
.C
^^ROUTINE DESCRIPTIONS\\
.ST ^^IPCF UUO'\\S
.PG
.C
^^IPCFS\\
.S 1 .C
^SEND A PACKET TO THE SPECIFIED PID OR JOB NUMBER
.S 2
^CALL:
.I 8
^^ERROR#=#IPCFS(FLAGS,SENDP,RECP,PACKET,LEN)\\
.S 2
 ^SEND THE ^^LEN\\ WORD ARRAY ^^PACKET\\ TO THE USER WHOSE
PID IS ^^RECP\\. ^IF NO ERROR OCCURS ^^ERROR\\ IS SET TO
ZEROES, OTHERWISE IT CONTAINS THE ERROR CODE RECEIVED FROM
^^IPCF\\ IN BITS 30-35. ^IF YOU SEND ZERO AS YOUR ^^SENDP\\
THEN ^^IPCF\\ WILL FILL IN YOUR JOB NUMBER.
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	HAVE [SYSTEM]INFO ASSIGN A PID (FUNCTION 3)
C
	IMPLICIT INTEGER(A-Z)
	DIMENSION PACKET(2)
C
C	FILL PACKET WITH RIGHT THINGS
C
	PACKET(1) = 3			! .IPCSI (ASSIGN A PID)
	PACKET(2) = 'MYPID'		! ASCII OF PID
C
C	SEND PACKET
C
	ERROR = IPCFS(0,0,0,PACKET,2)
.END LITERAL
.PG
.C
^^IPCFR\\
.S 1 .C
^RECEIVE NEXT PACKET (IF ANY) FROM ^^IPCF\\
.S 2
^CALL:
.I 8
^^ERROR#=#IPCFR(FLAGS,SENDP,RECP,PACKET,LEN,SENPPN,CAP)\\
.S 2
 ^^IPCFR\\ RETRIEVES AN ^^IPCF\\ PACKET FROM THE JOB'S RECEIVE
QUEUE. ^^LEN\\ AND ^^FLAG\\ MUST BE SET UP PRIOR TO THE
CALL. ^USING ^^IPCFQ\\ OR THE ASSOCIATE VARIABLE OBTAINED
FROM A PREVIOUS ^^IPCFR\\ CALL, THE LENGTH (^^LEN\\) OF THE
PACKET MAY BE OBTAINED. ^AFTER THE PACKET HAS BEEN RECEIVED,
ITS CONTENTS (^^LEN\\ WORDS) GET PLACED IN ^^PACKET\\. ^THE
ACTUAL FLAGS FROM THE PACKET REPLACE THE VALUE OF ^^FLAGS\\ THAT
^^IPCFR\\ WAS CALLED WITH. ^^SENDP\\ AND ^^RECP\\ ARE REPLACED
WITH THE VALUES OF THE SENDERS PID AND RECEIVERS PID. ^^SENPPN\\
IS FILLED WITH THE ^^PPN\\ OF THE SENDER. ^^CAP\\ CONTAINS
THE CAPABILITIES OF THE PACKET SENDER. ^THE POSSIBLE
CAPABILITIES OF A SENDER ARE LISTED BELOW (BY BIT POSITION):
.S 1 .NJ
########0#######^^IP.JAC########T\\HE SENDER HAS THE ^^JACCT\\ BIT
##############################TURNED ON
########1#######^^IP.JLG########T\\HE SENDER IS LOGGED IN
########2#######^^IP.SXO########T\\HE SENDER IS EXECUTE-ONLY
########3#######^^IP.POK########T\\HE SENDER HAS ^^POKE\\ PRIVILEGES
########4#######^^IP.IPC########T\\HE SENDER IS AN ^^IPCF\\
##############################PRIVILEGED JOB
.J .S 2
 ^UPON RETURN, ^^ERROR\\ CAN CONTAIN ONE OF THREE THINGS:
IF ZERO, A PACKET WAS RECEIVED AND NO ERROR CONDITION WAS
DETECTED. ^IF THE LEFT HALF OF ^^ERROR\\ (BITS 0-17)
IS ZERO, THEN THE RIGHT HALF CONTAINS A STANDARD ERROR CODE.
^IF THE LEFT HALF IS NOT ZERO THEN ^^ERROR\\ IS AN ASSOCIATE
VARIABLE. ^THIS INDICATES THAT A PACKET WAS RECEIVED AND
THAT MORE PACKETS ARE IN YOUR ^^IPCF\\ QUEUE AND SHOULD BE
RECEIVED VIA ^^IPCFR\\. ^THE ASSOCIATE VARIABLE CONTAINS
BOTH THE LENGTH AND RIGHT HALF OF THE FLAG WORD OF THE NEXT
PACKET IN THE QUEUE. ^THE FORMAT OF THE ASSOCIATE VARIABLE
IS AS FOLLOWS:
.LM 10 .S 1 .NJ
^^
------------------------------------
[#######LEN#####I##RH\\#OF#^FLAG#WORD#]
------------------------------------
.J .LM 0 .S 2
.PG
.C
^^IPCFQ\\
.S 1 .C
^RETURN THE STATUS OF THE NEXT PACKET IN THE INPUT QUEUE
.S 2
^CALL:
.I 8
^^ERROR#=#IPCFQ(FLAGS,SENDP,RECP,MESWRD,SENPPN,CAP)\\
.S 2
 ^^IPCFQ\\ WILL CHECK THE STATUS OF THE NEXT PACKET IN THE
RECEIVER'S QUEUE. ^IT IS WISE TO QUERY ^^IPCF\\ (WITH ^^IPCFQ\\)
BEFORE A JOB TRIES TO RECEIVE ITS FIRST PACKET, IN ORDER
TO DETERMINE WHETHER OR NOT THE FIRST PACKET IS A PAGE
OR N-NUMBER OF WORDS. ^IF THE MESSAGE IN THE QUEUE IS A PAGE,
THE RECEIVER MUST SET BIT 19 IN ^^FLAGS\\ WHEN RECEIVING THE
PACKET WITH ^^IPCFR\\.
.S 1
 ^^FLAGS, SENP, RECP, SENPPN,\\ AND ^^CAP\\ ALL CONTAIN THE
SAME INFORMATION THEY WOULD IF YOU WERE TO RECEIVE THE PACKET
WITH ^^IPCFR\\ (SEE ^^IPCFR\\). ^THE LEFT HALF OF ^^MESWRD\\
CONTAINS THE LENGTH OF THE MESSAGE. ^^ERROR\\ CONTAINS
ZERO IF NO ERROR WAS DETECTED, ELSE THE ^^IPCF\\ ERROR CODE
IN BITS 30-35. ^CONFUSING (AND MISLEADING) IS THE FACT THAT
IF YOU USE ^^IPCFQ\\ AND THERE IS NO PACKET IN THE
QUEUE, NO ERROR MESSAGE IS RETURNED. ^THE FOLLOWING EXAMPLE
IN PEUSDO ^FORTRAN-10 WILL DEMONSTRATE HOW TO CHECK FOR THIS.
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	RETURN STATUS OF THE FIRST PACKET IN QUEUE
C	SET X TO 1 IF NO PACKET
C
	IMPLICIT INTEGER(A-Z)
	X = 0			!ASSUME PACKET THERE
	SENDP = 0		!ENABLE TRAP IF PACKET THERE
	ERROR = IPCFQ(FLAGS,SENDP,RECP,MESWRD,SENPPN,CAP)
	IF (ERROR .NE. 0) GOTO (SOME OTHER IPCF ERROR)
	IF (SENDP .NE. 0) GOTO 10 !PACKET THERE
	X = 1			!NO PACKET SINCE NO
				!SENDER'S PID
10	[PROGRAM CONTINUES]
.END LITERAL
.ST ^LIBRARY ^INFORMATION
.PG
.AP .C
^^INFLIB\\ AND ^^IPCLIB\\ ^INFORMATION
.S 3
 ^^INFLIB\\ AND ^^IPCLIB\\ ARE TWO LIBRARIES (COLLECTION
OF SUBROUTINES) WHICH AID IN USING ^^[SYSTEM]INFO\\ AND
^^[SYSTEM]IPCC\\ RESPECTIVELY. ^FOR MORE INFORMATION SEE
CHAPTER 15 IN THE ^MONITOR ^CALLS ^MANUAL. ^^INFLIB\\ AND
^^IPCLIB\\ ROUTINES WORK IN BASICALLY THE SAME MANNER.
^THAT SEQUENCE IS OUTLINED BELOW:
.S 1
.C
^CLEAR ^PACKET
.C
^SET UP ^PACKET
.C
^SEND ^PACKET (^^IPCFS\\)
.C
^CLEAR ^PACKET
.C
^RECEIVE ^PACKET (^^IPCFR\\)
.C
^RETURN RESULTS
.S 2
^SPECIAL NOTICE:
.S 1
 ^BECAUSE ^^INFLIB\\ AND ^^IPCLIB\\ ROUTINES SEND AND RECEIVE
PACKETS, A RESTRICTION MUST BE MADE. ^WHENEVER ONE OF THESE
ROUTINES IS CALLED THE USER MUST INSURE THAT NO PACKETS
ARE IN THE INPUT QUEUE (^^IPCFSH\\ CAN DO THIS) AND THAT NONE
ARE RECEIVED DURING THE SUBROUTINE'S EXECUTION (UNLIKELY).
.S 2
^^INFLIB\\ AND ^^IPCLIB\\ COMMON PARAMETERS:
.S 1
 ^BOTH LIBRARIES USE COMMON PARAMETERS IN THEIR CALLS. ^A
LIST OF THESE PARAMETERS AND THEIR DEFINITIONS FOLLOW.
.S 1
^^NAME\\
.LM 10
^FIVE WORD ARRAY WHICH USUALLY CONTAINS ^^ASCII\\
CHARACTERS FOR A ^^PID\\ NAME.
.S 1 .LM 0
^N
.LM 10
^NUMBER OF WORDS TO BE USED FROM ^^NAME\\.
.S 1 .LM 0
^^CODE\\
.LM 10
^AN 18-BIT USER DECLARED QUANTITY ASSOCIATING THE ANSWER
WITH THE APPROPRIATE REQUEST. ^IT IS SUGGESTED THAT THE USER
ALWAYS USE ZERO FOR ^^CODE\\.
.S 1 .LM 0
^^COPY\\
.LM 10
^^COPY\\ IS THE ^^PID\\ OR JOB NUMBER OF THE JOB THAT IS TO
RECEIVE A DUPLICATE OF THE RESPONSE. ^IF ^^COPY\\ CONTAINS
ZERO, THE RESPONSE IS SENT ONLY TO THE ORIGINATOR OF THE
REQUEST.
.S 1 .LM 0
^^PID\\
.LM 10
^PROCESS ^I^D
.S 1 .LM 0
^^JOBNUM\\
.LM 10
JOB NUMBER
.S 1 .LM 0
^^FLAGS\\
.LM 10
^FLAG WORD RETURNED FROM ^^IPCFR\\
.S 1 .LM 0
^^ERROR\\
.LM 10
^IF ^^ERROR\\ IS ZERO THEN NO ERROR WAS DETECTED. ^BITS 12-17
INDICATE A SEND ERROR (^^IPCFS\\) WAS DETECTED IN THE ^^AC\\.
^BITS 24-29 INDICATE A RECEIVE ERROR DETECTED IN THE FLAGS,
AND BITS 30-35 INDICATE A RECEIVE ERROR (^^IPCFR\\) DETECTED
IN THE ^^AC\\.
.LM 0
.ST ^^INFLIB\\ ^ROUTINES
.PG
.C
^^INFCIW\\
.S 1 .C
^FIND THE ^^PID\\ ASSOCIATED WITH ^^NAME\\
.S 2
^CALL:
.I 8
^^PID#=#INFCIW(NAME,N,CODE,COPY,ERROR)\\
.S 2
 ^GIVEN AN ^^ASCII NAME (UP TO 29 CHARACTERS IN ARRAY
^^NAME\\) ^^[SYSTEM]INFO\\ ATTEMPTS TO FIND (AND RETURN)
THE ^^PID\\ ASSOCIATED WITH IT. ^THE MOST COMMON ERROR
CODE IS "76 (^AN UNKNOWN NAME HAS BEEN SPECIFIED).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	GET PID OF [SYSTEM]IPCC
C
	IMPLICIT INTEGER(A-Z)
	DIMENSION NAME(5)
C
C	SET UP NAME
C
	NAME(1) = '[SYST'
	NAME(2) = 'EM]IP'
	NAME(3) = 'CC'
C
C	GET PID
C
	PID = INFCIW(NAME,3,0,0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^INFCIG\\
.S 1 .C
^RETURN NAME OF SPECIFIED ^^PID\\
.S 2
^CALL:
.I 8
^^FLAGS#=#INFCIG(PID,NAME,CODE,COPY,ERROR)\\
.S 2
 ^GIVEN A ^^PID\\, ^^[SYSTEM]INFO\\ ATTEMPTS TO FIND THE NAME
ASSOCIATED WITH IT. ^THE NAME IS RETURNED IN THE FIVE
WORD ARRAY ^^NAME\\. ^THE MOST COMMON ERROR CODE IS "74
(^UNKNOWN ^^PID\\ HAS BEEN SPECIFIED).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	GET NAME OF 'PID'
C
	IMPLICIT INTEGER(A-Z)
	DIMENSION NAME(5)
	[PROGRAM CONTINUES]
	DO 10 I1 = 1,5
10	NAME(I1) = 0
	PID = (WHATEVER)
C
C	GET NAME
C
	FLAGS = INFCIG(PID,NAME,0,0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^INFCII\\
.S 1 .C
^GET ^^PID\\ BASED ON ^^NAME\\ (GOOD TILL ^^RESET UUO)\\
.S 2
^CALL:
.I 8
^^PID#=#INFCII(NAME,N,CODE,COPY,ERROR)\\
.S 2
 ^^[SYSTEM]INFO\\ WILL CREATE A ^^PID\\ SPECIFIED BY ^^NAME\\
(^N WORD ARRAY, UP TO 29 CHARACTERS (5 WORDS MAX)). ^THE
^^PID\\ WILL BE DISASSOCIATED FROM THE JOB NUMBER WHEN THE
JOB PERFORMS A ^^RESET UUO\\. ^COMMON ERROR CODES ARE "20
(^^PID\\ TABLE FULL... THIS IS RARE), "73 (YOUR ^^PID\\
QUOTA (DEFAULT IS TWO AT ANY ONE TIME) HAS BEEN EXCEEDED),
"75 (DUPLICATE NAME EXISTS), AND "77 (^^NAME\\ CONTAINS
ILLEGAL CHARACTERS).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	GET A PID FOR THE NAME 'SAILMAILFAIL'
C
	IMPLICIT INTEGER(A-Z)
	DIMENSION NAME(5)
C
C	SET UP NAME
C
	NAME(1) = 'SAILM'
	NAME(2) = 'AILFA'
	NAME(3) = 'IL'
C
C	GET PID
C
	PID = INFCII(NAME,3,0,0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^INFCIJ\\
.S 1 .C
^GET ^^PID\\ BASED ON ^^NAME\\ (GOOD TILL LOGOUT)
.S 2
^CALL:
.I 8
^^PID#=#INFCIJ(NAME,N,CODE,COPY,ERROR)\\
.S 2
 ^SAME AS ^^INFCII\\ EXCEPT THAT THE PID IS GOOD UNTIL THE
JOB LOGS OUT.
.PG
.C
^^INFCID\\
.S 1 .C
^DROP SPECIFIED ^^PID\\
.S 2
^CALL:
.I 8
^^FLAGS#=#INFCID(PID,CODE,COPY,ERROR)\\
.S 2
 ^^[SYSTEM]INFO\\ WILL DISASSOCIATE THE SPECIFIED ^^PID\\ FROM
ITS JOB NUMBER. ^THIS FUNCTION CAN ONLY BE REQUESTED BY THE
OWNER OF THE SPECIFIED ^^PID\\, UNLESS THE REQUESTER IS AN
^^IPCF\\ PRIVILEGED USER. ^THE MOST COMMON ERROR CODE IS
"74 (UNKNOWN ^^PID\\).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	DISASSOCIATE THE PID 'PID'
C
	IMPLICIT INTEGER(A-Z)
	[PROGRAM CONTINUES]
	PID = (WHATEVER)
C
C	REMOVE PID
C
	FLAGS = INFCID(PID,0,0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^INFCIR\\
.S 1 .C
^DROP ALL ^^PID\\S CREATED BY ^^INFCII\\
.S 2
^CALL:
.I 8
^^FLAGS#=#INFCIR(JOBNUM,CODE,COPY,ERROR)\\
.S 2
 ^^[SYSTEM]INFO\\ WILL DISASSOCIATE ALL ^^PID\\S THAT WERE
CREATED BY ^^INFCII\\ AND ARE ASSOCIATED WITH THE SPECIFIED
JOB NUMBER. ^THIS FUNCTION CAN BE REQUESTED ONLY BY THE
OWNER OF THE SPECIFIED JOB, UNLESS THE REQUESTER IS AN
^^IPCF\\ PRIVILEGED USER.
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	DISASSOCIATE ALL 'INFCII PIDS' FOR MY JOB
C
	IMPLICIT INTEGER(A-Z)
	JOBNUM = (MY JOB NUMBER)
	FLAGS = INFCIR(JOBNUM,0,0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^INFCIL\\
.S 1 .C
^DROP ALL ^^PID\\S CREATED BY ^^INFCIJ\\
.S 2
^CALL:
.I 8
^^FLAGS#=#INFCIR(JOBNUM,CODE,COPY,ERROR)\\
.S 2
 ^^[SYSTEM]INFO\\ WILL DISASSOCIATE ALL ^^PID\\S THAT WERE
CREATED BY ^^INFCIJ\\ AND ARE ASSOCIATED WITH THE SPECIFIED
JOB NUMBER. ^THIS FUNCTION CAN BE REQUESTED ONLY BY THE
OWNER OF THE SPECIFIED JOB, UNLESS THE REQUESTER IS AN
^^IPCF\\ PRIVILEGED USER. ^SEE ALSO ^^INFCIR\\.
.ST ^^IPCLIB R\\OUTINES
.PG
.C
^^IPCSE\\
.S 1 .C
^ENABLE JOB TO RECEIVE PACKETS
.S 2
^CALL:
.I 8
^^ERROR#=#IPCSE(JOBNUM,CODE)\\
.S 2
 ^^[SYSTEM]IPCC\\ WILL ALLOW THE SPECIFIED JOB NUMBER
TO RECEIVE PACKETS. ^IF THE REQUESTER IS NOT THE OWNER OF THE
JOB SPECIFIED, IT MUST HAVE ^^IPCF\\ PRIVILEGES. ^THE MOST
COMMON ERROR CODE IS "15 (INSUFFICIENT PRIVILEGES).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	ENABLE 'MYJOB' TO RECEIVE PACKETS
C
	IMPLICIT INTEGER(A-Z)
	MYJOB = (MY JOB NUMBER)
	ERROR = IPCSE(MYJOB,0)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^IPCSD\\
.S 1 .C
^DISABLE JOBS ABILITY TO RECEIVE PACKETS
.S 2
^CALL:
.I 8
^^ERROR#=#IPCSD(JOBNUM,CODE)\\
.S 2
 ^^[SYSTEM]IPCC\\ WILL DISABLE THE SPECIFIED JOB'S ABILITY
TO RECEIVE PACKETS. ^IF THE REQUESTING JOB IS NOT THE OWNER
OF THE SPECIFIED JOB NUMBER, IT MUST HAVE ^^IPCF\\ PRIVILEGES.
^THE MOST COMMON ERROR CODE IS "15 (INSUFFICIENT PRIVILEGES).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	DISABLE ABILITY OF 'MYJOB' TO RECEIVE PACKETS
C
	IMPLICIT INTEGER(A-Z)
	MYJOB = (MY JOB NUMBER)
	ERROR = IPCSE(MYJOB,0)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^IPCSI\\
.S 1 .C
^RETURN PID OF ^^[SYSTEM]INFO\\
.S 2
^CALL:
.I 8
^^PID#=#IPCSI(CODE,ERROR)\\
.S 2
 ^^[SYSTEM]IPCC\\ WILL RETURN THE ^^PID\\ ASSOCIATED WITH
^^[SYSTEM]INFO\\. ^THE VALUE RETURNED WILL BE FOR THE LOCAL
^^[SYSTEM]INFO\\ (IF THERE IS ONE) OR SECONDLY THE GLOBAL
^^[SYSTEM]INFO\\. ^IT IS RECOMMENDED THAT THE USER
INSTEAD USE ^^IPCTAB\\ TO OBTAIN THE PID OF ^^[SYSTEM]INFO\\.
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	GET PID OF [SYSTEM]INFO
C
	IMPLICIT INTEGER(A-Z)
	PID = IPCSI(0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^IPCSJ\\
.S 1 .C
^RETURN JOB NUMBER ASSOCIATED WITH SPECIFIED ^^PID\\
.S 2
^CALL:
.I 8
^^JOBNUM#=#IPCSJ(PID,CODE,ERROR)\\
.S 2
 ^^[SYSTEM]IPCC\\ WILL RETURN THE JOB NUMBER ASSOCIATED
WITH THE SPECIFIED ^^PID\\. ^THE MOST COMMON ERROR CODE IS
"74 (^UNKNOWN ^^PID\\).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	RETURN JOB NUMBER OF [SYSTEM]INFO
C
	IMPLICIT INTEGER(A-Z)
	PID = IPCSI(0,ERROR)
	IF (ERROR .NE. 0) GOTO (ERROR HANDLER)
	JOBNUM = IPCSJ(PID,0,ERROR)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^IPCSR\\
.S 1 .C
^GET SEND AND RECEIVE QUOTAS OF SPECIFIED JOB
.S 2
^CALL:
.I 8
^^ERROR#=#IPCSR(JOBNUM,SENDQ,RECQ,CODE)\\
.S 2
 ^^[SYSTEM]IPCC\\ WILL RESPOND WITH THE SEND AND RECEIVE
QUOTAS ASSOCIATED WITH THE SPECIFIED JOB. ^THE SEND QUOTA
WILL BE RETURNED IN ^^SENDQ\\; THE RECEIVE QUOTA WILL BE RETURNED
IN ^^RECQ\\. ^PROBABLE ERRORS INCLUDE "17 (BAD JOB NUMBER
SPECIFIED).
.S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	FIND AND PRINT SEND AND RECEIVE QUOTAS FOR MY JOB
C
	IMPLICIT INTEGER(A-Z)
	MYJOB = (MY JOB NUMBER)
	ERROR = IPCSR(MYJOB,SENDQ,RECQ,0)
C
C	PRINT RESULTS
C
	IF (ERROR .NE. 0) GOTO 10
	WRITE(5,20) SENDQ
	WRITE(5,30) RECQ
10	STOP
20	FORMAT(' SEND QUOTA: ',I3)
30	FORMAT(' RECEIVE QUOTA: ',I3)
	END
.END LITERAL
.ST ^OTHER ROUTINES
.PG
.C
^^IPCTAB\\
.S 1 .C
^MISCELLANEOUS DATA ON ^^IPCF\\
.S 2
^CALL:
.I 8
^^RESULT#=#IPCTAB(ITEM)
.S 2
 ^^IPCTAB\\ RETURNS VARIOUS TYPES OF INFORMATION ABOUT ^^IPCF\\
DEPENDING ON THE VALUE OF ^^ITEM\\. ^THE ALLOWABLE VALUES AND
THEIR RESPECTIVE FUNCTIONS ARE SHOWN BELOW:
.S 1
.NJ .LM 5
0##%^^IPCML\\###^MAXIMUM PACKET LENGTH
.BR
1##%^^IPCSI\\###^^PID\\ OF SYSTEM-WIDE ^^[SYSTEM]INFO\\
.BR
2##%^^IPCDQ\\###^DEFAULT QUOTA
.BR
3##%^^IPCTS\\###^TOTAL PACKETS SENT
.BR
4##%^^IPCTO\\###^TOTAL PACKETS OUTSTANDING
.BR
5##%^^IPCCP\\###^^PID\\ OF ^^[SYSTEM]IPCC\\
.BR
6##%^^IPCPM\\###^^PID\\ MASK ("377)
.BR
7##%^^IPCMP\\###^LENGTH OF ^^PID\\ TABLE
.BR
8##%^^IPCNP\\###^NUMBER OF ^^PID\\'S NOW DEFINED
.BR
9##%^^IPCTP\\###^TOTAL ^^PID\\'S DEFINED SINCE RELOAD
.LM 0
.J .S 2
^EXAMPLE:
.S 1
.LITERAL
C
C	GET PID OF [SYSTEM]INFO
C
	IMPLICIT INTEGER(A-Z)
	PID = IPCTAB(1)
	[PROGRAM CONTINUES]
.END LITERAL
.PG
.C
^^IPCFSH\\
.S 1 .C
^FLUSH ANY PACKETS IN ^^IPCF\\ QUEUE
.S 2
^CALL:
.I 8
^^NUM#=#IPCFSH(ERROR)\\
.S 2
 ^^IPCFSH\\ WILL RECEIVE ANY PACKETS WAITING IN THE
^^IPCF\\ QUEUE. ^THE NUMBER OF PACKETS FLUSHED IS RETURNED
IN ^^NUM\\. ^THE LAST ERROR RETURNED (FROM ^^IPCFR\\) IS
STORED IN ^^ERROR\\. ^THIS FUNCTION IS GOOD FOR INITIALIZING
ANY ^^IPCF\\ ACTIVITY, SINCE IT HELPS INSURE THAT YOUR PROGRAM
WILL HANDLE ONLY THE PACKETS IT WISHES TO.
.ST ^^IPCF\\ ^ERROR CODES
.PG
.C
 ^ERROR ^CODES
.SKIP 2
.NOFILL
.NOJUSTIFY
.LM 10
#1###^AN ADDRESS CHECK WAS ENCOUNTERED
#2###^THE BLOCK IS NOT LONG ENOUGH
#3###^THERE IS NO PACKET IN THE RECEIVE QUEUE
#5###^THE DATA IS TOO LONG FOR THE USER'S BUFFER
#6###^DESTINATION UNKNOWN
#7###^THE DESTINATION HAS BEEN DISABLED
10###^THE SENDERS QUOTA HAS BEEN EXCEEDED
11###^THE RECEIVER'S QUOTA HAS BEEN EXCEEDED
12###^THERE IS NO ROOM IN SYSTEM STORAGE
13###^SENDER SPECIFIED INVALID PAGE NUMBER
14###^SENDER'S ^^PID\\ INVALID AS SPECIFIED
15###^INSUFFICIENT PRIVILEGES
16###^UNKNOWN FUNCTION SPECIFIED
17###^BAD JOB NUMBER HAS BEEN SPECIFIED
20###^^PID\\ TABLE IS FULL
21###^BIT 19 WAS SET IN FLAGS WORD, BUT FIRST
#####PACKET WAS NOT A PAGE OR VISA VERSA
22###^PAGING ^^I/O\\ ERROR
23###^A BAD INDEX HAS BEEN SPECIFIED FOR SYSTEM ^^PID\\
#####TABLE
24###^UNDEFINED ^^ID\\ IN SYSTEM ^^PID\\ TABLE
70###^^[SYSTEM]INFO\\ HAS AN INTERNAL ERROR
71###^^[SYSTEM]IPCC\\ REQUEST FROM ^^[SYSTEM]INFO\\ FAILED
72###^^[SYSTEM]INFO\\ FAILED TO COMPLETE A REQUEST
73###^THE ^^PID\\ QUOTA HAS BEEN EXCEEDED
74###^UNKNOWN ^^PID\\ HAS BEEN SPECIFIED
75###^A DUPLICATE NAME HAS BEEN SPECIFIED
76###^AN UNKNOWN NAME HAS BEEN SPECIFIED
77###^THE NAME SPECIFIED HAS ILLEGAL CHARACTERS
.FILL
.JUSTIFY
.LM 0