Remove ftplib from Magicka Repo as it's in mnet now

This commit is contained in:
Andrew Pamment 2018-05-27 22:17:19 +10:00
parent 416bdc66df
commit 35b0d32193
51 changed files with 0 additions and 7896 deletions

View File

@ -1,191 +0,0 @@
The obligatory revision history...
Changes from V4.0 to V4.0-1
1) Fix erroneous removal of local file on PUT when transfer fails. It
was an attempt to remove the local file on retrieve failure but the
the code was checking for the wrong value.
2) Link data netbuf to control netbuf in FtpOpenPort instead of
routine that calls it.
3) Fix check of response type in FtpClose.
4) Add NULL check from nodename lookup.
Changes from V3.1-1 to V4.0
1) License changed from GPL/LGPL to Artistic License 2.0.
2) Many bugs reported over the years have been addressed.
3) The reentrant versions of gethostbyname and getservbyname are used
if available.
4) Internal buffers are larger which should allow for longer
filenames.
5) The library will not output anything to stdout or stderr unless
ftplib_debug is defined.
6) Some additional arguments are declared const.
7) The second argument to FtpSize is the address of an integer to
receive the size of the remote file. The type of this argument has
been changed from int to unsigned int. A new function, FtpSizeLong,
returns the remote file's size as an unsigned long long.
8) The second argument to the callback function has been changed from
an int to an unsigned long long. This value contains the number of
bytes transferred so far.
9) The library version 1 interface compatability macros have been
removed from the header file. If your application needs them, extract
them from the old header file.
10) The usage information in qftp.c has been corrected.
11) qftp now accepts a '-s <cmd>' option to send <cmd> as a SITE
command.
12) qftp progress reports now use floating point calculation so that
large numbers don't cause overflows. If the remote server does not
support the SIZE command, qftp will update every 32KB.
13) A new type-safe method is provided to establish a callback
function. Put the details of when the function should be called into
a FtpCallbackOptions structure and pass it to FtpSetCallback(). To
remove a callback, call FtpClearCallback().
14) Updated html documentation.
Changes from V3.1 to V3.1-1
1) Delay setting the control handle pointer in the data handle until
after the transfer request has received a positive acknowledgement.
This should resolve problems calling FtpClose() on the data handle
when the transfer is rejected.
2) Fix error handling in FtpRead() and FtpWrite().
3) Return status of transfer from FtpXfer() instead of status of
FtpClose().
4) Allow FtpClose() to be called on a control handle. This should be
used instead of FtpQuit() in cases where a transfer was interrupted.
FtpQuit() would attempt to send a 'QUIT' command and wait for a
response but this would be out of sync after an interrupt.
5) The idle callback routine was not being set in the data handle if
the user didn't set FTPLIB_IDLETIME. Fixed this so it would get set
up if either this or FTPLIB_CALLBACKBYTES was set.
6) Open local files in binary mode when appropriate. This is
necessary on some systems like NT and VMS.
7) Added a wildcard mode to qftp for wildcard retrieves. Argument
after '-w' is treated as a remote wildcard file specification.
Changes from 12/2/97 (V3) to .... (V3.1)
1) Added FtpPwd(), FtpSysType(), FtpCDUp(), FtpSize() and FtpModDate().
2) Fixed bug in FtpClose() - It wasn't waiting for the '226 Transfer
Complete' since it didn't have access to the control connection. A
pointer to it is now kept in the data connection.
3) Fixed bug in FtpClose() - The data connection wasn't being freed. This
could have resulted in memory leaks.
4) Allow runtime selection of connection mode (PORT/PASV) with default set
at compile time.
5) Added support for a user callback routine which can get called after a
user specified number of bytes are transferred or after waiting for data
on a socket for a user specified time period.
6) Add FtpOptions() which allows changing connection options. Options
include connection mode, callback routine, and parameters regarding when
the user's callback routine gets called.
7) Added checks to make sure strcpy()/sprintf()/etc. wouldn't write past
end of buffers.
8) Modified build procedure to create a shared library.
9) Added install option to makefile which installs under /usr/local.
10) Modified qftp to use new interface.
11) Modified qftp to log progress every 10% of file or every time data
is delayd by 1 second if -v setting is not zero.
12) Modified qftp to use fgets() instead of gets().
------------------------------------------------------------------------
Changes from 3/15/97 to 12/2/97
1) FtpLastResponse() returns NULL if passed a NULL pointer.
2) Added 'const' keyword on appropriate function arguments.
3) First attempt to translate passed host string as an IP address in dot
notation by passing it to inet_addr(). If this fails, pass the string
to gethostbyname(). Apparently, some versions of gethostbyname() will
parse the translation of a dot notation address for you. One user
reports he knows of at least one that does not. In any case, it's the
right thing to do.
4) Added protection from double inclusion to header file. Also added
'extern "C"' for C++.
5) Made sure qftp was passed two arguments before examining the second
one.
6) Made sure all commands to the server were in upper case. I've been
told that some servers require this.
7) Attempt to handle login to accounts with no passwords.
8) Added common data transfer routines so that ascii mode transfers would
be handled properly in all cases. Also, exposed these routines for
user programs to call. There's now FtpAccess() to open a remote file
or directory, FtpRead() and FtpWrite() to pass data, and FtpClose() to
terminate the data connection.
9) Added 'list' command to qftp to perform a terse directory (names
only). This could be piped into another copy of qftp to retrieve the
files.
10) ftplib.c and ftplib.h are now covered by the LGPL instead of the GPL.
Feel free to send me a complementary copy of anything you develop
commercially with my libraries. All other programs are still covered
by the GPL.
11) Added ability to specify a different port number than the default by
appending a colon and the desired port number to the remote host name
(e.g., remote.host.name:500 would connect to port remote.host.name on
port 500).
------------------------------------------------------------------------
Changes from 8/31/96 version to 3/15/97 version
1) Added copyright information to sources.
2) Changed from 'port' to 'pasv' which I'm told will allow the routines
to work from behind a firewall. It's also a lot simpler and cleaner
than all that code to setup and accept a connect from the server.
3) Added delete (ftprm) support to qftp.c.
4) Modified qftp to allow use without a softlink by passing the ftp
command as the first argument.
5) Added netbuf argument to all calls to eliminate static storage and
allow multiple simultaneous connections.
6) Renamed routines from ftp*() to Ftp*() to avoid problems with existing
programs. Added macros in libftp.h to support old interface. Renamed
ftpOpen() to FtpConnect().

View File

@ -1,171 +0,0 @@
Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed. Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or
redistributed. The intent is that the Copyright Holder maintains some
artistic control over the development of that Package while still
keeping the Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement. Definitions
"Copyright Holder" means the individual(s) or organization(s) named in
the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy, distribute,
or modify the Package.
"Package" means the collection of files distributed by the Copyright
Holder, and derivatives of that collection and/or of those files. A
given Package may consist of either the Standard Version, or a
Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing this
Package or providing support for this Package to another party. It
does not mean licensing fees.
"Standard Version" refers to the Package if it has not been modified,
or has been modified only in ways explicitly requested by the
Copyright Holder.
"Modified Version" means the Package, if it has been changed, and such
changes were not explicitly requested by the Copyright Holder.
"Original License" means this Artistic License as Distributed with the
Standard Version of the Package, in its current version or as it may
be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary, or
any other form resulting from mechanical transformation or translation
of the Source form. Permission for Use and Modification Without
Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version. Permissions for
Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License. Distribution of Modified
Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder of the
Standard Version, under the Original License, so that the Copyright
Holder may include your modifications in the Standard Version. (b)
ensure that installation of your Modified Version does not prevent the
user installing or running the Standard Version. In addition, the
Modified Version must bear a name that is different from the name of
the Standard Version. (c) allow anyone who receives a copy of the
Modified Version to make the Source form of the Modified Version
available to others under (i) the Original License or (ii) a license
that permits the licensee to freely copy, modify and redistribute the
Modified Version using the same licensing terms that apply to the copy
that the licensee received, and requires that the Source form of the
Modified Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor Fees are
allowed. Distribution of Compiled Forms of the Standard Version or
Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further
distribution. If you provide valid instructions or cease distribution
within thirty days after you become aware that the instructions are
invalid, then you do not forfeit any of your rights under this
license.
(6) You may Distribute a Modified Version in Compiled form without the
Source, provided that you comply with Section 4 with respect to the
Source of the Modified Version. Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license. General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified Version
made by someone other than you, you are nevertheless required to
ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
(14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT
HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT
PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT
HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,18 +0,0 @@
FTP Library Routines Release 4.0
Thomas Pfau (tfpfau@gmail.com)
March 9, 2016
This package implements a callable interface to FTP. The FTP protocol is
specified in RFC 959. The library has been tested on linux, OpenVMS and
Windows NT. It should also work without major modification on other
POSIX systems.
All programs using the library should include ftplib.h.
The routines look at the global variable ftplib_debug to determine how
much information they should display. Level 1 has been left for user
programs. Level 2 displays all responses received from the server.
Level 3 displays all commands sent to the server.
Function documentation is provided in HTML format in the html
subdirectory.

View File

@ -1,41 +0,0 @@
qftp is a simple program which demonstrates the use of ftplib.
qftp performs directories or file transfers using the ftp protocol based
on the command it was invoked with and command line arguments. qftp
can be invoked through a softlink which indicates which operation it
should perform.
To install, copy qftp to a directory in your path. Execute the following
commands in that directory:
ln -s qftp ftpdir
ln -s qftp ftpget
ln -s qftp ftpsend
ln -s qftp ftprm
ln -s qftp ftplist
Then, invoke qftp by using the commands ftpdir, ftpget, ftpsend, ftprm or
ftplist.
qftp processes the command line in order. The first argument should be
the name of the system you wish to converse with. If you need to specify
login information, that should be specified next with '-l' and '-p'. On
UNIX systems, if you specify a username with '-l' and don't specify a
password with '-p', qftp will prompt for a password. It is a good idea
to do it this way as it keeps the password off the command line and out
of 'ps' and other displays.
When working through a proxy firewall, specify the firewall machine's
name as the host. Specify the real host's name with the -l and -p
parameters. For example:
ftpget firewall -l anonymous@real.host.com -p user@myhost.org
The exit status from qftp can be used to determine whether the transfer
worked or not. Exit status 2 means a command line syntax error. 3
indicates a failure while attempting to translate the system name into an
IP address. 4 indicates a failure attempting to connect to the remote
machine. 5 indicates a login failure. 6 indicates a remote command
error. 7 indicates a system call error.
See the HTML documentation in the html subdirectory for more details.

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
RFC2228 FTP Security Extensions. M. Horowitz, S. Lunt. October 1997.
RFC1579 Firewall-Friendly FTP. S. Bellovin. February 1994.

View File

@ -1,42 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpAccess</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpAccess</h1>
<p>Open a file or directory on the remote system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpAccess(const char *path, int typ, int mode, netbuf *nControl,
netbuf **nData);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>Specifies the name of the remote file or directory to
open.</dd>
<dt><b>typ</b></dt>
<dd>Specifies the type of transfer to be performed. FTPLIB_DIR
performs a terse directory. FTPLIB_DIR_VERBOSE performs a verbose
directory. FTPLIB_FILE_READ opens a remote file for reading.
FTPLIB_FILE_WRITE creates a remote file and readies it for
writing.</dd>
<dt><b>mode</b></dt>
<dd>Specifies the transfer mode as FTPLIB_ASCII or
FTPLIB_IMAGE.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
<dt><b>nData</b></dt>
<dd>Specifies the address to store a pointer to the created data
handle.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpAccess() opens a remote file or directory and returns a
handle for the calling program to use to transfer data.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpCDUp</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpCDUp</h1>
<p>Change to parent directory.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpCDUp(netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href=
"FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpCDUp() sends a CDUP command to the remote server.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpChdir</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpChdir</h1>
<p>Change working directory on server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpChdir(const char *path, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>Specifies the desired working directory on the server.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>Sends a change working directory request to the server using the
specified path.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,27 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpClearCallback</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpClearCallback</h1>
<p>Clears callback settings.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpClearCallback(netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>
or <a href="FtpAccess.html">FtpAccess()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpClearCallback() clears all callback options on a connection.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if a valid option was specified and the value is
legal. Otherwise, returns 0.</p>
</body>
</html>

View File

@ -1,32 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpClose</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpClose</h1>
<p>Close a connection.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpClose(netbuf *nData);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>nData</b></dt>
<dd>A handle returned by <a href="FtpAccess.html">FtpAccess()</a>
or <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>Closes the connection specified by 'nData' and frees associated
resources. If the connection is a command connection, any
associated data connection is also closed and the command
connection is closed without sending any commands.</p>
<p>FtpClose() destroys the connection object and any associated
data connection object. Do not use either connection after calling
FtpClose().</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,35 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpConnect</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpConnect</h1>
<p>Connect to an FTP server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpConnect(const char *host, netbuf **nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>host</b></dt>
<dd>The name of the host machine to connect to and optionally an
alternate port number to use.</dd>
<dt><b>nControl</b></dt>
<dd>The address where the pointer to the newly created control
handle should be stored.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpConnect() establishes a connection to the FTP server on the
specified machine and returns a handle which can be used to
initiate data transfers. The host name should be specified as
&lt;host&gt; or &lt;host&gt;:&lt;port&gt;. &lt;host&gt; may be
either a host name or ip address. &lt;port&gt; may be either a
service name or a port number.</p>
<h2>RETURN VALUE</h2>
<p>If the connection to the remote server if successful,
FtpConnect() returns 1. Otherwise, 0 is returned.</p>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpDelete</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpDelete</h1>
<p>Removes a file from the remote system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpDelete(const char *fnm, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>fnm</b></dt>
<dd>The name of the file which is to be removed.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>Requests that the server remove the specified file from the
remote file system.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,37 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpDir</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpDir</h1>
<p>Retrieves a verbose directory listing.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpDir(const char *outputfile, const char *path, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>outputfile</b></dt>
<dd>Name of a local file to receive the directory listing. If
specified as NULL, the directory listing is written to stdout.</dd>
<dt><b>path</b></dt>
<dd>File specification to pass to remote 'ls'.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href=
"FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>Sends a LIST command to the server with the specified path. The
response to this is usually a long format directory listing which
will be written to the file named in outputfile. If outputfile is
specified as NULL, the list will be written to stdout.</p>
<p>The format of the listing is dependent on the type of the remote
system. The system type can be determined from
<a href="FtpSysType.html">FtpSysType()</a>.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,34 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpGet</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpGet</h1>
<p>Retreive a file from the remote system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpGet(const char *output, const char *path, char mode, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>output</b></dt>
<dd>Name of a local file to receive the contents of the remote
file. If specified as NULL file data will be written to stdout.</dd>
<dt><b>path</b></dt>
<dd>Name of remote file to be retrieved.</dd>
<dt><b>mode</b></dt>
<dd>Specifies the transfer mode as FTPLIB_ASCII or
FTPLIB_IMAGE.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpGet() copies the contents of a remote file to a local
file.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,22 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpInit</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpInit</h1>
<p>Initialize the library.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
void FtpInit(void);
</pre>
<h2>PARAMETERS</h2>
<p>None.</p>
<h2>DESCRIPTION</h2>
<p>Performs any required initialization for the library.</p>
<h2>RETURN VALUE</h2>
<p>None.</p>
</body>
</html>

View File

@ -1,31 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpLastResponse</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpLastResponse</h1>
<p>Retrieve the last response sent by the server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
char *FtpLastResponse(netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>nControl</b></dt>
<dd>A pointer to a control handle returned by
<a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpLastResponse() returns a pointer to the last response string
sent by the server. This can be parsed by the user program to
determine more information about the last request or can be
displayed along with an error message.</p>
<h2>RETURN VALUE</h2>
<p>If nControl is a valid control handle, FtpLastResponse() returns
a pointer to the last server response string. Otherwise, NULL is
returned.</p>
</body>
</html>

View File

@ -1,30 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpLogin</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpLogin</h1>
<p>Login to remote system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpLogin(const char *user, const char *pass, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>user</b></dt>
<dd>Specifies the username.</dd>
<dt><b>pass</b></dt>
<dd>Specifies the password.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpLogin() attempts to login to the remote system with the
supplied username and password.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpMkdir</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpMkdir</h1>
<p>Create a directory on the remote system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpMkdir(const char *path, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>Specifies the argument to mkdir on the remote system.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpMkdir() sends a make directory request to the remote
system.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,36 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpModDate</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpModDate</h1>
<p>Determine last modification time of a remote file.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpModDate(char *path, char *buf, int max, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>Name of remote file to be checked.</dd>
<dt><b>buf</b></dt>
<dd>A pointer to a buffer where the result should be returned.</dd>
<dt><b>max</b></dt>
<dd>Specifies the size of the user's buffer.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpModDate() attempts to determine the last access time of a
remote file and return it to the user's buffer. The date and time
are returned as a string in the format 'YYYYMMDDHHMMSS'.</p>
<h2>RETURN VALUE</h2>
<p>If a good response is received and the date and time are
successfully parsed out of the result, 1 is returned. Otherwise, 0
is returned.</p>
<p>Some servers may not support the MDTM command.</p>
</body>
</html>

View File

@ -1,33 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpNlst</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpNlst</h1>
<p>Retrieves a terse directory listing.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpNlst(const char *output, const char *path, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>output</b></dt>
<dd>Specifies the name of a file to receive the directory listing. If
specified as NULL the directory listing will be written to
stdout.</dd>
<dt><b>path</b></dt>
<dd>Specifies an argument to 'ls' on the remote system.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>Performs a short form directory listing of the specified path on
the remote system. The results are written to the specified
file.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,63 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpOptions</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpOptions</h1>
<p>Set connection options.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpOptions(int opt, long val, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>opt</b></dt>
<dd>Specifies the option to change. Valid options are
FTPLIB_CONNMODE, FTPLIB_CALLBACK, FTPLIB_IDLETIME,
FTPLIB_CALLBACKARG, and FTPLIB_CALLBACKBYTES.</dd>
<dt><b>val</b></dt>
<dd>Specifies the new value for the option. The value may need to
by cast to a long.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>
or <a href="FtpAccess.html">FtpAccess()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpOptions() changes the options for a connection handle. A data
connection inherits the options assigned to the control connection
it is created from. Callbacks are only called on file data
connections.</p>
<p>New programs should
call <a href="FtpSetCallback.html">FtpSetCallback()</a>
and <a href="FtpClearCallback.html">FtpClearCallback()</a> to change
callback options.</p>
<p>The following options and values are recognized.</p>
<dl>
<dt>FTPLIB_CONNMODE</dt>
<dd>Specifies the connection mode. Either FTPLIB_PASSIVE or
FTPLIB_PORT.</dd>
<dt>FTPLIB_CALLBACK (deprecated)</dt>
<dd>Specifies the address of a user callback routine.</dd>
<dt>FTPLIB_IDLETIME (deprecated)</dt>
<dd>Specifies the socket idle time in milliseconds that triggers
calling the user's callback routine.</dd>
<dt>FTPLIB_CALLBACKARG (deprecated)</dt>
<dd>Specifies an argument to pass to the user's callback
routine.</dd>
<dt>FTPLIB_CALLBACKBYTES (deprecated)</dt>
<dd>Specifies the number of bytes to transfer between calls to the
user's callback routine.</dd>
</dl>
<p>The connection mode tells ftplib if it should use PASV or PORT
to establish data connections. The default is specified as a build
option.</p>
<p>See <a href="FtpSetCallback.html">FtpSetCallback()</a> for a
description of using callbacks.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if a valid option was specified and the value is
legal. Otherwise, returns 0.</p>
</body>
</html>

View File

@ -1,34 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpPut</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpPut</h1>
<p>Send a file to the remote system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpPut(const char *input, const char *path, char mode, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>input</b></dt>
<dd>Specifies the name of a local file to be transfered to the
server. If specified as NULL file data will be read from stdin.</dd>
<dt><b>path</b></dt>
<dd>Specifies the name to be given to the file on the remote
system.</dd>
<dt><b>mode</b></dt>
<dd>Specifies the transfer mode as FTPLIB_ASCII or
FTPLIB_IMAGE.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpPut() transfers a local file to the remote system.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,30 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpPwd</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpPwd</h1>
<p>Determine current working directory on server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpPwd(char *path, int max, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>A pointer to a buffer where the result should be returned.</dd>
<dt><b>max</b></dt>
<dd>Specifies the size of the user's buffer.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpPwd() attempts to determine the current default directory at
the server and return it to the user's buffer.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpQuit</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpQuit</h1>
<p>Sends a QUIT command and closes the connection to the server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
void FtpQuit(netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpQuit() sends a QUIT command to the server and waits for a
response. It closes the connection to the remote server and frees any
resources associated with the connection. The connection should not
be used after calling FtpQuit().</p>
<h2>RETURN VALUE</h2>
<p>None.</p>
</body>
</html>

View File

@ -1,34 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpRead</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpRead</h1>
<p>Read data from a remote file or directory.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpRead(void *buf, int max, netbuf *nData);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>buf</b></dt>
<dd>Specifies the address of a buffer where received data will be
written.</dd>
<dt><b>max</b></dt>
<dd>Specifies the size of the user's buffer.</dd>
<dt><b>nData</b></dt>
<dd>A handle returned by <a href="FtpAccess.html">FtpAccess()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpRead copies up to max bytes of data from the specified data
connection and returns it to the user's buffer. If the data
connection was opened in ascii mode, no more than one line of data
will be returned.</p>
<h2>RETURN VALUE</h2>
<p>Returns the number of bytes written to the user's buffer or -1
on error or end of file.</p>
</body>
</html>

View File

@ -1,30 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpRename</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpRename</h1>
<p>Rename a remote file.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpRename(const char *src, const char *dst, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>src</b></dt>
<dd>A string containing the current name of the remote file.</dd>
<dt><b>dst</b></dt>
<dd>A string containing the desired new name for the remote
file.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpRename() sends a rename request to the remote server.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpRmdir</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpRmdir</h1>
<p>Remove a directory from the remote file system.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpRmdir(const char *path, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>A string containing the name of a remote directory.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpRmdir() sends a remove directory request to the remote
server.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,78 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpSetCallback</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpSetCallback</h1>
<p>Establishes a callback function.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpCallback(FtpCallbackOptions *opt, netbuf *nControl);
</pre>
<p>FtpCallbackOptions is declared as follows.</p>
<pre>
typedef struct FtpCallbackOptions {
FtpCallback cbFunc; /* function to call */
void *cbArg; /* argument to pass to function */
unsigned int bytesXferred; /* callback if this number of bytes transferred */
unsigned int idleTime; /* callback if this many milliseconds have elapsed */
} FtpCallbackOptions;
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>opt</b></dt>
<dd>The address of a structure that contains a pointer to the callback
function and the criteria for calling it.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>
or <a href="FtpAccess.html">FtpAccess()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpSetCallback() establishes a callback functions and tells FTPlib
when to call it. A data connection inherits the options assigned to
the control connection it is created from. Callbacks are only called
on file data connections.</p>
<p>The fields in FtpCallbackStruct are described below.</p>
<dl>
<dt>cbFunc</dt>
<dd>Specifies the address of a user callback routine.</dd>
<dt>cbArg</dt>
<dd>Specifies an argument to pass to the user's callback
routine.</dd>
<dt>idleTime</dt>
<dd>Specifies the socket idle time in milliseconds that triggers
calling the user's callback routine.</dd>
<dt>bytesXferred</dt>
<dd>Specifies the number of bytes to transfer between calls to the
user's callback routine.</dd>
</dl>
<p>The user's callback routine is specified as:</p>
<pre>
typedef int (*FtpCallback)(netbuf *nControl, int xfered, void *arg);
</pre>
<b>nControl</b> is the data connection in use. <b>xfered</b> specifies
how many bytes of data have been transferred on the
connection. <b>arg</b> is the value passed in the FtpCallbackOptions
field cbArg.
<p>The user can request to be called back on either of two
events.</p>
<p>If the routine should be called when the data socket is idle for
some period of time, pass the number of milliseconds of inactivity
that should trigger a callback in the idleTime field.</p>
<p>If the routine should be called when a certain amount of data has
been transferred, specify a non-zero value in bytesXferred. This
value represents the minimum number of bytes to transfer between
callbacks. When using this option, ftplib keeps track of the number of
bytes transferred and calls the user once the specified number of
bytes or more has been transferred. It then resets the count to 0 and
starts again.</p>
<p>If the user wishes to continue the transfer, the callback
routine should return true (non-zero). It can abort the transfer by
return zero.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 for success or 0 for failure.</p>
</body>
</html>

View File

@ -1,28 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpSite</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpSite</h1>
<p>Send a SITE command to the remote server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpSite(const char *cmd, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>cmd</b></dt>
<dd>A string containing a 'SITE' subcommand.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpSite() sends the specified command as an argument to a 'SITE'
command.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,38 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpSize</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpSize</h1>
<p>Determine size of remote file.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpSize(char *path, unsigned int *size, char mode, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>Name of a file on the remote server.</dd>
<dt><b>size</b></dt>
<dd>A pointer to an unsigned integer where the size will be returned.</dd>
<dt><b>mode</b></dt>
<dd>Specifies the transfer mode as FTPLIB_ASCII or
FTPLIB_IMAGE.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpSize() attempts to determine the size of a remote file.</p>
<h2>RETURN VALUE</h2>
<p>If a good response is received and the size is successfully
parsed out of the result, 1 is returned. Otherwise, 0 is
returned.</p>
<p>Some servers may not support the SIZE command. If this request
fails, the size may be available in the response to a RETR
(<a href="FtpOpen.html">FtpOpen()</a> with
typ=FTPLIB_FILE_READ).</p>
</body>
</html>

View File

@ -1,40 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpSizeLong</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpSizeLong</h1>
<p>Determine size of remote file.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpSize(char *path, unsigned long long *size, char mode, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>path</b></dt>
<dd>Name of a file on the remote server.</dd>
<dt><b>size</b></dt>
<dd>A pointer to an unsigned 64 bit integer where the size will be returned.</dd>
<dt><b>mode</b></dt>
<dd>Specifies the transfer mode as FTPLIB_ASCII or
FTPLIB_IMAGE.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpSize() attempts to determine the size of a remote file.</p>
<h2>RETURN VALUE</h2>
<p>If a good response is received and the size is successfully
parsed out of the result, 1 is returned. Otherwise, 0 is
returned.</p>
<p>Some servers may not support the SIZE command. If this request
fails, the size may be available in the response to a RETR
(<a href="FtpOpen.html">FtpOpen()</a> with
typ=FTPLIB_FILE_READ).</p>
<p>This function is identical to <a href="FtpSize.html">FtpSize()</a>
except for the type of the returned value.</p>
</body>
</html>

View File

@ -1,31 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpSysType</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpSysType</h1>
<p>Determine system type of remote server.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpSysType(char *buf, int max, netbuf *nControl);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>buf</b></dt>
<dd>A pointer to a buffer where the result will be returned.</dd>
<dt><b>max</b></dt>
<dd>Specifies the size of the user buffer.</dd>
<dt><b>nControl</b></dt>
<dd>A handle returned by <a href="FtpConnect.html">FtpConnect()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpSysType() issues a SYST command to the remote system and
attempts to parse the system type out of the response and return it
to the user's buffer.</p>
<h2>RETURN VALUE</h2>
<p>Returns 1 if successful or 0 on error.</p>
</body>
</html>

View File

@ -1,33 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FtpWrite</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FtpWrite</h1>
<p>Write data to a remote file.</p>
<h2>SYNOPSIS</h2>
<pre>
#include &lt;ftplib.h&gt;
int FtpWrite(void *buf, int len, netbuf *nData);
</pre>
<h2>PARAMETERS</h2>
<dl>
<dt><b>buf</b></dt>
<dd>A buffer containing the data to be sent to the remote
file.</dd>
<dt><b>len</b></dt>
<dd>The number of bytes to be sent from 'buf'.</dd>
<dt><b>nData</b></dt>
<dd>A handle returned by <a href="FtpAccess.html">FtpAccess()</a>.</dd>
</dl>
<h2>DESCRIPTION</h2>
<p>FtpWrite() sends data to a remote file. If the file was
accessed in record mode, the necessary conversions are
performed.</p>
<h2>RETURN VALUE</h2>
<p>Returns the number of bytes sent from the user's buffer or -1 on
error.</p>
</body>
</html>

View File

@ -1,29 +0,0 @@
body {
font-family: Georgia, "Times New Roman", serif;
font-size: 0.9em;
background-color: #F8F8F8;
color: #000000;
}
h1, h2, h3 {
font-family: Verdana, Tahoma, "Lucida Grande", Arial, sans-serif;
margin-bottom: .5em;
}
pre, code {
font-family: "Lucida Console", monospace;
font-size: smaller;
}
table, pre, p, li, dt {
margin-left: 2em;
margin-right: 2em;
}
dt {
font-weight: bolder;
}
dd {
margin-left: 4em;
margin-right: 2em;
}
td {
padding-left: 1em;
padding-right: 1em;
}

View File

@ -1,92 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>FTPlib Client FTP Library</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>FTPlib Client FTP Library</h1>
<p>These descriptions apply to FTPlib V4.0.</p>
<h2>Miscellaneous Functions</h2>
<ul>
<li><a href="FtpInit.html">FtpInit()</a> - Initialize the
library</li>
<li><a href="FtpSite.html">FtpSite()</a> - Send a 'SITE'
command</li>
<li><a href="FtpLastResponse.html">FtpLastResponse()</a> - Retrieve
last server response</li>
<li><a href="FtpSysType.html">FtpSysType()</a> - Determine remote
system type</li>
<li><a href="FtpSize.html">FtpSize()</a> - Determine size of remote
file</li>
<li><a href="FtpSizeLong.html">FtpSizeLong()</a> - Determine size of
remote file</li>
<li><a href="FtpModDate.html">FtpModDate()</a> - Determine
modification time of file</li>
<li><a href="FtpSetCallback.html">FtpSetCallback()</a> - Establish a
callback function</li>
<li><a href="FtpClearCallback.html">FtpClearCallback()</a> - Remove a
callback function</li>
</ul>
<h2>Server Connection</h2>
<ul>
<li><a href="FtpConnect.html">FtpConnect()</a> - Connect to a
remote server</li>
<li><a href="FtpLogin.html">FtpLogin()</a> - Login to remote
machine</li>
<li><a href="FtpQuit.html">FtpQuit()</a> - Disconnect from remote
server</li>
<li><a href="FtpOptions.html">FtpOptions()</a> - Set Connection
Options</li>
</ul>
<h2>Directory Functions</h2>
<ul>
<li><a href="FtpChdir.html">FtpChdir()</a> - Change working
directory</li>
<li><a href="FtpMkdir.html">FtpMkdir()</a> - Create a
directory</li>
<li><a href="FtpRmdir.html">FtpRmdir()</a> - Remove a
directory</li>
<li><a href="FtpDir.html">FtpDir()</a> - List a remote
directory</li>
<li><a href="FtpNlst.html">FtpNlst()</a> - List a remote
directory</li>
<li><a href="FtpCDUp.html">FtpCDUp()</a> - Change to parent
directory</li>
<li><a href="FtpPwd.html">FtpPwd()</a> - Determine current working
directory</li>
</ul>
<h2>File to File Transfer</h2>
<ul>
<li><a href="FtpGet.html">FtpGet()</a> - Retreive a remote
file</li>
<li><a href="FtpPut.html">FtpPut()</a> - Send a local file to
remote</li>
<li><a href="FtpDelete.html">FtpDelete()</a> - Delete a remote
file</li>
<li><a href="FtpRename.html">FtpRename()</a> - Rename a remote
file</li>
</ul>
<h2>File to Program Transfer</h2>
<p>These routines allow programs access to the data streams connected
to remote files and directories.</p>
<ul>
<li><a href="FtpAccess.html">FtpAccess()</a> - Open a remote file
or directory</li>
<li><a href="FtpRead.html">FtpRead()</a> - Read from remote file or
directory</li>
<li><a href="FtpWrite.html">FtpWrite()</a> - Write to remote
file</li>
<li><a href="FtpClose.html">FtpClose()</a> - Close data
connection</li>
</ul>
<h2>Utilities</h2>
<ul>
<li><a href="qftp.html">qftp</a> - Command line ftp utility</li>
</ul>
<hr>
<p>Last Updated - June 7, 2013</p>
<address><a href="http://www.nbpfaus.net/~pfau/">Thomas Pfau</a> /
<a href="mailto:tfpfau@gmail.com">tfpfau@gmail.com</a></address>
</body>
</html>

View File

@ -1,39 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ftplib</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>ftplib</h1>
<p>ftplib is a set of routines that implement the FTP protocol. They
allow applications to create and access remote files through function
calls instead of needing to fork and exec an interactive ftp client
program.</p>
<p>ftplib has been built and tested on Linux (X86) and OpenVMS (AXP).</p>
<h2>Kits</h2>
<ul>
<li>ftplib V4.0 June 7, 2013
<ul>
<li><a href="http://nbpfaus.net/~pfau/ftplib/ftplib-4.0.tar.gz">Source</a> - gzipped tar file</li>
<li><a href="http://nbpfaus.net/~pfau/ftplib/ftplib-4.0.zip">Source</a> - ZIP archive</li>
</ul>
</ul>
<h2>Documentation</h2>
<p>The documentation is included in the kit in html format. Also, the
<a href=ftplib.html>current working documentation</a> for the release in
progress is available on line.</p>
<hr>
<p class="note">Last Updated - June 7, 2013</p>
<address><a href="http://www.nbpfaus.net/~pfau/">Thomas Pfau</a> /
<a href="mailto:pfau&#64;nbpfaus.net">tfpfau&#64;gmail.com</a></address>
</body>
</html>

View File

@ -1,114 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>qftp</title>
<link rel="stylesheet" type="text/css" href="doc.css">
</head>
<body>
<h1>qftp</h1>
<p><i>qftp</i> is a utility that performs file transfers using
<i>ftplib</i> based on instructions presented on the command
line.</p>
<h2>Format</h2>
<pre>
qftp &lt;action&gt; &lt;host&gt; [ -l user [ -p pass ] ] { options/files }...
Actions: send, get, dir, list, rm
Options:
-v level Set verbosity
-r rootpath Change remote working directory
-m umask Set umask for created files
-a | -i Set ascii/image transfer mode
-w Toggle wildcard mode
-s cmd Send cmd as a SITE command
-b Toggle stripping of path from filename
on send
</pre>
<dl>
<dt>action</dt>
<dd>Specifies what <i>qftp</i> is to do. <i>qftp</i> can
<b>send</b> files to a remote system, <b>get</b> files from a
remote system, remove (<b>rm</b>) files from a remote system, or
retreive a <b>dir</b>ectory of files or a <b>list</b> of files on a
remote system.</dd>
<dt>host</dt>
<dd>Specifies the name of the remote system. An alternate port may
be specified by appending a colon and the port name or number to
the host name.</dd>
<dt>-l user</dt>
<dd>Specifies the username to log in with on <b>host</b>.</dd>
<dt>-p pass</dt>
<dd>Specifies the password to log in with on <b>host</b>.
<p>If <b>user</b> is not specified, <i>qftp</i> will use
<b>anonymous</b>. If <b>pass</b> is also not specified, <i>qftp</i>
attempts to build a password from the translation of the
environment variable "USER" and the string returned by
gethostname() separated by an "@".</p>
</dd>
<dt>-v level</dt>
<dd>Specifies the verbosity level. A level of 1 will cause
<i>qftp</i> to display messages indicating successful transfers. A
level of 2 will cause FTP protocol responses to be displayed. A
level of 3 will cause FTP protocol commands to be displayed.</dd>
<dt>-r rootpath</dt>
<dd>Sends a 'change directory' request to the remote server. All
subsequent file names on the command line will be parsed relative
to this new directory.</dd>
<dt>-m umask</dt>
<dd>Sends a request to change the umask to the remote server. This
may not be supported by all servers. It is implemented using the
'SITE' command in the FTP protocol.</dd>
<dt>-a</dt>
<dd>Requests that subsequent files be sent in ascii mode.</dd>
<dt>-i</dt>
<dd>Requests that subsequent files be sent in image mode.</dd>
<dt>-w</dt>
<dd>Toggles handling of filenames to get as wildcards. When a
wildcard filename is encountered it is passed to the server in a
NLST (brief directory) command. qftp will save the list of files
returned and then retrieve each file individually.</dd>
<dt>-s cmd</dt>
<dd>Sends cmd in a SITE command. This can be useful to alter the way
filenames are presented. For example, an OpenVMS FTP server will
strip version numbers from file names after receiving a 'SITE UNIX'
command.</dd>
<dt>-b</dt>
<dd>Toggles stripping of paths from filenames on send. By default,
qftp passes the full path of the input file as specified on the
command line to the remote FTP server as the target filename. This
option will cause qftp to send only the basename of the file.</dd>
</dl>
<p><i>qftp</i> reads the command line argument by argument and acts on
each as it comes to it. Most options only change the value of a
variable. The '-m' (umask), '-s' (site), and '-r' (change
directory) options are executed immediately by sending the command
to the server. The '-a' (ascii) and '-i' (image) options save the
type for subsequent transfers. When a filename is encountered it
is sent to the server with the command for the selected action.</p>
<p>It is possible to send multiple files with different modes on the
same command line. For example, the following command will send all
text files in ascii mode and all zip files in image mode:</p>
<pre>
qftp send srvr -a *.txt -i *.zip
</pre>
<p><i>qftp</i> may optionally be invoked through a softlink.
<i>qftp</i> searches the command which invoked it for 'send', 'get'
or 'dir' and, if found, performs the requested function. In this
case, leave off the <b>action</b> argument on the command line.</p>
<p>For example; create the following softlinks:</p>
<pre>
ln -s qftp ftpsend
ln -s qftp ftpget
ln -s qftp ftpdir
ln -s qftp ftplist
ln -s qftp ftprm
</pre>
<p>and then invoke transfers with 'ftpsend' instead of 'qftp send',
etc.</p>
<p>If no file names are specified on the command line, <i>qftp</i>
will read file names from stdin. Use your favorite utility to
generate a list of files to send/retreive or type them
interactively.</p>
</body>
</html>

View File

@ -1,73 +0,0 @@
#
# This makefile contains modifications submitted by Richard Braakman
# (dark@xs4all.nl) for the shared library generation.
#
# By default, ftplib uses PASV. If you need it to use PORT
# instead, uncomment the next line
#DEFINES = -DFTPLIB_DEFMODE=FTPLIB_PORT
SONAME = 4
SOVERSION = $(SONAME).0
TARGETS = qftp libftp.so libftp.a qftp.static
OBJECTS = qftp.o ftplib.o
SOURCES = qftp.c ftplib.c
CFLAGS = -Wall $(DEBUG) -I. $(INCLUDES) $(DEFINES) -Wno-unused-variable -D_FILE_OFFSET_BITS=64 -D__unix__
LDFLAGS = -L.
DEPFLAGS =
all : $(TARGETS)
clean :
rm -f $(OBJECTS) core *.bak
rm -rf unshared
clobber : clean
rm -f $(TARGETS) .depend
rm -f libftp.so.*
install : all
install qftp /usr/local/bin
install -m 644 libftp.so.$(SOVERSION) /usr/local/lib
install -m 644 ftplib.h /usr/local/include
(cd /usr/local/lib && \
ln -sf libftp.so.$(SOVERSION) libftp.so.$(SONAME) && \
ln -sf libftp.so.$(SONAME) libftp.so)
-(cd /usr/local/bin && \
for f in ftpdir ftpget ftplist ftprm ftpsend; \
do ln -s qftp $$f; done)
depend :
$(CC) $(CFLAGS) -M $(SOURCES) > .depend
# build without -fPIC
unshared/ftplib.o: ftplib.c ftplib.h
test -d unshared || mkdir unshared
$(CC) -c $(CFLAGS) -D_REENTRANT $< -o $@
static : libftp.a qftp.static
qftp.static : qftp.o libftp.a
$(CC) -o $@ $< libftp.a
ftplib.o: ftplib.c ftplib.h
$(CC) -c $(CFLAGS) -fPIC -D_REENTRANT $< -o $@
libftp.a: unshared/ftplib.o
ar -rcs $@ $<
libftp.so.$(SOVERSION): ftplib.o
$(CC) -shared -Wl,-soname,libftp.so.$(SONAME) -lc -o $@ $<
libftp.so: libftp.so.$(SOVERSION)
ln -sf $< libftp.so.$(SONAME)
ln -sf $< $@
qftp : qftp.o libftp.so ftplib.h
$(CC) $(LDFLAGS) -o $@ $< -lftp
ifeq (.depend,$(wildcard .depend))
include .depend
endif

View File

@ -1,24 +0,0 @@
To build FTPlib on linux, type 'make'. This should produce a shared
library and a static library. It should also create the qftp
executable. 'make install' should install into /usr/local. To
install elsewhere, modify the Makefile.
To build on MAC, type 'make static'. This should build a static link
library and qftp.static.
The provided Makefile may work on other unix-like systems although it
will most likely require some modifications.
To build on OpenVMS, some extra files are provided. DESCRIP.MMS can
be used with MMS or MMK. Options files are provied for VAX, Alpha and
Itanium systems.
This release was not tested on Microsoft Windows. Previous releases
have built without any problems and I don't believe any significant
changes have ocurred that should cause this release to fail. To build
on Windows using Visual Studio, create a library project for FTPlib
and a command line executable project qftp. Add a dependency from
qftp to FTPlib. 'Build All' should create working files.
Also not tested but the provided Makefile will probably work with
Cygwin.

View File

@ -1,40 +0,0 @@
.ifdef MMSIA64
SUFFIX = _IA64
CFLAGS = $(CFLAGS)/define=(_LARGEFILE)
.endif
.ifdef MMSALPHA
SUFFIX = _ALPHA
CFLAGS = $(CFLAGS)/define=(_LARGEFILE)
.endif
.ifdef MMSVAX
XFER_VECTOR = ftplib_vector.obj
.endif
TARGETS = ftplib$(SUFFIX).exe qftp$(SUFFIX).exe
SHLINKFLAGS = /SHARE=$(MMS$TARGET)/NOMAP
* : $(TARGETS)
continue
clean :
if f$search("ftplib.obj") .nes. "" then delete ftplib.obj;*
if f$search("ftplib_alpha.obj") .nes. "" then delete ftplib_alpha.obj;*
if f$search("ftplib.exe") .nes. "" then delete ftplib.exe;*
if f$search("ftplib_alpha.exe") .nes. "" then delete ftplib_alpha.exe;*
if f$search("qftp.obj") .nes. "" then delete qftp.obj;*
if f$search("qftp_alpha.obj") .nes. "" then delete qftp_alpha.obj;*
if f$search("qftp.exe") .nes. "" then delete qftp.exe;*
if f$search("qftp_alpha.exe") .nes. "" then delete qftp_alpha.exe;*
if f$search("ftplib_vector.obj") .nes. "" then delete ftplib_vector.obj;*
ftplib$(SUFFIX).obj : ftplib.c ftplib.h
$(CC) $(CFLAGS) $<
ftplib$(SUFFIX).exe : ftplib$(SUFFIX).obj $(XFER_VECTOR)
$(LINK) $(SHLINKFLAGS) ftplib$(SUFFIX).opt/options
qftp$(SUFFIX).exe : qftp$(SUFFIX).obj
$(LINK) $(LINKFLAGS) qftp$(SUFFIX).opt/options
qftp$(SUFFIX).obj : qftp.c ftplib.h
$(CC) $(CFLAGS) $<

File diff suppressed because it is too large Load Diff

View File

@ -1,120 +0,0 @@
/***************************************************************************/
/* */
/* ftplib.h - header file for callable ftp access routines */
/* Copyright (C) 1996-2001, 2013, 2016 Thomas Pfau, tfpfau@gmail.com */
/* 1407 Thomas Ave, North Brunswick, NJ, 08902 */
/* */
/* This library is free software. You can redistribute it and/or */
/* modify it under the terms of the Artistic License 2.0. */
/* */
/* This library is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* Artistic License 2.0 for more details. */
/* */
/* See the file LICENSE or */
/* http://www.perlfoundation.org/artistic_license_2_0 */
/* */
/***************************************************************************/
#if !defined(__FTPLIB_H)
#define __FTPLIB_H
#if defined(__unix__) || defined(VMS)
#define GLOBALDEF
#define GLOBALREF extern
#elif defined(_WIN32)
#if defined BUILDING_LIBRARY
#define GLOBALDEF __declspec(dllexport)
#define GLOBALREF __declspec(dllexport)
#else
#define GLOBALREF __declspec(dllimport)
#endif
#endif
#include <limits.h>
#include <inttypes.h>
/* FtpAccess() type codes */
#define FTPLIB_DIR 1
#define FTPLIB_DIR_VERBOSE 2
#define FTPLIB_FILE_READ 3
#define FTPLIB_FILE_WRITE 4
/* FtpAccess() mode codes */
#define FTPLIB_ASCII 'A'
#define FTPLIB_IMAGE 'I'
#define FTPLIB_TEXT FTPLIB_ASCII
#define FTPLIB_BINARY FTPLIB_IMAGE
/* connection modes */
#define FTPLIB_PASSIVE 1
#define FTPLIB_PORT 2
/* connection option names */
#define FTPLIB_CONNMODE 1
#define FTPLIB_CALLBACK 2
#define FTPLIB_IDLETIME 3
#define FTPLIB_CALLBACKARG 4
#define FTPLIB_CALLBACKBYTES 5
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__UINT64_MAX)
typedef uint64_t fsz_t;
#else
typedef uint32_t fsz_t;
#endif
typedef struct NetBuf netbuf;
typedef int (*FtpCallback)(netbuf *nControl, fsz_t xfered, void *arg);
typedef struct FtpCallbackOptions {
FtpCallback cbFunc; /* function to call */
void *cbArg; /* argument to pass to function */
unsigned int bytesXferred; /* callback if this number of bytes transferred */
unsigned int idleTime; /* callback if this many milliseconds have elapsed */
} FtpCallbackOptions;
GLOBALREF int ftplib_debug;
GLOBALREF void FtpInit(void);
GLOBALREF char *FtpLastResponse(netbuf *nControl);
GLOBALREF int FtpConnect(const char *host, netbuf **nControl);
GLOBALREF int FtpOptions(int opt, long val, netbuf *nControl);
GLOBALREF int FtpSetCallback(const FtpCallbackOptions *opt, netbuf *nControl);
GLOBALREF int FtpClearCallback(netbuf *nControl);
GLOBALREF int FtpLogin(const char *user, const char *pass, netbuf *nControl);
GLOBALREF int FtpAccess(const char *path, int typ, int mode, netbuf *nControl,
netbuf **nData);
GLOBALREF int FtpRead(void *buf, int max, netbuf *nData);
GLOBALREF int FtpWrite(const void *buf, int len, netbuf *nData);
GLOBALREF int FtpClose(netbuf *nData);
GLOBALREF int FtpSite(const char *cmd, netbuf *nControl);
GLOBALREF int FtpSysType(char *buf, int max, netbuf *nControl);
GLOBALREF int FtpMkdir(const char *path, netbuf *nControl);
GLOBALREF int FtpChdir(const char *path, netbuf *nControl);
GLOBALREF int FtpCDUp(netbuf *nControl);
GLOBALREF int FtpRmdir(const char *path, netbuf *nControl);
GLOBALREF int FtpPwd(char *path, int max, netbuf *nControl);
GLOBALREF int FtpNlst(const char *output, const char *path, netbuf *nControl);
GLOBALREF int FtpDir(const char *output, const char *path, netbuf *nControl);
GLOBALREF int FtpSize(const char *path, unsigned int *size, char mode, netbuf *nControl);
#if defined(__UINT64_MAX)
GLOBALREF int FtpSizeLong(const char *path, fsz_t *size, char mode, netbuf *nControl);
#endif
GLOBALREF int FtpModDate(const char *path, char *dt, int max, netbuf *nControl);
GLOBALREF int FtpGet(const char *output, const char *path, char mode,
netbuf *nControl);
GLOBALREF int FtpPut(const char *input, const char *path, char mode,
netbuf *nControl);
GLOBALREF int FtpRename(const char *src, const char *dst, netbuf *nControl);
GLOBALREF int FtpDelete(const char *fnm, netbuf *nControl);
GLOBALREF void FtpQuit(netbuf *nControl);
#ifdef __cplusplus
};
#endif
#endif /* __FTPLIB_H */

View File

@ -1,8 +0,0 @@
ident=V4.0
gsmatch=lequal,4,0
ftplib.obj
ftplib_vector.obj
collect=transfer_vectors,ftplib_vector
universal=ftplib_debug

View File

@ -1,35 +0,0 @@
ident=V4.0
gsmatch=lequal,4,0
ftplib_alpha.obj
symbol_vector=(-
FTPACCESS=procedure,-
FTPCHDIR=procedure,-
FTPCLOSE=procedure,-
FTPCONNECT=procedure,-
FTPDELETE=procedure,-
FTPDIR=procedure,-
FTPGET=procedure,-
FTPINIT=procedure,-
FTPLASTRESPONSE=procedure,-
FTPLIB_DEBUG=data,-
FTPLOGIN=procedure,-
FTPMKDIR=procedure,-
FTPNLST=procedure,-
FTPPUT=procedure,-
FTPQUIT=procedure,-
FTPREAD=procedure,-
FTPRENAME=procedure,-
FTPRMDIR=procedure,-
FTPSITE=procedure,-
FTPWRITE=procedure,-
FTPPWD=procedure,-
FTPSYSTYPE=procedure,-
FTPCDUP=procedure,-
FTPSIZE=procedure,-
FTPMODDATE=procedure,-
FTPOPTIONS=procedure,-
FTPSIZELONG=procedure,-
FTPSETCALLBACK=procedure,-
FTPCLEARCALLBACK=procedure)

View File

@ -1,35 +0,0 @@
ident=V4.0
gsmatch=lequal,4,0
ftplib_ia64.obj
symbol_vector=(-
FTPACCESS=procedure,-
FTPCHDIR=procedure,-
FTPCLOSE=procedure,-
FTPCONNECT=procedure,-
FTPDELETE=procedure,-
FTPDIR=procedure,-
FTPGET=procedure,-
FTPINIT=procedure,-
FTPLASTRESPONSE=procedure,-
FTPLIB_DEBUG=data,-
FTPLOGIN=procedure,-
FTPMKDIR=procedure,-
FTPNLST=procedure,-
FTPPUT=procedure,-
FTPQUIT=procedure,-
FTPREAD=procedure,-
FTPRENAME=procedure,-
FTPRMDIR=procedure,-
FTPSITE=procedure,-
FTPWRITE=procedure,-
FTPPWD=procedure,-
FTPSYSTYPE=procedure,-
FTPCDUP=procedure,-
FTPSIZE=procedure,-
FTPMODDATE=procedure,-
FTPOPTIONS=procedure,-
FTPSIZELONG=procedure,-
FTPSETCALLBACK=procedure,-
FTPCLEARCALLBACK=procedure)

View File

@ -1,36 +0,0 @@
.title ftplib_vector
.macro xfer rtn
.align quad
.transfer rtn
.mask rtn
jmp rtn+2
.endm
.psect ftplib_vector,quad
xfer FTPACCESS
xfer FTPCHDIR
xfer FTPCLOSE
xfer FTPCONNECT
xfer FTPDELETE
xfer FTPDIR
xfer FTPGET
xfer FTPINIT
xfer FTPLASTRESPONSE
xfer FTPLOGIN
xfer FTPMKDIR
xfer FTPNLST
xfer FTPPUT
xfer FTPQUIT
xfer FTPREAD
xfer FTPRENAME
xfer FTPRMDIR
xfer FTPSITE
xfer FTPWRITE
xfer FTPPWD
xfer FTPSYSTYPE
xfer FTPCDUP
xfer FTPSIZE
xfer FTPMODDATE
xfer FTPOPTIONS
xfer FTPSETCALLBACK
xfer FTPCLEARCALLBACK
.end

View File

@ -1,470 +0,0 @@
/***************************************************************************/
/* */
/* qftp.c - command line driven ftp file transfer program */
/* Copyright (C) 1996-2001, 2013, 2016 Thomas Pfau, tfpfau@gmail.com */
/* 1407 Thomas Ave, North Brunswick, NJ, 08902 */
/* */
/* This library is free software. You can redistribute it and/or */
/* modify it under the terms of the Artistic License 2.0. */
/* */
/* This library is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* Artistic License 2.0 for more details. */
/* */
/* See the file LICENSE or */
/* http://www.perlfoundation.org/artistic_license_2_0 */
/* */
/***************************************************************************/
#if defined(__unix__) || defined(__VMS)
#include <unistd.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include <sys/stat.h>
#if defined(_WIN32)
#include <winsock.h>
#include <io.h>
#include "getopt.h"
#endif
#include "ftplib.h"
#if !defined(S_ISDIR)
#define S_ISDIR(m) ((m&S_IFMT) == S_IFDIR)
#endif
/* exit values */
#define EX_SYNTAX 2 /* command syntax errors */
#define EX_NETDB 3 /* network database errors */
#define EX_CONNECT 4 /* network connect errors */
#define EX_LOGIN 5 /* remote login errors */
#define EX_REMCMD 6 /* remote command errors */
#define EX_SYSERR 7 /* system call errors */
#define FTP_SEND 1 /* send files */
#define FTP_GET 2 /* retreive files */
#define FTP_DIR 3 /* verbose directory */
#define FTP_RM 4 /* delete files */
#define FTP_LIST 5 /* terse directory */
#define DIRBUF_SIZE 1024 /* for wildcard processing */
#if defined(__UINT64_MAX)
#if defined(PRIu64)
#define PRIFSZ PRIu64
#else
#if ULONG_MAX == __UINT32_MAX
#define PRIFSZ "llu"
#else
#define PRIFSZ "lu"
#endif
#endif
#else
#ifdef PRIu32
#define PRIFSZ PRIu32
#else
#define PRIFSZ "u"
#endif
#endif
static int logged_in = 0;
static char *host = NULL;
static char *user = NULL;
static char *pass = NULL;
static char mode = 'I';
static int action = 0;
static char *invocation;
static netbuf *conn = NULL;
static int wildcard = 0;
static int strippath = 0;
void usage(void)
{
printf(
"usage: %s <cmd> <host>\n"
"\t cmd = send | get | dir | list | rm\n"
"\t[ -l user [ -p pass ] ] defaults to anonymous/user@hostname\n"
"\t[\n"
"\t [ -v level ] debug level\n"
"\t [ -r rootpath ] chdir path\n"
"\t [ -m umask ] umask for created files\n"
"\t [ -a | -i ] ] ascii/image transfer file\n"
"\t [ -w ] toggle wildcard mode\n"
"\t [ -s cmd ] issue a SITE command\n"
"\t [ -b ] toggles stripping of path from filename on send\n"
"\t [ file ] file spec for directory or file to transfer\n"
"\t]...\n\n"
"If no files are specified on command line, the program\n"
"will read file names from stdin.\n", invocation);
}
void ftp_connect(void)
{
if (conn)
return;
if (host == NULL)
{
fprintf(stderr,"Host name not specified\n");
usage();
exit(EX_SYNTAX);
}
if (!logged_in)
{
if (user == NULL)
{
user = "anonymous";
if (pass == NULL)
{
char *u,h[64];
u = getenv("USER");
if (gethostname(h,64) < 0)
{
perror("gethostname");
exit(EX_NETDB);
}
if ((u != NULL) && (h != NULL))
{
static char xxx[256];
sprintf(xxx,"%s@%s",u,h);
pass = xxx;
}
}
}
else if (pass == NULL)
#if defined(_WIN32) || defined(VMS)
exit(EX_LOGIN);
#else
if ((pass = getpass("Password: ")) == NULL)
exit(EX_SYSERR);
#endif
if (!FtpConnect(host,&conn))
{
fprintf(stderr,"Unable to connect to node %s\n",host);
exit(EX_CONNECT);
}
if (!FtpLogin(user,pass,conn))
{
fprintf(stderr,"Login failure\n%s",FtpLastResponse(conn));
exit(EX_LOGIN);
}
logged_in++;
}
}
void change_directory(char *root)
{
ftp_connect();
if (!FtpChdir(root, conn))
{
fprintf(stderr,"Change directory failed\n%s",FtpLastResponse(conn));
exit(EX_REMCMD);
}
}
void site_cmd(char *cmd)
{
ftp_connect();
if (!FtpSite( cmd, conn ))
{
fprintf(stderr,"SITE command failed\n%s", FtpLastResponse(conn));
exit(EX_REMCMD);
}
}
struct REMFILE {
struct REMFILE *next;
fsz_t fsz;
char *fnm;
};
static int log_progress(netbuf *ctl, fsz_t xfered, void *arg)
{
struct REMFILE *f = (struct REMFILE *) arg;
if ( f->fsz )
{
double pct = (xfered * 100.0) / f->fsz;
printf("%s %5.2f%% %" PRIFSZ "\r", f->fnm, pct, xfered);
}
else
{
printf("%s %" PRIFSZ "\r", f->fnm, xfered);
}
fflush(stdout);
return 1;
}
void process_file(char *fnm)
{
int sts=0;
fsz_t fsz;
struct REMFILE *filelist = NULL;
struct REMFILE rem;
ftp_connect();
FtpClearCallback(conn);
if ((action == FTP_SEND) || (action == FTP_GET) || (action == FTP_RM))
{
if (action == FTP_SEND)
{
struct stat info;
if (stat(fnm,&info) == -1)
{
perror(fnm);
return;
}
if (S_ISDIR(info.st_mode))
{
if (!FtpMkdir(fnm, conn))
fprintf(stderr,"mkdir %s failed\n%s",fnm,FtpLastResponse(conn));
else
if (ftplib_debug)
fprintf(stderr,"Directory %s created\n",fnm);
return;
}
fsz = info.st_size;
}
else
{
if (!wildcard)
{
struct REMFILE *f;
f = (struct REMFILE *) malloc(sizeof(struct REMFILE));
memset(f,0,sizeof(struct REMFILE));
f->next = filelist;
filelist = f;
f->fnm = strdup(fnm);
} else {
netbuf *dir;
char *buf;
if (!FtpAccess(fnm, FTPLIB_DIR, FTPLIB_ASCII, conn, &dir))
{
fprintf(stderr,"error requesting directory of %s\n%s\n",
fnm, FtpLastResponse(conn));
return;
}
buf = malloc(DIRBUF_SIZE);
while (FtpRead(buf, DIRBUF_SIZE, dir) > 0)
{
struct REMFILE *f;
char *p;
f = (struct REMFILE *) malloc(sizeof(struct REMFILE));
memset(f,0,sizeof(struct REMFILE));
f->next = filelist;
p = strchr(buf,'\n');
if (p)
*p = '\0';
f->fnm = strdup(buf);
filelist = f;
}
free(buf);
FtpClose(dir);
}
}
}
switch (action)
{
case FTP_DIR :
sts = FtpDir(NULL, fnm, conn);
break;
case FTP_LIST :
sts = FtpNlst(NULL, fnm, conn);
break;
case FTP_SEND :
rem.next = NULL;
rem.fnm = fnm;
rem.fsz = fsz;
fsz /= 100;
if (fsz > 100000)
fsz = 100000;
if (ftplib_debug && fsz)
{
FtpCallbackOptions opt;
opt.cbFunc = log_progress;
opt.cbArg = &rem;
opt.idleTime = 1000;
opt.bytesXferred = fsz;
FtpSetCallback(&opt,conn);
}
sts = FtpPut(fnm,strippath ? basename(fnm) : fnm,mode,conn);
if (ftplib_debug && sts)
printf("%s sent\n",fnm);
break;
case FTP_GET :
while (filelist)
{
struct REMFILE *f = filelist;
filelist = f->next;
#if defined(__UINT64_MAX)
if (!FtpSizeLong(f->fnm, &fsz, mode, conn))
#else
if (!FtpSize(f->fnm, &fsz, mode, conn))
#endif
fsz = 0;
f->fsz = fsz;
fsz /= 100;
if (fsz > 100000)
fsz = 100000;
if ( fsz == 0 )
fsz = 32768;
if (ftplib_debug)
{
FtpCallbackOptions opt;
opt.cbFunc = log_progress;
opt.cbArg = f;
opt.idleTime = 1000;
opt.bytesXferred = fsz;
FtpSetCallback(&opt,conn);
}
sts = FtpGet(f->fnm,f->fnm,mode,conn);
if (ftplib_debug && sts)
printf("%s retrieved\n",f->fnm);
free(f->fnm);
free(f);
}
break;
case FTP_RM :
while (filelist)
{
struct REMFILE *f = filelist;
filelist = f->next;
sts = FtpDelete(f->fnm,conn);
if (ftplib_debug && sts)
printf("%s deleted\n", f->fnm);
free(f->fnm);
free(f);
}
break;
}
if (!sts)
printf("ftp error\n%s\n",FtpLastResponse(conn));
return;
}
void set_umask(char *m)
{
char buf[80];
sprintf(buf,"umask %s", m);
ftp_connect();
FtpSite(buf, conn);
}
int main(int argc, char *argv[])
{
int files_processed = 0;
int opt;
invocation = argv[0];
optind = 1;
if (strstr(argv[0],"send") != NULL)
action = FTP_SEND;
else if (strstr(argv[0],"get") != NULL)
action = FTP_GET;
else if (strstr(argv[0],"dir") != NULL)
action = FTP_DIR;
else if (strstr(argv[0],"list") != NULL)
action = FTP_LIST;
else if (strstr(argv[0],"rm") != NULL)
action = FTP_RM;
if ((action == 0) && (argc > 2))
{
if ( argc < 3 ) /* command + site */
{
usage();
exit( EX_SYNTAX );
}
if (strcmp(argv[1],"send") == 0)
action = FTP_SEND;
else if (strcmp(argv[1],"get") == 0)
action = FTP_GET;
else if (strcmp(argv[1],"dir") == 0)
action = FTP_DIR;
else if (strcmp(argv[1],"list") == 0)
action = FTP_LIST;
else if (strcmp(argv[1],"rm") == 0)
action = FTP_RM;
if (action)
optind++;
}
if (action == 0)
{
usage();
exit(EX_SYNTAX);
}
FtpInit();
// while (argv[optind] != NULL)
while ( optind < argc )
{
if (argv[optind][0] != '-')
{
if (host == NULL)
host = argv[optind++];
else
{
process_file(argv[optind++]);
files_processed++;
}
continue;
}
opt = getopt(argc,argv,"abil:m:p:r:s:v:w");
switch (opt)
{
case '?' :
fprintf(stderr,"Invalid option: %c\n", opt);
usage();
exit(EX_SYNTAX);
case ':' :
usage();
exit(EX_SYNTAX);
case 'a' : mode = 'A'; break;
case 'b' : strippath = !strippath; break;
case 'i' : mode = 'I'; break;
case 'l' : user = optarg; break;
case 'm' : set_umask(optarg); break;
case 'p' : pass = optarg; break;
case 'r' : change_directory(optarg); break;
case 's' : site_cmd(optarg); break;
case 'v' :
if (opt == ':')
ftplib_debug++;
else
ftplib_debug = atoi(optarg);
break;
case 'w' : wildcard = !wildcard; break;
default :
usage();
exit(EX_SYNTAX);
}
}
if (files_processed == 0)
{
ftp_connect();
if ((action == FTP_DIR) || (action == FTP_LIST))
process_file(NULL);
else
{
char fnm[256];
do
{
char *nl;
if (isatty(fileno(stdin)))
printf("file> ");
if (fgets(fnm, sizeof(fnm), stdin) == NULL)
break;
if ((nl = strchr(fnm,'\n')) != NULL)
*nl = '\0';
process_file(fnm);
}
while (1);
}
}
if (conn)
FtpClose(conn);
return 0;
}

View File

@ -1,2 +0,0 @@
qftp.obj
ftplib.exe/share

View File

@ -1,2 +0,0 @@
qftp_alpha.obj
ftplib_alpha.exe/share

View File

@ -1,2 +0,0 @@
qftp_ia64.obj
ftplib_ia64.exe/share