From - Fri Apr 23 19:36:30 1999
Path: reader2.news.rcn.net!feed1.news.rcn.net!rcn!dispose.news.demon.net!demon!news.demon.co.uk!demon!ccastat.demon.co.uk!not-for-mail
From: Chris Sharman <Chris.Sharman@CCAgroup.co.uk>
Newsgroups: comp.os.vms
Subject: Re: FTP API for DEC Pascal
Date: Fri, 23 Apr 1999 15:24:07 +0100
Organization: CCA Group
Message-ID: <37209097.6EF37067@CCAgroup.co.uk>
References: <7fp9nn$9ng$1@nnrp1.dejanews.com>
NNTP-Posting-Host: ccastat.demon.co.uk
X-NNTP-Posting-Host: ccastat.demon.co.uk:158.152.158.126
X-Trace: news.demon.co.uk 924877407 nnrp-11:23274 NO-IDENT ccastat.demon.co.uk:158.152.158.126
X-Complaints-To: abuse@demon.net
X-Mailer: Mozilla 3.03Gold (X11; I; OpenVMS V7.1     AlphaStation 255/233)
MIME-Version: 1.0
To: Renault Thuillier <pcoent@lucent.com>
Content-Type: multipart/mixed; boundary="------------906E14768126BD41F944B2"
Lines: 837
Xref: reader2.news.rcn.net comp.os.vms:228613

This is a multi-part message in MIME format.

--------------906E14768126BD41F944B2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Renault Thuillier wrote:
> 
> I am looking for an FTP API (client only) that could called from DEC Pascal
> (OpenVMS 6.2, TCP/IP (UCX)).
> I have to do a lot of FTP transactions between Vax and a NT serveur.
>  I know that I can use bunch of DCL (*.com), but I'd like to integrate these
> fonctions into
> my VMS applications. Does anyone out there have any ideas ?

Attached is a quick hack I did some time ago: it replaces the top level
module
of madgoat ftp (source conveniently available), and links to form a
shareable image.

Sorry it's Pascal, I'd have written it in Bliss if I could.
Usual copyrights & disclaimers etc, but it may help, or provide a
starting point for you to
do your own hack.

The performance was stunning (previously we were using DECnet to get Mac
files).

--------------906E14768126BD41F944B2
Content-Type: text/plain; charset=iso-8859-1; name="ftp_api.pas"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="ftp_api.pas"

[IDENT('V0.01'),
 ENVIRONMENT,
 INHERIT('sys$share:starlet',
	 'sys$share:pascal$cli_routines',
	 'sys$share:pascal$lib_routines')]
MODULE {PROGRAM} ftp_api{OUTPUT};

{
PROGRAM DESCRIPTION:

    FTP api interface for use by postscript driver

    © Copyright CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancs, ENGLAND.
    No warranty expressed or implied.

AUTHORS:

      Chris Sharman

CREATION DATE: 27-OCT-1998

MODIFICATION HISTORY:

Date          Name
        Description
%[change_entry]%...
}

[HIDDEN] VAR
    done_setup, connected: BOOLEAN VALUE FALSE;
    curhost, curuser, curpass: VARYING [30] OF CHAR VALUE '';

    ftp$_not_logged_in, ftp$_account_error, ftp$_received_file,
	ftp$_login_error, ftp$_no_action: [EXTERNAL,VALUE,READONLY] INTEGER;

    orig_batch_flag, batch_flag, vms_flag, quiet_flag, ! for setup
	logged_in, silent_flag, host_set, send_abor, ftp_parse,
	expected_response: [EXTERNAL] INTEGER; ! used by connect

    lnm$system_table, local_username, lclhost_name: [GLOBAL] dsc1$type VALUE
	[dsc$b_dtype:dsc$k_dtype_t; dsc$b_class:dsc$k_class_s; OTHERWISE ZERO];
    lower_username, command_line, anon_password,
	    remhost_name: [GLOBAL] dsc1$type VALUE
	[dsc$b_dtype:dsc$k_dtype_t; dsc$b_class:dsc$k_class_d; OTHERWISE ZERO];
    username_buffer: [GLOBAL] PACKED ARRAY [1..20] OF CHAR;
    saved_conn_info: [GLOBAL,LONG(100)] RECORD END; ! actual size 304
    exec_mode: [GLOBAL] INTEGER VALUE psl$c_exec;
    exit_status: [GLOBAL] INTEGER VALUE ss$_normal;
    command_port: [GLOBAL] INTEGER VALUE 21;
    verify_flag, restore_params, exit_flag: [GLOBAL] INTEGER;


[HIDDEN] CONST
    lnmsys = 'LNM$SYSTEM_TABLE';
    FTP$C_READY_FOR_NEW_USER = 220; ! Connected & ready
    FTP$C_USER_IN = 230; ! user logged in - proceed
    FTP$C_NEED_PASSWORD = 331; ! user accepted, now send password
    FTP$C_NEED_ACCOUNT = 332; ! need account to complete login
    FTP$C_NOT_LOGGED_IN = 530; ! user not logged in
    FTP$C_ACCOUNT_NEEDED = 532; ! need account to store files

[HIDDEN] PROCEDURE hash_default_off; EXTERNAL;
[HIDDEN] PROCEDURE set_reply_on; EXTERNAL;
[HIDDEN] PROCEDURE close_conn; EXTERNAL;
[HIDDEN] PROCEDURE net_purge; EXTERNAL;
[HIDDEN] PROCEDURE tot_sum( n: INTEGER ); EXTERNAL;
[HIDDEN] FUNCTION net_init(
	%stdescr host: PACKED ARRAY [l..u:INTEGER] OF CHAR;
	%immed cmd_port: UNSIGNED ): UNSIGNED; EXTERNAL;
[HIDDEN] FUNCTION net_get_response( VAR resp: UNSIGNED ): UNSIGNED; EXTERNAL;
[HIDDEN] FUNCTION cvt_response_to_status( %immed resp: UNSIGNED ): UNSIGNED; EXTERNAL;
[HIDDEN] PROCEDURE net_send( %stdescr s: PACKED ARRAY [l..u:INTEGER] OF CHAR); EXTERNAL;
[HIDDEN] PROCEDURE save_command( VAR old: UNSIGNED ); EXTERNAL;
[HIDDEN] PROCEDURE restore_command( %immed old: UNSIGNED ); EXTERNAL;
[HIDDEN] PROCEDURE save_reply( VAR old: UNSIGNED ); EXTERNAL;
[HIDDEN] PROCEDURE restore_reply( %immed old: UNSIGNED ); EXTERNAL;
[HIDDEN] PROCEDURE save_parameters( VAR old_type, old_mode, old_stru,
				old_type_size: UNSIGNED ); EXTERNAL;
[HIDDEN] PROCEDURE change_parameters( %immed old_type, old_mode, old_stru,
				old_type_size: UNSIGNED ); EXTERNAL;
[HIDDEN] PROCEDURE set_command_off; EXTERNAL;
[HIDDEN] PROCEDURE set_reply_off; EXTERNAL;
[HIDDEN] PROCEDURE normal_case; EXTERNAL;
[HIDDEN] FUNCTION uncomment(
	%stdescr parm: PACKED ARRAY [l..u:INTEGER] OF CHAR): UNSIGNED; EXTERNAL;

[HIDDEN] FUNCTION send_string (	s: PACKED ARRAY [l..u:INTEGER] OF CHAR;
				VAR response: UNSIGNED ): UNSIGNED;
    BEGIN
    net_purge;
    net_send(s);
    send_string := net_get_response(response);
    END;

[HIDDEN,GLOBAL] FUNCTION indirected: UNSIGNED;
    BEGIN
    indirected := ZERO;
    END;

[HIDDEN,GLOBAL] FUNCTION add_to_rdirq: UNSIGNED;
    BEGIN
    add_to_rdirq := ZERO;
    END;

[HIDDEN] PROCEDURE ftpapi_setup;
    BEGIN ! no action for /PORT /CASE /CONTROL_C /ERROR /SEVERE /WARNING
    lnm$system_table.dsc$w_maxstrlen := LENGTH(lnmsys);
    lnm$system_table.dsc$a_pointer := IADDRESS(lnmsys);
    local_username.dsc$w_maxstrlen := SIZE(username_buffer);
    local_username.dsc$a_pointer := IADDRESS(username_buffer);
    lclhost_name.dsc$w_maxstrlen := 128; ! host_name_max_size
    lclhost_name.dsc$a_pointer :=
	IADDRESS(saved_conn_info)+36; ! CONN_T_LCLHOSTBUF
    normal_case;
    hash_default_off;
    orig_batch_flag := cli$_defaulted;
    batch_flag := 1;
    verify_flag := cli$_absent;
    vms_flag := cli$_negated;
    set_reply_off;
    quiet_flag := cli$_present;
    exit_flag := 1;
    done_setup := TRUE;
    END;

[HIDDEN] PROCEDURE ftpapi_connect(
	host_name: PACKED ARRAY [l..u:INTEGER] OF CHAR);
    VAR
	sts, response: UNSIGNED;
    BEGIN
    IF NOT done_setup THEN ftpapi_setup;
    IF ODD(host_set) THEN close_conn;
    net_purge;
    tot_sum(0);
    IF NOT ODD(silent_flag) THEN expected_response := FTP$C_READY_FOR_NEW_USER;
    logged_in := ZERO;
    sts := net_init(host_name, command_port);
    IF ODD(sts) THEN
	BEGIN
	sts := net_get_response(response);
	IF ODD(sts) THEN sts := cvt_response_to_status(response);
	END;
    IF NOT ODD(sts) THEN
	lib$signal(sts)
    ELSE
	curhost := host_name;
    END;

[HIDDEN] PROCEDURE ftpapi_login(
	user: PACKED ARRAY [l1..u1:INTEGER] OF CHAR;
	pass: PACKED ARRAY [l2..u2:INTEGER] OF CHAR);
    CONST
	acct = 'missing';
    VAR
	old, sts, response: UNSIGNED;
    BEGIN
    IF NOT ODD(silent_flag) THEN expected_response := FTP$C_NEED_PASSWORD;
    send_string('USER '+user, response);
    expected_response := -1;
    REPEAT ! to handle multiple passwords
	IF NOT ODD(host_set) THEN
	    lib$signal(FTP$_NOT_LOGGED_IN,0)
	ELSE
	    CASE response OF
		FTP$C_NEED_PASSWORD:
		    BEGIN
		    save_command(old);
		    set_command_off;
		    sts := send_string('PASS '+pass, response);
		    restore_command(old);
		    IF ODD(sts) THEN sts := cvt_response_to_status(response);
		    IF NOT ODD(sts) THEN lib$signal(sts);
		    END;
		FTP$C_NEED_ACCOUNT: send_string('ACCT '+acct, response);
		FTP$C_ACCOUNT_NEEDED: lib$signal(FTP$_ACCOUNT_ERROR, 0);
		FTP$C_USER_IN: BREAK;
		OTHERWISE BREAK;
		END;
    UNTIL FALSE;
    logged_in := 1;
    IF (response=FTP$C_NOT_LOGGED_IN) THEN
	BEGIN
	logged_in := 0;
	lib$signal(FTP$_LOGIN_ERROR, 0);
	END
    ELSE
	BEGIN
	sts := cvt_response_to_status(response);
	IF NOT ODD(sts) THEN
	    lib$signal(sts)
	ELSE
	    BEGIN
	    curuser := user;
	    curpass := pass;
	    exit_flag := 0;
	    connected := TRUE;
	    END;
	END;
    END;
{
[HIDDEN] PROCEDURE ftpapi_disconnect;
    BEGIN
    IF connected AND_THEN ODD(host_set) THEN
	BEGIN
	close_conn;
	connected := FALSE;
	END;
    END;
}

[HIDDEN] FUNCTION ftpapi_command(cmd: VARYING [u] OF CHAR): UNSIGNED;
    VAR
	sts, rsp, oldty, oldmode, oldstru, oldts: UNSIGNED;
    BEGIN
    IF NOT connected OR_ELSE NOT ODD(host_set) THEN
	BEGIN
	ftpapi_connect(curhost);
	ftpapi_login(curuser, curpass);
	END;
    save_parameters(oldty, oldmode, oldstru, oldts);
    restore_params := 0;
    sts := cli$dcl_parse(cmd, ftp_parse);
    IF NOT ODD(sts) THEN lib$stop(sts);
    IF ODD(sts) THEN sts := cli$dispatch;
    IF NOT ODD(sts) THEN lib$stop(sts);
    IF ODD(send_abor) THEN
	BEGIN
	send_string('ABOR', rsp);
	send_abor := 0;
	END;
    IF ODD(restore_params) THEN
	change_parameters(oldty, oldmode, oldstru, oldts);
    ftpapi_command := sts;
    END;

[HIDDEN,GLOBAL] FUNCTION do_command( VAR dsc: [TRUNCATE] dsc1$type): UNSIGNED;
    VAR
	s: VARYING [510] OF CHAR;
    BEGIN
    IF NOT PRESENT(dsc) THEN
	do_command := rms$_eof
    ELSE
	BEGIN
	lib$scopy_dxdx (
            source_string := %ref dsc,
            destination_string := %descr s);
	do_command := ftpapi_command(s);
	END;
    END;

[HIDDEN,GLOBAL] FUNCTION restore_case( VAR dsc: dsc1$type ): UNSIGNED;
    VAR
	parm: VARYING [510] OF CHAR;
    BEGIN
    lib$scopy_dxdx (
	source_string := %ref dsc,
	destination_string := %descr parm);
    IF (LENGTH(parm)>1) AND_THEN (parm[1]='"') THEN
	restore_case := uncomment(%ref dsc)
    ELSE
	restore_case := 1;
    END;

[HIDDEN] TYPE
    iarray = ARRAY [0..5] OF INTEGER;
[HIDDEN] VAR
    sigsts: [VOLATILE] UNSIGNED;
    localname: [VOLATILE] VARYING [nam$c_maxrss] OF CHAR;

[ASYNCHRONOUS,UNBOUND,HIDDEN] FUNCTION get_handler (
	VAR sig: iarray;
	VAR mch: chf2$type ): UNSIGNED;
    BEGIN
    IF (sig[0]<1) {OR_ELSE NOT ODD(sig[1])} THEN
	get_handler := ss$_resignal
    ELSE IF NOT ODD(sig[1]) THEN
	BEGIN
	sigsts := sig[1];
	IF (sigsts=ftp$_no_action) THEN
	    get_handler := lib$sig_to_ret(sig, mch)
	ELSE
	    get_handler := lib$sig_to_stop(sig, mch);
	END
    ELSE
	BEGIN
	IF (sig[1]=ftp$_received_file) AND_THEN (sig[2]=2) THEN
	    lib$scopy_dxdx (
            	source_string := %immed sig[4],
            	destination_string := %descr localname);
	IF ('(Local) '=localname[1..7]) THEN
	    localname := localname[8..LENGTH(localname)];
	sigsts := sig[1];
	get_handler := ss$_continue;
	END;
    END;

[GLOBAL] FUNCTION ftpapi_get( VAR s: VARYING [u] OF CHAR;
		     image: [TRUNCATE] BOOLEAN ): UNSIGNED;
    VAR
	i, j, k: INTEGER;
	sts: UNSIGNED;
	c: CHAR;
	cmd: VARYING [510] OF CHAR;
	parm: VARYING [30] OF CHAR;
    BEGIN
    ESTABLISH(get_handler);
    i := INDEX( s, '::' );
    IF (i<=1) THEN
	ftpapi_get := ss$_ivnodnam
    ELSE
	BEGIN
	parm := s[1..i-1];
	j := INDEX(parm, '"');
	IF (j>1) THEN parm.length := j - 1;
	IF (curhost<>parm) THEN
	    BEGIN
	    ftpapi_connect(parm);
	    IF (j>1) THEN
		BEGIN
		parm := parm.body[j+1..i-2]; ! user pass
		k := INDEX(parm, ' ');
		ftpapi_login(parm[1..k-1], parm[k+1..LENGTH(parm)]);
		END
	    ELSE
		ftpapi_login('macval','macval');
	    END;
	localname := s[i+1..LENGTH(s)];
	cmd := 'get/log';
	IF PRESENT(image) AND_THEN image THEN cmd := cmd + '/type=image';
	cmd := cmd + ' "';
	REPEAT
	    i := FIND_MEMBER( localname, [':','[',']','.'] );
	    IF (i>1) THEN cmd := cmd + localname[1..i-1] + '/';
	    c := localname[i];
	    localname := localname[i+1..LENGTH(localname)];
	UNTIL (c=']');
	cmd := cmd + localname + '" ftp_scratch_txt';
	IF PRESENT(image) AND_THEN image THEN
	    cmd[LENGTH(cmd)-2..LENGTH(cmd)] := 'bin';
	sts := ftpapi_command(cmd);
	IF ODD(sts) THEN sts := sigsts;
	IF ODD(sts) THEN s := localname;
	ftpapi_get := sts;
	END;
    END;

{
FUNCTION _ftpapi_get( s: VARYING [u] OF CHAR;
			image: [TRUNCATE] BOOLEAN ): UNSIGNED;
    VAR
	vs: VARYING [80] OF CHAR;
	sts: UNSIGNED;
    BEGIN
    vs := s;
    sts := ftpapi_get(vs, PRESENT(image) AND_THEN image);
    WRITELN(sts:1:16, ' > ', vs);
    _ftpapi_get := sts;
    END;

BEGIN
_ftpapi_get('Charon::Einsteinium:[Eps.22-OCT-1998]9_22007_4_1.Eps');
_ftpapi_get('Charon::Erbium:[Scans.27-oct-1998]001006-981027-1-2.Tiff',TRUE);
}
END.

--------------906E14768126BD41F944B2
Content-Type: text/plain; charset=iso-8859-1; name="ftp_api.mms"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline; filename="ftp_api.mms"

!++
! DESCRIP.MMS	Copyright © 1994, MadGoat Software.  All rights reserved.
!
! Description:
!
!	An MMS file describing module dependencies for MadGoat FTP client,
!	server, and listener.
!
! Written By:	Darrell Burkhead	October 22, 1993
!
! Modifications:
!
!	V2.0		Darrell Burkhead	22-OCT-1993 13:27
!		Remove UCX-specific and CMU-specific information and
!		revamped to compile with NETLIB.
!--

.IFDEF __MADGOAT_BUILD__
MG_NOV5LINK 	= TRUE
MG_NOV1LINK 	= TRUE
MG_FACILITY 	= MGFTP
KITNAME	    	= MGFTP.ZIP
PRIMARY_TARGET	= ALL
.INCLUDE MG_TOOLS:HEADER.MMS
.ELSE
ETCDIR =
KITDIR =
SRCDIR = SYS$DISK:[]
BINDIR =
.ENDIF

.IFDEF __MMK_V32__

.IFDEF __AXP__
ARCH = ALPHA
L32 = .L32E
.ELSE
ARCH = VAX
L32 = .L32
.ENDIF

.IFDEF __MADGOAT_BUILD__
.ELSE
BINDIR = SYS$DISK:[-.BIN-$(ARCH)]

.FIRST
    @ IF F$PARSE("$(BINDIR)") .EQS. "" THEN CREATE/DIR $(BINDIR)
    @ DEFINE/NOLOG BIN_DIR $(BINDIR)

{}.C{$(BINDIR)}.OBJ :
{}.MSG{$(BINDIR)}.OBJ :
{}.CLD{$(BINDIR)}.OBJ :
{}.MAR{$(BINDIR)}.OBJ :
.ENDIF

.ELSE ! not MMK V3.2 or later - make this MMS-friendly

.ifdef __ALPHA__
.else
.ifdef __VAX__
.else
alpha_is_alpha = 1
vax_is_vax = 1
.ifdef $(MMS$ARCH_NAME)_is_alpha
__ALPHA__=1		! if neither defined, set (on MMS 3.2+)
.endif
.endif
.endif
.ifdef L32
.else
L32 = .L32
.endif
.ifdef OBJ
.else
OBJ = .OBJ
.endif
.ifdef EXE
.else
EXE = .EXE
.endif
.ENDIF

.SUFFIXES	.L32E
.R32.L32E:
	BLISS/LIBRARY=$(MMS$TARGET) $(MMS$SOURCE)


.IFDEF __ALPHA__
MAP     = .ALPHA_MAP
BDEBUG	= /DEBUG/NOOPTIMIZE
SYSEXE	= /SYSEXE
HPWD	=
.FIRST
	DEFINE SYS$LIBRARY ALPHA$LIBRARY:
.ELSE
SYSEXE	= ,SYS$SYSTEM:SYS.STB/SELECTIVE
BDEBUG	= /DEBUG/OPTIMIZE=LEVEL=0
HPWD	= HPWD=$(BINDIR)HPWD$(OBJ),
.ENDIF

.IFDEF __DEBUG__
DEBUG = $(BDEBUG)
LDEBUG = /DEBUG
.ELSE
DEBUG = /NOTRACE/NODEBUG
LDEBUG = /NOTRACE/NODEBUG
.ENDIF

BFLAGS = $(BFLAGS) $(DEBUG)
LINKFLAGS = $(LINKFLAGS)$(LDEBUG)

.IFDEF VMSVER
LIBDIR  = VMS$LIBS:[VMS_$(VMSVER)_LIB]
.IFDEF __ALPHA__
.B32.OBJ :
    DEFINE/USER SYS$LIBRARY $(LIBDIR)
    $(BLISS)$(BFLAGS) $(MMS$SOURCE)

LINK_LOG1 =     DEFINE/USER ALPHA$LIBRARY $(LIBDIR)
LINK_LOG2 =     DEFINE/USER ALPHA$LOADABLE_IMAGES $(LIBDIR)

.FIRST
        DEFINE ALPHA$LIBRARY $(LIBDIR)

.ELSE
.B32.OBJ :
    DEFINE/USER SYS$LIBRARY $(LIBDIR)
    $(BLISS)$(BFLAGS) $(MMS$SOURCE)

SYSEXE  =       ,$(LIBDIR)SYS.STB/SELECT
LINK_LOG1 =     DEFINE/USER SYS$LIBRARY $(LIBDIR)
LINK_LOG2 =

.ENDIF

.ELSE   !VMSVER is *not* defined

LIBDIR  =       SYS$SYSTEM:             !Default for SYS_SYMBOLS.OPT
LINK_LOG1 =
LINK_LOG2 =
.ENDIF



ALL	: $(BINDIR)FTP$(EXE), $(BINDIR)FTP_SERVER$(EXE), -
	  $(BINDIR)FTP_LISTENER$(EXE), $(BINDIR)FTP_API$(EXE)
	!MadGoat FTP has been successfully built

FTP_OBJS =	FTP=$(BINDIR)FTP$(OBJ), -
		COPY_DIR_FTP_SUPPORT=$(BINDIR)COPY_DIR_FTP_SUPPORT$(OBJ), -
		FTP_CMD_TABLE=$(BINDIR)FTP_CMD$(OBJ), -
		FTP_PARSE=$(BINDIR)FTP_PARSE$(OBJ), -
		FTP_PARSE_NO_HOST=$(BINDIR)FTP_PARSE_NO_HOST$(OBJ), -
		FTP_NETWORK=$(BINDIR)FTP_NETWORK$(OBJ), -
		FTP_ROUTINES=$(BINDIR)ROUTINES$(OBJ), -
		FTP_HELP=$(BINDIR)FTP_HELP$(OBJ), -
		FTP_UTILITY_MESSAGES=$(BINDIR)FTP_MSG$(OBJ), -
		FTP_FILE=$(BINDIR)FTP_FILE$(OBJ), -
		FTP_ALIAS=$(BINDIR)FTP_ALIAS$(OBJ), -
		FTP_ALIAS_CMDS=$(BINDIR)FTP_ALIAS_CMDS$(OBJ), -
		NET_TO_TEXT=$(BINDIR)FTP_NTOT$(OBJ), -
		STRING_ROUTINES=$(BINDIR)STRING$(OBJ), -
		PORT_PARSE=$(BINDIR)PORT$(OBJ), -
		CONTROL_C=$(BINDIR)CONTROL_C$(OBJ), -
		FTP_INPUT=$(BINDIR)FTP_INPUT$(OBJ), -
		FTP_QUEUE=$(BINDIR)FTP_QUEUE$(OBJ), -
		CONDITION=$(BINDIR)CONDITION$(OBJ), -
		HASH=$(BINDIR)HASH$(OBJ), -
		NET_TO_FILE=$(BINDIR)FTP_NTOF$(OBJ), -
		FILE_TO_NET=$(BINDIR)FTP_FTON$(OBJ), -
		DIR_TO_NET=$(BINDIR)FTP_DTON$(OBJ), -
		FILE_INFO=$(BINDIR)FILE_INFO$(OBJ), -
		MEMORY=$(BINDIR)MEM$(OBJ), -
		DIR=$(BINDIR)DIR$(OBJ), -
		TEXT=$(BINDIR)TEXT$(OBJ), -
		NETLIB=$(BINDIR)NETLIB$(OBJ), -
		PARSE_PASV=$(BINDIR)PARSE_PASV$(OBJ)

$(BINDIR)FTP$(EXE) :	$(BINDIR)FTP$(OLB)($(FTP_OBJS)),-
			SYS$DISK:[]NETLIB.OPT
	$(LINK_LOG1)
	$(LINK_LOG2)
	$(LINK) $(LINKFLAGS) $(BINDIR)FTP$(OLB)/LIBRARY/INCLUDE=FTP,-
		SYS$DISK:[]NETLIB.OPT/OPT

$(BINDIR)FTP_API$(EXE) : ftp_api.opt, ftp_api$(OBJ),-
			$(BINDIR)FTP$(OLB)($(FTP_OBJS))
	$(LINK) $(LINKFLAGS)/SHARE $(MMS$SOURCE)/OPT

FTP_SERVER_OBJS = -
		FTP_SERVER=$(BINDIR)FTP_SERVER$(OBJ), -
		FTP_SERVER_CMDS=$(BINDIR)FTP_SERVER_CMDS$(OBJ), -
		DIR_TO_NET=$(BINDIR)FTP_DTON$(OBJ), -
		FTP_ANNOUNCE=$(BINDIR)FTP_ANNOUNCE$(OBJ), -
		FTP_SERVER_PARSE=$(BINDIR)FTP_SERVER_PARSE$(OBJ), -
		FTP_SET_PARAMS=$(BINDIR)FTP_SET_PARAMS$(OBJ), -
		LOG_TO_LISTENER=$(BINDIR)LOG_TO_LISTENER$(OBJ), -
		FTP_IN=$(BINDIR)FTP_SERVER_IN$(OBJ), -
		FTP_SERVER_MESSAGES=$(BINDIR)FTPSRV$(OBJ), -
		FTPIN_PARSE=$(BINDIR)CMD_PARSE$(OBJ), -
		LOGIN=$(BINDIR)LOGIN$(OBJ), -
		PARSE_PORT=$(BINDIR)PARSE_PORT$(OBJ), -
		PARSE_TYPE=$(BINDIR)PARSE_TYPE$(OBJ), -
		PARSE_STRU=$(BINDIR)PARSE_STRU$(OBJ), -
		PARSE_MODE=$(BINDIR)PARSE_MODE$(OBJ), -
		FTP_DTOT=$(BINDIR)FTP_DTOT$(OBJ), -
		FTP_HANDLER=$(BINDIR)FTP_HANDLER$(OBJ), -
		ANON=$(BINDIR)ANON$(OBJ), -
		NET_TO_FILE=$(BINDIR)FTP_NTOF$(OBJ), -
		FILE_TO_NET=$(BINDIR)FTP_FTON$(OBJ), -
		FILE_INFO=$(BINDIR)FILE_INFO$(OBJ), -
		TEXT=$(BINDIR)TEXT$(OBJ), -
		MEMORY=$(BINDIR)MEM$(OBJ), -
		DIR=$(BINDIR)DIR$(OBJ), -
		NETLIB=$(BINDIR)NETLIB$(OBJ)

$(BINDIR)FTP_SERVER$(EXE)	: $(BINDIR)FTP_SERVER$(OLB)($(FTP_SERVER_OBJS)),-
				SYS$DISK:[]NETLIB.OPT
	$(LINK_LOG1)
	$(LINK_LOG2)
	$(LINK) $(LINKFLAGS) $(BINDIR)FTP_SERVER$(OLB)/LIBRARY/INCLUDE=(FTP_SERVER), -
	SYS$DISK:[]NETLIB.OPT/OPT $(SYSEXE)

FTP_LISTENER_OBJS = -
		FTP_LISTENER=$(BINDIR)FTP_LISTENER$(OBJ), -
		FTP_LISTENER_MEM=$(BINDIR)FTP_LISTENER_MEM$(OBJ), -
		FTP_LISTENER_CMDS=$(BINDIR)FTP_LISTENER_CMDS$(OBJ), -
		ACTIVITY_LOG=$(BINDIR)ACTIVITY_LOG$(OBJ), -
		VMS054=$(BINDIR)VMS054$(OBJ), -
		$(HPWD) -
		FTP_IN=$(BINDIR)FTP_LISTENER_IN$(OBJ), -
		PARSE_PORT=$(BINDIR)PARSE_PORT$(OBJ), -
		PARSE_TYPE=$(BINDIR)PARSE_TYPE$(OBJ), -
		PARSE_STRU=$(BINDIR)PARSE_STRU$(OBJ), -
		PARSE_MODE=$(BINDIR)PARSE_MODE$(OBJ), -
		FTP_HANDLER=$(BINDIR)FTP_HANDLER$(OBJ), -
		FTP_SERVER_MESSAGES=$(BINDIR)FTPSRV$(OBJ), -
		FTPIN_PARSE=$(BINDIR)CMD_PARSE$(OBJ), -
		PORT_PARSE=$(BINDIR)PORT$(OBJ), -
		MEMORY=$(BINDIR)MEM$(OBJ), -
		TEXT=$(BINDIR)TEXT$(OBJ), -
		NETLIB=$(BINDIR)NETLIB$(OBJ)

$(BINDIR)FTP_LISTENER$(EXE) :	-
			$(BINDIR)FTP_LISTENER$(OLB)($(FTP_LISTENER_OBJS)),-
			SYS$DISK:[]NETLIB.OPT
	$(LINK_LOG1)
	$(LINK_LOG2)
	$(LINK) $(LINKFLAGS) $(BINDIR)FTP_LISTENER$(OLB)/LIBRARY/INCLUDE=FTP_LISTENER, -
		SYS$DISK:[]NETLIB.OPT/OPT

SYS$DISK:[]NETLIB.OPT :
	@ open/write TMP $(MMS$TARGET)
        @ write TMP "netlib_shrxfr/share"
        @ close tmp

FTP_ALIAS$(L32)	:			FTP_ALIAS.R32, FIELDS$(L32)
FTP_LISTENER$(L32) :			FTP_LISTENER.R32, FIELDS$(L32)
FTP_CONN_INFO$(L32) :			FTP_CONN_INFO.R32, FIELDS$(L32)
NETLIB$(L32) :				NETLIB.R32, FIELDS$(L32)
FIELDS$(L32) :				FIELDS.R32
NETAUX$(L32) :				NETAUX.R32
ANON_FTP$(L32) :			ANON_FTP.R32
FTP_IN$(L32) :				FTP_IN.R32, FIELDS$(L32)
FTP$(L32) :				FTP.R32, FIELDS$(L32)
TEXT$(L32) :				TEXT.R32
VERSION$(L32) :				VERSION.R32

$(BINDIR)FTP_ALIAS$(OBJ) :		FTP_ALIAS.B32, FTP_ALIAS$(L32), -
					FTP_MSG$(L32), NETAUX$(L32)

$(BINDIR)FTP_ALIAS_CMDS$(OBJ) :		FTP_ALIAS_CMDS.B32, FTP_ALIAS$(L32), -
					CLI$(L32), FIELDS$(L32), -
					FTP_MSG$(L32), NETAUX$(L32)

$(BINDIR)LOG_TO_LISTENER$(OBJ) :	LOG_TO_LISTENER.B32, NETLIB$(L32)

$(BINDIR)PORT$(OBJ) :			PORT.B32, TPA$(L32)

$(BINDIR)FTP_LISTENER_CLD$(OBJ) :	FTP_LISTENER_CLD.CLD

$(BINDIR)FTP_LISTENER_CMDS$(OBJ) :	FTP_LISTENER_CMDS.B32, FTP$(L32), -
					FTPSRV$(L32), FTP_IN$(L32), -
					FTP_LISTENER$(L32), NETLIB$(L32), -
					NETAUX$(L32), VERSION$(L32)

$(BINDIR)FTP_LISTENER$(OBJ) :		FTP_LISTENER.B32, FTP_LISTENER$(L32), -
					NETLIB$(L32), FTP$(L32), -
					FTP_CONN_INFO$(L32)

$(BINDIR)FTP_LISTENER_MEM$(OBJ)	:	FTP_LISTENER_MEM.B32, -
					FTP_LISTENER$(L32), -
					NETLIB$(L32), FTP_CONN_INFO$(L32)

$(BINDIR)FTP_SERVER$(OBJ) :		FTP_SERVER.B32, NETAUX$(L32), -
					NETLIB$(L32), FTP_CONN_INFO$(L32)

$(BINDIR)FTP_SERVER_IN$(OBJ) :		FTP_IN.B32, FTP$(L32), FTPSRV$(L32), -
					ANON_FTP$(L32), FTP_IN$(L32), -
					NETAUX$(L32), NETLIB$(L32), -
					FTP_CONN_INFO$(L32), VERSION$(L32)
    $(BLISS)$(BFLAGS) $(MMS$SOURCE)

$(BINDIR)FTP_LISTENER_IN$(OBJ) :	FTP_IN.B32, FTP$(L32), FTPSRV$(L32), -
					FTP_IN$(L32), NETAUX$(L32), -
					NETLIB$(L32), FTP_LISTENER$(L32), -
					FTP_CONN_INFO$(L32), VERSION$(L32)
	if "$(VMSVER)".nes."" then define/user sys$library $(LIBDIR)
	$(BLISS)/VARIANT $(BFLAGS) $(MMS$SOURCE)

$(BINDIR)FTP_SERVER_CMDS$(OBJ) :	FTP_SERVER_CMDS.B32, FTP$(L32), -
					FTPSRV$(L32), ANON_FTP$(L32), -
					FTP_IN$(L32), NETAUX$(L32), -
					NETLIB$(L32), FTP_CONN_INFO$(L32)

$(BINDIR)PARSE_PORT$(OBJ) :		PARSE_PORT.B32, FTP$(L32), TPA$(L32)
$(BINDIR)PARSE_TYPE$(OBJ) :		PARSE_TYPE.B32, FTP$(L32), TPA$(L32)
$(BINDIR)PARSE_MODE$(OBJ) :		PARSE_MODE.B32, FTP$(L32), TPA$(L32)
$(BINDIR)PARSE_STRU$(OBJ) :		PARSE_STRU.B32, FTP$(L32), TPA$(L32)
$(BINDIR)PARSE_PASV$(OBJ) :		PARSE_PASV.B32, FTP$(L32), TPA$(L32)

$(BINDIR)FTP_NTOF$(OBJ) :		FTP_NTOF.B32, FTP$(L32), FIELDS$(L32) -
					NETLIB$(L32)

$(BINDIR)FTP_FTON$(OBJ) :		FTP_FTON.B32, FTP$(L32), FIELDS$(L32), -
					NETAUX$(L32), NETLIB$(L32)

$(BINDIR)FTP_NTOT$(OBJ) :		FTP_NTOT.B32, FTP$(L32), FIELDS$(L32), -
					NETLIB$(L32)

$(BINDIR)FTP_DTON$(OBJ) :		FTP_DTON.B32, FTP$(L32), FIELDS$(L32), -
					NETLIB$(L32)

$(BINDIR)FTP_DTOT$(OBJ) :		FTP_DTOT.B32, FTP$(L32), FIELDS$(L32)

$(BINDIR)FTP_HANDLER$(OBJ) :		FTP_HANDLER.B32, FTP$(L32), -
					FTPSRV$(L32), NETAUX$(L32)

$(BINDIR)FILE_INFO$(OBJ) :		FILE_INFO.B32, FTP$(L32), NETAUX$(L32)

$(BINDIR)FTP$(OBJ) :		FTP.B32, FTP$(L32), CLI$(L32), FTP_MSG$(L32),-
				NETAUX$(L32), FTP_CONN_INFO$(L32), -
				NETLIB$(L32), VERSION$(L32), FIELDS$(L32)

$(BINDIR)FTP_NETWORK$(OBJ) :	FTP_NETWORK.B32, FTP$(L32), FTP_MSG$(L32), -
				NETLIB$(L32), NETAUX$(L32), FTP_ALIAS$(L32), -
				CLI$(L32), FTP_CONN_INFO$(L32)

$(BINDIR)ROUTINES$(OBJ)	:	ROUTINES.B32, FTP$(L32), FTP_MSG$(L32), -
				CLI$(L32), NETAUX$(L32), FTP_ALIAS$(L32)

$(BINDIR)COPY_DIR_FTP_SUPPORT$(OBJ) : -
				COPY_DIR_FTP_SUPPORT.B32, TPA$(L32), CLI$(L32)

$(BINDIR)FTP_HELP$(OBJ)	:	FTP_HELP.B32, CLI$(L32), FTP_MSG$(L32)

$(BINDIR)FTP_FILE$(OBJ)	:	FTP_FILE.B32, FTP$(L32), FTP_MSG$(L32), -
				NETAUX$(L32), NETLIB$(L32), -
				FTP_CONN_INFO$(L32), CLI$(L32)

$(BINDIR)CONDITION$(OBJ) :	CONDITION.B32, FTP_MSG$(L32), CLI$(L32), -
				NETAUX$(L32)

$(BINDIR)HASH$(OBJ) :		HASH.B32, FTP_MSG$(L32), FTP$(L32), -
				NETAUX$(L32), CLI$(L32)

$(BINDIR)LOGIN$(OBJ) :		LOGIN.B32, FTPSRV$(L32), ANON_FTP$(L32)

$(BINDIR)FTP_SERVER_PARSE$(OBJ)	: FTP_SERVER_PARSE.CLD

$(BINDIR)FTP_SET_PARAMS$(OBJ) :	FTP_SET_PARAMS.B32, CLI$(L32), FTP$(L32), -
				NETAUX$(L32)

$(BINDIR)FTP_ANNOUNCE$(OBJ) :	FTP_ANNOUNCE.B32, FTP$(L32), FTPSRV$(L32), -
				NETAUX$(L32)

$(BINDIR)MEM$(OBJ) :			MEM.B32, FIELDS$(L32), NETAUX$(L32)
$(BINDIR)FTP_QUEUE$(OBJ) :		FTP_QUEUE.B32, FTP$(L32), FIELDS$(L32)
$(BINDIR)CONTROL_C$(OBJ) :		CONTROL_C.B32, FTP_MSG$(L32)
$(BINDIR)CMD_PARSE$(OBJ) :		CMD_PARSE.B32, TPA$(L32)
$(BINDIR)ANON$(OBJ) :			ANON.B32, FTP$(L32), FIELDS$(L32)
$(BINDIR)DIR$(OBJ) :			DIR.B32, NETAUX$(L32), TEXT$(L32)
$(BINDIR)FTP_MSG$(OBJ) :		FTP_MSG.MSG
$(BINDIR)VMS054$(OBJ) :			VMS054.B32, FTPSRV$(L32)
$(BINDIR)TEXT$(OBJ) :			TEXT.B32, FIELDS$(L32)
$(BINDIR)NETLIB$(OBJ) :			NETLIB.B32
$(BINDIR)FTPSRV$(OBJ) :			FTPSRV.MSG
$(BINDIR)FTP_CMD$(OBJ) :		FTP_CMD.CLD
$(BINDIR)FTP_PARSE$(OBJ) :		FTP_PARSE.CLD
$(BINDIR)FTP_PARSE_NO_HOST$(OBJ) :	FTP_PARSE_NO_HOST.CLD
$(BINDIR)FTP_QUIET$(OBJ) :		FTP_QUIET.CLD
$(BINDIR)FTP_SERVER_PARSE$(OBJ) :	FTP_SERVER_PARSE.CLD
$(BINDIR)STRING$(OBJ) :			STRING.B32
$(BINDIR)FTP_INPUT$(OBJ) :		FTP_INPUT.B32, NETAUX$(L32)
$(BINDIR)ACTIVITY_LOG$(OBJ) :		ACTIVITY_LOG.B32
$(BINDIR)HPWD$(OBJ) :			HPWD.MAR

!VERSION.R32	    	    : MG_SRC:[MGFTP]VERSION.OPT
!    @ open/read x $(MMS$SOURCE)
!    @ read x __cmd
!    @ close x
!    @ '__cmd
!    @ define/user sys$input nl:
!    @ create $(MMS$TARGET)
!    @ open/append x $(MMS$TARGET)
!    @ WRITE x "MACRO FTP_VERSION = '", ident, "'%;"
!    @ CLOSE x

BACK :
	BACKUP *.*;/EXCL=(*.*exe,*.*map,*.*obj,*.*olb,*.l32*,*.hlb,-
			*.tmp,*.bck,*.dir) sys$login:current_ftp.bck/save/log
SRConly :
	purge /log
	del/log  *$(EXE).,*$(obj).,*.map.,*.lis.,*.STB.*,*.ckp.,*$(L32).

CLEAN :
	delete/log/noconfirm *.*obj;*,*.*exe;*,*.*olb;*,*.l32*;*,*.*MAP;*,*.*LIS;*

--------------906E14768126BD41F944B2
Content-Type: text/plain; charset=us-ascii; name="ftp_api.opt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ftp_api.opt"

ftp_api
ftp/library
netlib_shrxfr/share

gsmatch = lequal,02, 0502

symbol_vector=(ftpapi_get=PROCEDURE)


--------------906E14768126BD41F944B2--

