File: ftp.h

package info (click to toggle)
gopher 2.3-2
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 2,364 kB
  • ctags: 2,030
  • sloc: ansic: 22,451; perl: 1,950; sh: 1,510; makefile: 397; asm: 1
file content (98 lines) | stat: -rw-r--r-- 2,871 bytes parent folder | download | duplicates (2)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/********************************************************************
 * $Author: lindner $
 * $Revision: 3.9 $
 * $Date: 1995/09/25 05:02:34 $
 * $Source: /home/arcwelder/GopherSrc/CVS/gopher+/gopherd/ftp.h,v $
 * $State: Exp $
 *
 * Paul Lindner, University of Minnesota CIS.
 *
 * Copyright 1991, 1992 by the Regents of the University of Minnesota
 * see the file "Copyright" in the distribution for conditions of use.
 *********************************************************************
 * MODULE: ftp.h
 * Declartions for Routines to translate gopher protocol to ftp protocol.
 *********************************************************************
 * Revision History:
 * $Log: ftp.h,v $
 * Revision 3.9  1995/09/25  05:02:34  lindner
 * Convert to ANSI C
 *
 * Revision 3.8  1994/07/31  04:56:51  lindner
 * Mondo new stuff for ftp gateway
 *
 * Revision 3.7  1994/07/21  15:45:07  lindner
 * Gopher+ FTP gateway (modified from patch from Brian Coan)
 *
 * Revision 3.6  1994/06/29  05:23:14  lindner
 * Use an enum
 *
 * Revision 3.5  1994/03/08  15:55:34  lindner
 * gcc -Wall fixes
 *
 * Revision 3.4  1994/01/20  06:41:18  lindner
 * FTPtype macros changed to give FTPcommand the (char *) it was expecting
 * instead of the (char) is was getting.
 *
 * Revision 3.3  1993/12/16  11:34:42  lindner
 * Fixes to work with VM ftp servers
 *
 * Revision 3.2  1993/09/21  04:16:15  lindner
 * Fix for macro declarations
 *
 *
 *********************************************************************/

#ifndef GOPHER_FTP_H
#define GOPHER_FTP_H

#include "boolean.h"

typedef enum {FTP_UNKNOWN, FTP_VMS, FTP_NOVELL, FTP_UNIX, FTP_MTS, FTP_WINNT,
              FTP_MACOS, FTP_VM, FTP_UNIX_L8, FTP_MICRO_VAX, FTP_OS2
	 } FTPsystype;
	   

struct FTP_struct {
     int        control_sock;
     int        data_sock;
     char       mode;
     FTPsystype Ftptype;
};

typedef struct FTP_struct FTP;

/** Control socket access routines **/
#define FTPsetControl(ftp,num) ((ftp)->control_sock=(num))
#define FTPgetControl(ftp)     ((ftp)->control_sock)

/** Data socket access routines **/
#define FTPsetData(ftp,num)    ((ftp)->data_sock=(num))
#define FTPgetData(ftp)        ((ftp)->data_sock)


/** Ftp type access routines **/
#define FTPsetType(ftp,num)    ((ftp)->Ftptype=(num))
#define FTPgetType(ftp)        ((ftp)->Ftptype)

/** Type command **/
#define FTPtype(ftp,type)      FTPcommand(ftp,"TYPE %s",type,201)
#define FTPbinary(ftp)         FTPtype(ftp,"I")
#define FTPascii(ftp)          FTPtype(ftp,"A")


/** Chdir **/
/*#define FTPchdir(ftp,dir)         FTPcommand(ftp,"CWD %s",dir,299)*/

void FTPcleanup();
void FTPcloseData(FTP *);
void FTPdestroy(FTP *);
void FTPfindType(FTP *);
void FTPbyebye(FTP *);
void FTPopenData(FTP *ftp, char *command, char *file, int errorlevel);
boolean IsBinaryType(char *);
void FTPabort(FTP *);



#endif /* GOPHER_FTP_H */