
	LOGICAL FUNCTION DYNDB$BY_ID2( TOU, RET_ADR, IDR, SHOW_USER )

PURPOSE:  INTERFACE BETWEEN NON RMAIL PROGRAMS FOR USING THE ON-LINE
          DATABASE MAINTAINED IN MEMORY.  ALLOWS OTHER PROGRAMS TO
          SEARCH THE DATABASE FOR USERID'S PRESENCE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	DYNDB$BY_ID2	LOGICAL		INDICATES SUCCESS/FAILURE OF OPERATION
IN	TOU		CHR*12		USERNAME FOR INFO TO BE RETRIEVED.
RET	RET_ADR		CHR*64		MAIL ADDRESS STRING, INTERNAL FORMAT.
RET	IDR		INT*2		LENGTH OF MAIL ADDRESS STRING.

	SUBROUTINE DYNDB$BY_ID( FND, SND_ADR, IAD, SHOW_USER, TO_USER, IQ )

PURPOSE:  CHECKS THE ON-LINE DATABASE FOR A MATCH TO THE STRING
          CONTAINED IN THE VARIABLE:  'TOUSER'.   SETS A LOGICAL
          (FND) DEPENDING UPON STATUS OF SEARCH.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	FND		LOGICAL		INDICATES SUCCESS/FAILURE OF OPERATION
RET	SND_ADR		CHR*60		MAIL ADDRESS STRING, INTERNAL FORMAT.
RET	IAD		INT*2		LENGTH OF MAIL ADDRESS STRING.
RET	SHOW_USER	CHR*40		STRING FOR DISPLAY OF USER SELECTED.
IN	TO_USER		CHR*40		USERNAME FOR INFO TO BE RETRIEVED.
IN	IQ		INT*2		LENGTH OF USERNAME STRING PASSED IN.

	SUBROUTINE DYNDB$BY_USER( FND, SND_ADR, IAD, SHOW_USER, TO_USER, IQ )

PURPOSE:  TO SEARCH THE ON-LINE DATABASE FOR STRING MATCHES
          OF A STRING INPUT TO THE PROGRAM.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	FND		LOGICAL		INDICATES SUCCESS/FAILURE OF OPERATION
RET	SND_ADR		CHR*60		MAIL ADDRESS STRING, INTERNAL FORMAT.
RET	IAD		INT*2		LENGTH OF MAIL ADDRESS STRING.
RET	SHOW_USER	CHR*40		STRING FOR DISPLAY OF USER SELECTED.
IN	TO_USER		CHR*40		USERNAME FOR INFO TO BE RETRIEVED.
IN	IQ		INT*2		LENGTH OF USERNAME STRING PASSED IN.

	SUBROUTINE DYNDB$GEN_INFO( REMOTE_ID, DOMAIN, NODE, NETWORK, ADDRESS, IAD)

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	REMOTE_ID	CHR*20		THE DESTINATION USER IDENTIFICATION
IN	DOMAIN		CHR*20		THE DOMAIN, AS NEEDED, FOR REMOTE_ID.
IN	NODE		CHR*12		THE HOST NAME WHERE REMOTE_ID RESIDES.
IN	NETWORK		CHR*2		THE NETWORK SPECIFIER FOR THE USER.
RET	ADDRESS		CHR*255		COMPOSED ADDRESS FROM INFO PASSED IN.
RET	IAD		INT*2		LENGTH OF THE COMPOSED ADDRESS.

	SUBROUTINE	DISTR$BLD_ADRFILE( IN_STR, ISND )

PURPOSE:  GENERATE ADDRESS FROM PASSED STRING.  PASSED STRING COULD
          BE A NICKNAME, AN INTERNAL FORMAT ADDRESS, OR A LIFENET ID.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	====,==		======================================
IN/RET	IN_STR		CHR*(*)		PASSED IN AS AN INTERNAL ADDRESS TYPE
					FROM THE RMAIL PROGRAM.  PASSED BACK
					AS AN EXTERNAL MAIL ADDRESS.
IN	ISND		INT*4		FLAG FOR ACTION TO TAKE WITH THE
					ADDRESS GENERATED.  IF ISND = 0, THEN
					THE ADDRESS IS WRITTEN TO LUN 32.
					OTHERWISE ADDRESS RETURNED TO PROGRAM.

	SUBROUTINE	NICK$GET_DATA( NICKNAME, NICKUSER, NICKADR, ICONT )

PURPOSE:  ROUTINE TO READ THE NICKNAME DATA FILE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	NICKNAME	CHR*12		NICKNAME REQUESTED.
RET	NICKUSER	CHR*60		DESCRIPTION OF NICKNAME REQUESTED.
RET	NICKADR		CHR*60		ADDRESS FROM INDEX FILE OF NICKNAME REQUESTED.
RET	ICONT		INT*4		FLAG INDICATING CONDITION OF READ OPERATION.

	SUBROUTINE	NICK$REMOVE( NICKNAME )

PURPOSE:  ROUTINE FOR REMOVING NICKNAMES FROM DATA FILE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	NICKNAME	CHR*12		NICKNAME TO BE REMOVED.

	SUBROUTINE	NICK$PUT_DATA( NICKNAME, NICKUSER, NICKADR, NEWOLD )

PURPOSE:  ROUTINE TO WRITE A NICKNAME RECORD TO THE DATA FILE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	NICKNAME	CHR*12		NICKNAME TO WRITTEN TO DIRECTORY.
IN	NICKUSER	CHR*60		DESCRIPTION OF NICKNAME TO BE WRITTEN.
IN	NICKADR		CHR*60		ADDRESS OF NICKNAME TO BE WRITTEN.
IN	NEWOLD		INT*4		FLAG INDICATING OVERWRITE CONDITION.

	SUBROUTINE	NICK$OPEN( )

PURPOSE:  ROUTINE TO OPEN THE NICKNAME DATA FILE.




	SUBROUTINE	NICK$CLOSE( )

PURPOSE:  ROUTINE TO CLOSE THE NICKNAME DATA FILE.

	SUBROUTINE	REMD$MAIL_FOLDER( MAIL_DATA )

PURPOSE:  LIST NAMES OF FOLDERS AND ALLOW USER TO SELECT NEW FOLDER.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN/RET	MAIL_DATA	RECORD		CONTAINS INFORMATION NEEDED FOR THE
					MAIL SYSTEM CALLABLE INTERFACE.  SEE
					FILE 'LIFE_DEV:REMD$DEC.INC'.

	INTEGER FUNCTION	MAIL_FOLDER( FOLDCNT, FOLDER )

PURPOSE:  DECLARED BY REMD$MAIL_FOLDER INTERNALLY.  THIS IS AN ACTION
          ROUTINE WHICH WRITES OUT THE FOLDERS AVAILABLE FOR USE BY USER.
          IT IS GENERALLY NOT USABLE OUTSIDE THE REMD$MAIL_FOLDER INTERFACE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET     MAIL_FOLDER	INT*4		FUNCTION STATUS.
IN/RET	FOLDCNT		INT*4		COUNT OF FOLDERS FOUND.
IN	FOLDER		CHR*(*)		VARIABLE LENGTH CHARACTER STRING.
					CONTAINS NAME OF FOLDER FOUND.

ROUTINE IS CONTINUOUSLY CALLED BY THE VMS MAIL CALLABLE INTERFACE FUNCTION
UNTIL ALL FOLDERS HAVE BEEN LISTED.  ROUTINE STORES THE FOLDER NAMES IN A
LOCAL VIRTUAL ARRAY SPACE.  ONCE ALL FOLDERS HAVE BEEN DISPLAYED, THE USER
IS ALLOWED TO SELECT A SPECIFIC FOLDER AS HIS SECONDARY FOLDER.  THE NAME
OF THIS FOLDER IS PASSED BACK TO THE ORIGINAL CALLING ROUTINE VIA A LABELED
COMMON ELEMENT.

	LOGICAL FUNCTION	NICK$GET_ADDRESS(GENNET, INT_ADR)

PURPOSE:  PROVIDES THE MENU INTERFACE FOR THE RMAIL NICKNAME CREATION FUNCTION.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	NICK$GET_ADDRESS   LOGICAL	FUNCTION STATUS RETURN
IN/RET	GENNET		RECORD		RECORD CONTAINING INFORMATION ABOUT
					PREVIOUS ADDRESSES SELECTED/CREATED
					BY THE RMAIL PROGRAM.  USED TO MAINTAIN
					A LIST OF LAST 20 ADDRESSES FOR MAIL
					SEND FUNCTION.  CONTROLS ACTION OF THIS
					FUNCTION, DEPENDS UPON SOURCE OF CALL.
RET	INT_ADR		CHR*60		INTERNAL FORMAT ADDRESS GENERATED AS
					A RESULT OF THE SELECTION MADE.

ROUTINE IS A GENERIC DRIVER FOR OTHER GNRL_LIFE.FOR LIBRARY ROUTINES.

	INTEGER FUNCTION	NICK$PARSE_DOMAIN( LDOM, TMPDOM, LNOD, DOMAIN, NODEID )

PURPOSE:  TAKES THE DOMAIN FIELD AND THE NODE FIELD PROVIDED BY THE USER AND
          SPLITS THE RESULTING HOST ADDRESS INTO FIELDS THAT WILL FIT INTO
          THE NICKNAME DATABASE FIELDS.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	NICK$PARSE_DOMAIN  INT*4	FUNCTION RETURN STATUS
IN/RET	LDOM		INT*2		IN:  LENGTH OF TEMPORARY DOMAIN FIELD.
					RET:  LENGTH OF FINAL DOMAIN FIELD.
IN	TMPDOM		CHR*32		TEMPORARY DOMAIN FIELD.
IN/RET	LNOD		INT*2		LENGTH OF THE HOST FIELD.
RET	DOMAIN		CHR*(*)		FINAL DOMAIN FIELD.
IN/RET	NODEID		CHR*(*)		FINAL HOST FIELD.

	SUBROUTINE	NICK$GET_DEFAULTS( LOCNET, DOMAIN, NODIED )

PURPOSE:  TO DEFINE DEFAULT VALUES FOR THE DOMAIN AND NODE FIELDS
          DEPENDING UPON THE NETWORK TYPE.

	THIS ROUTINE IS NOT IMPLEMENTED, NO REQUIREMENT FOR IT YET.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	LOCNET		CHR*2		NETWORK CODE SPECIFICATION.
RET	DOMAIN		CHR*20		DEFAULT DOMAIN VALUE.
RET	NODEID		CHR*12		DEFAULT HOST VALUE.

	SUBROUTINE	GNRL$MENU_DISP( TRMNL, NM )

PURPOSE:  GENERAL PURPOSE MENU DISPLAY ROUTINE FOR THE NICK$GET_ADDRESS
          FUNCTION.  CONTROLS DISPLAY OF NETWORK TYPES, AND THEIR SELECTION.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	TRMNL		RECORD		TERMINAL ESCAPE SEQUENCE RECORD STRUCTURE.
IN/RET	NM		RECORD		NICKNAME MENU INTERFACE RECORD STRUCTURE.

	INTEGER FUNCTION	GNRL$GET_INFO( LSTR, GET_PROMPT, LOC_STR )

PURPOSE:  GENERIC ROUTINE FOR PROMPTING USER TO PROVIDE SPECIFIED INFO.
          USED BY THE NICK$GET_ADDRESS FUNCTION.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	LSTR		INT*2		LENGTH OF THE PROMPT STRING.
IN	GET_PROMPT	CHR*(*)		PROMPT STRING PROVIDED.
RET	LOC_STR		CHR*(*)		RETURN VALUE PROVIDED BY USER.

	SUBROUTINE	GNRL$DO_SEND( LTIME, SUBJECT, TFILE, SEND_FILE )


PURPOSE:  TO CREATE FILES FOR SENDING A MAIL MESSAGE, THEN SUBMIT
          THE JOB FOR ACTUALLY SENDING THE MESSAGE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	LTIME		CHR*7		TIME STRING USED TO GENERATE TEMPORARY
					FILE NAMES WITHIN PROCEDURE.
IN	SUBJECT		CHR*80		SUBJECT OF THE MAIL MESSAGE BEING SENT.
IN	TFILE		CHR*64		FILE CONTAINING FINAL SEND ADDRESSES.
IN	SEND_FILE	CHR*64		FILE CONTAINING TEXT OF MESSAGE TO BE SENT.

	SUBROUTINE	NICK$CHECK_X400( X400_PROF_ON )

PURPOSE:  CHECK ELIGIBILITY OF USER TO SEND TO AN X.400 ADDRESS.  USED BY
          NICK$GET_ADDRESS TO SWITCH ON DISPLAY OF X.400 ADDRESSING.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	X400_PROF_ON	LOGICAL		TRUE:  USER CAN SEND TO X.400 AND PROFS.
					FALSE:  USER CANNOT SEND TO X.400 OR PROFS.

	SUBROUTINE	BMS$FROM_PARSE( FM_USR, SUBJ, LSR )

PURPOSE:  PARSES THE FM_USR STRING TO CREATE AN ADDRESS IMBEDDED INTO THE
          SUBJECT STRING OF THE MESSAGE BEING SENT.  SUPPORTS MRGATE, SMTP,
          AND OTHER COMMON MAIL ADDRESSES ORIGINATIONS.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	FM_USR		CHR*80		ORIGINATOR OF MESSAGE.
IN/RET	SUBJ		CHR*255		IN:  SUBJECT OF ORIGINAL MESSAGE.
					OUT:  SUBJECT CONTAINING ORIGINATOR ADDRESS.
IN/RET	LSR		INT*4		IN:  LENGTH OF ORIGINAL MESSAGE SUBJECT.
					OUT:  LENGTH OF NEW MESSAGE SUBJECT.

	SUBROUTINE	BMS$TO_PARSE( TO_USR, SUBJ )

PURPOSE:  PARSES THE SUBJECT STRING TO CREATE ADDRESS TO SEND MAIL TO.  ASSUMES
          MESSAGE IS A REPLY TO A MESSAGE SENT OUT VIA BMS SYSTEM.  THEREFORE
          SUBJECT OF MESSAGE SHOULD CONTAIN PROPER SYNTAX FOR FORWARDING THE
          REPLY TEXT ONWARD TO THE FINAL DESTINATION.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
RET	TO_USR		CHR*80		THE DESTINATION ADDRESS (FINAL FORM).
IN/RET	SUBJ		CHR*255		IN:  SUBJECT STRING WITH EMBEDDED BMS
					RETURN ADDRESS, USED TO CREATE TO_USR.
					OUT:  SUBJECT WITHOUT EMBEDDED ADDRESS.


	SUBROUTINE	GNRL$LOGTRANS( PASLOG, TABLE, RTNVAL, LOG_LEN )

PURPOSE:  GENERAL PURPOSE ROUTINE TO RETURN VALUE OF A LOGICAL NAME
          CONTAINED IN A SPECIFIED LOGICAL NAME TABLE.

	ARGUMENT:	TYPE:		DESCRIPTION:
	=========	=======		======================================
IN	PASLOG		CHR*(*)		LOGICAL FOR WHICH VALUE IS DESIRED.
IN	TABLE		CHR*(*)		LOGICAL NAME TABLE TO FIND LOGICAL IN.
RET	RTNVAL		CHR*(*)		VALUE FOUND FOR LOGICAL NAME.
RET	LOG_LEN		INT*4		LENGTH OF THE LOGICAL NAME VALUE.
