4 * Author: Teemu Rantanen <tvr@cs.hut.fi>
5 * Copyright (c) 1992 Teemu Rantanen
8 * Created: Thu Apr 16 21:40:39 1992 tvr
9 * Last modified: Wed May 13 00:11:13 1992 tvr
18 * Data is store on linked list
20 typedef struct cl_data_s
22 struct cl_data_s *next;
23 struct cl_data_s *prev;
31 * This structure contains all information needed to accomplish this
34 typedef struct ClConnection_s
37 * address of this connection
42 * Fd of the connection. Also ftp connection data channel.
48 * If this fd is not set connection has to be polled. If it is NOT
49 * set, connection has to be selected (must not poll!)
54 * Function of this state machine
59 * Store junk here (address of data on connect() )
65 * Store command to write to the net here
72 cl_data_t *buffer_first;
73 cl_data_t *buffer_last;
76 * stuff given to HTLoadHTTP()
79 struct HTAnchor *anAnchor;
82 * How happened with load if on nonblocking mode
87 * Hostname on ftp connections
92 * Data port on ftp connections
107 * More data is to be read
109 #define CL_CONTINUES 0
112 * Connection completed
114 #define CL_COMPLETED 1
122 * Document already loaded (error)
124 #define CL_ALREADY_LOADED 3
130 ClConnection_t *ClOpenConnection (char *address);
132 struct HText *ClReadData (ClConnection_t * connection, int *how_done, int *fd);
134 void ClSetOptions (ClConnection_t * connection, int argc, char *argv[]);
136 void ClCloseConnection (ClConnection_t * connection);
138 int ClCanLoadToFile (char *address);
140 void ClSetFileNameForLoadingToFile (char *filename);
142 int ClConnectionOnLoadToFileMode (ClConnection_t * connection);
148 extern int WWWErwiseStatus;
149 extern ClConnection_t *WWWErwiseConnection;
151 void WWWErwiseConnect ();
152 void WWWErwiseSendCommand ();
153 void WWWErwiseReadData ();
154 void WWWErwiseParse ();
161 void WWWErwiseFtpUser ();
162 void WWWErwiseFtpPass ();
163 void WWWErwiseFtpPassive ();
164 void WWWErwiseFtpGetPassive ();
165 void WWWErwiseFtpGetCommand ();
166 void WWWErwiseFtpDataChannel ();
167 void WWWErwiseFtpCheckForError ();
168 void WWWErwiseFtpBinary ();
169 void WWWErwiseCheckParse ();
170 void WWWErwiseSetPoll ();
171 void WWWErwiseSetSelect ();
172 void WWWErwiseTerminateIfLoadToFile ();
174 int cl_start_connection ();
180 #define CL_DEBUG(a) printf a