summaryrefslogtreecommitdiffstats
path: root/lib/libftp/doc/example.tex
blob: 47c4a9d341837c9717e390f0a2bc4157f8141dbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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