summaryrefslogtreecommitdiffstats
path: root/lib/libftp/doc/example.tex
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-04-25 15:05:11 +0000
committerjkh <jkh@FreeBSD.org>1995-04-25 15:05:11 +0000
commit02ace706173509b7d8549494277ff682b7cefb8a (patch)
tree437a6d909f192743fe7d26def0fdfae947754209 /lib/libftp/doc/example.tex
downloadFreeBSD-src-02ace706173509b7d8549494277ff682b7cefb8a.zip
FreeBSD-src-02ace706173509b7d8549494277ff682b7cefb8a.tar.gz
A programmatic interface to ftp. I need this for several other
components of the system. The license is poorly worded, though I have an (email only) release from the author for unlimited FreeBSD use. I will try to get something more concrete, though the author's remote location makes this difficult. Submitted by: Oleg Orel <orel@oea.ihep.su>
Diffstat (limited to 'lib/libftp/doc/example.tex')
-rw-r--r--lib/libftp/doc/example.tex59
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/libftp/doc/example.tex b/lib/libftp/doc/example.tex
new file mode 100644
index 0000000..47c4a9d
--- /dev/null
+++ b/lib/libftp/doc/example.tex
@@ -0,0 +1,59 @@
+%%
+%% Creator: ansic2latex (from <stdin>)
+%% Date: Tue Dec 27 16:14:26 1994
+%%
+\expandafter\ifx\csname indentation\endcsname\relax
+\newlength{\indentation}\fi
+\setlength{\indentation}{0.5em}
+\begin{flushleft}
+\mbox{}\\
+{\em /$\ast$\hspace*{1\indentation}Include\hspace*{1\indentation}standard\hspace*{1\indentation}libftp's\hspace*{1\indentation}header\hspace*{1\indentation}$\ast$/}\mbox{}\\
+\mbox{}\\
+{\tt\#include} $<${\tt FtpLibrary.h}$>$ \mbox{}\\
+\mbox{}\\
+\mbox{}\\
+main({\bf int\/} argc, {\bf char\/} $\ast$argv[])\mbox{}\\
+\{\mbox{}\\
+\mbox{}\\
+\hspace*{2\indentation}FILE $\ast$input,$\ast$output;\mbox{}\\
+\hspace*{2\indentation}{\bf int\/} c;\mbox{}\\
+\hspace*{2\indentation}\mbox{}\\
+\mbox{}\\
+\hspace*{2\indentation}{\bf if\/} (argc$<$3)\mbox{}\\
+\hspace*{4\indentation}exit(fprintf(stderr,{\tt "Usage: \%s input-file output-file$\backslash$n"},argv[0]));\mbox{}\\
+\mbox{}\\
+\hspace*{2\indentation}FtplibDebug(yes);\mbox{}\\
+\hspace*{2\indentation}\mbox{}\\
+\hspace*{2\indentation}{\bf if\/} ((input=Ftpfopen(argv[1],{\tt "r"}))==NULL)\mbox{}\\
+\hspace*{4\indentation}\{\mbox{}\\
+\hspace*{6\indentation}perror(argv[1]);\mbox{}\\
+\hspace*{6\indentation}exit(1);\mbox{}\\
+\hspace*{4\indentation}\}\mbox{}\\
+\hspace*{2\indentation}\mbox{}\\
+\hspace*{2\indentation}{\bf if\/} ((output=Ftpfopen(argv[2],{\tt "w"}))==NULL)\mbox{}\\
+\hspace*{4\indentation}\{\mbox{}\\
+\hspace*{6\indentation}perror(argv[2]);\mbox{}\\
+\hspace*{6\indentation}exit(1);\mbox{}\\
+\hspace*{4\indentation}\}\mbox{}\\
+\hspace*{2\indentation}\mbox{}\\
+\hspace*{2\indentation}{\bf while\/} ( (c=getc(input)) $\neq$ EOF \&\& (putc(c,output)$\neq$EOF) );\mbox{}\\
+\mbox{}\\
+\hspace*{2\indentation}{\bf if\/} (ferror(input))\mbox{}\\
+\hspace*{4\indentation}\{\mbox{}\\
+\hspace*{6\indentation}perror(argv[1]);\mbox{}\\
+\hspace*{6\indentation}exit(1);\mbox{}\\
+\hspace*{4\indentation}\}\mbox{}\\
+\hspace*{2\indentation}\mbox{}\\
+\hspace*{2\indentation}{\bf if\/} (ferror(output))\mbox{}\\
+\hspace*{4\indentation}\{\mbox{}\\
+\hspace*{6\indentation}perror(argv[1]);\mbox{}\\
+\hspace*{6\indentation}exit(1);\mbox{}\\
+\hspace*{4\indentation}\}\mbox{}\\
+\mbox{}\\
+\hspace*{2\indentation}Ftpfclose(input);\mbox{}\\
+\hspace*{2\indentation}Ftpfclose(output);\mbox{}\\
+\mbox{}\\
+\hspace*{2\indentation}exit(0);\mbox{}\\
+\hspace*{2\indentation}\mbox{}\\
+\}\mbox{}\\
+\end{flushleft}
OpenPOWER on IntegriCloud