1      * Summary: minimal FTP implementation
2      * Description: minimal FTP implementation allowing to fetch resources
3      *              like external subset.
4      *
5      * Copy: See Copyright for the status of this software.
6      *
7      * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
8
9      /if not defined(NANO_FTP_H__)
10      /define NANO_FTP_H__
11
12      /include "libxmlrpg/xmlversion"
13
14      /if defined(LIBXML_FTP_ENABLED)
15
16      /include "libxmlrpg/xmlTypesC"
17
18     d INVALID_SOCKET  c                   -1
19
20      * ftpListCallback:
21      * @userData:  user provided data for the callback
22      * @filename:  the file name (including "->" when links are shown)
23      * @attrib:  the attribute string
24      * @owner:  the owner string
25      * @group:  the group string
26      * @size:  the file size
27      * @links:  the link count
28      * @year:  the year
29      * @month:  the month
30      * @day:  the day
31      * @hour:  the hour
32      * @minute:  the minute
33      *
34      * A callback for the xmlNanoFTPList command.
35      * Note that only one of year and day:minute are specified.
36
37     d ftpListCallback...
38     d                 s               *   based(######typedef######)
39     d                                     procptr
40
41      * ftpDataCallback:
42      * @userData: the user provided context
43      * @data: the data received
44      * @len: its size in bytes
45      *
46      * A callback for the xmlNanoFTPGet command.
47
48     d ftpDataCallback...
49     d                 s               *   based(######typedef######)
50     d                                     procptr
51
52      * Init
53
54     d xmlNanoFTPInit  pr                  extproc('xmlNanoFTPInit')
55
56     d xmlNanoFTPCleanup...
57     d                 pr                  extproc('xmlNanoFTPCleanup')
58
59      * Creating/freeing contexts.
60
61     d xmlNanoFTPNewCtxt...
62     d                 pr              *   extproc('xmlNanoFTPNewCtxt')         void *
63     d  URL                            *   value options(*string)               const char *
64
65     d xmlNanoFTPFreeCtxt...
66     d                 pr                  extproc('xmlNanoFTPFreeCtxt')
67     d  ctx                            *   value                                void *
68
69     d xmlNanoFTPConnectTo...
70     d                 pr              *   extproc('xmlNanoFTPConnectTo')       void *
71     d  server                         *   value options(*string)               const char *
72     d  port                               value like(xmlCint)
73
74      * Opening/closing session connections.
75
76     d xmlNanoFTPOpen  pr              *   extproc('xmlNanoFTPOpen')            void *
77     d  URL                            *   value options(*string)               const char *
78
79     d xmlNanoFTPConnect...
80     d                 pr                  extproc('xmlNanoFTPConnect')
81     d                                     like(xmlCint)
82     d  ctx                            *   value                                void *
83
84     d xmlNanoFTPClose...
85     d                 pr                  extproc('xmlNanoFTPClose')
86     d                                     like(xmlCint)
87     d  ctx                            *   value                                void *
88
89     d xmlNanoFTPQuit  pr                  extproc('xmlNanoFTPQuit')
90     d                                     like(xmlCint)
91     d  ctx                            *   value                                void *
92
93     d xmlNanoFTPScanProxy...
94     d                 pr                  extproc('xmlNanoFTPScanProxy')
95     d  URL                            *   value options(*string)               const char *
96
97     d xmlNanoFTPProxy...
98     d                 pr                  extproc('xmlNanoFTPProxy')
99     d  host                           *   value options(*string)               const char *
100     d  port                               value like(xmlCint)
101     d  user                           *   value options(*string)               const char *
102     d  passwd                         *   value options(*string)               const char *
103     d  type                               value like(xmlCint)
104
105     d xmlNanoFTPUpdateURL...
106     d                 pr                  extproc('xmlNanoFTPUpdateURL')
107     d                                     like(xmlCint)
108     d  ctx                            *   value                                void *
109     d  URL                            *   value options(*string)               const char *
110
111      * Rather internal commands.
112
113     d xmlNanoFTPGetResponse...
114     d                 pr                  extproc('xmlNanoFTPGetResponse')
115     d                                     like(xmlCint)
116     d  ctx                            *   value                                void *
117
118     d xmlNanoFTPCheckResponse...
119     d                 pr                  extproc('xmlNanoFTPCheckResponse')
120     d                                     like(xmlCint)
121     d  ctx                            *   value                                void *
122
123      * CD/DIR/GET handlers.
124
125     d xmlNanoFTPCwd   pr                  extproc('xmlNanoFTPCwd')
126     d                                     like(xmlCint)
127     d  ctx                            *   value                                void *
128     d  directory                      *   value options(*string)               const char *
129
130     d xmlNanoFTPDele  pr                  extproc('xmlNanoFTPDele')
131     d                                     like(xmlCint)
132     d  ctx                            *   value                                void *
133     d  file                           *   value options(*string)               const char *
134
135     d xmlNanoFTPGetConnection...
136     d                 pr                  extproc('xmlNanoFTPGetConnection')   Socket descriptor
137     d                                     like(xmlCint)
138     d  ctx                            *   value                                void *
139
140     d xmlNanoFTPCloseConnection...
141     d                 pr                  extproc('xmlNanoFTPCloseConnection')
142     d                                     like(xmlCint)
143     d  ctx                            *   value                                void *
144
145     d xmlNanoFTPList  pr                  extproc('xmlNanoFTPList')
146     d                                     like(xmlCint)
147     d  ctx                            *   value                                void *
148     d  callback                           value like(ftpListCallback)
149     d  userData                       *   value                                void *
150     d  filename                       *   value options(*string)               const char *
151
152     d xmlNanoFTPGetSocket...
153     d                 pr                  extproc('xmlNanoFTPGetSocket')       Socket descriptor
154     d                                     like(xmlCint)
155     d  ctx                            *   value                                void *
156     d  filename                       *   value options(*string)               const char *
157
158     d xmlNanoFTPGet   pr                  extproc('xmlNanoFTPGet')
159     d                                     like(xmlCint)
160     d  ctx                            *   value                                void *
161     d  callback                           value like(ftpDataCallback)
162     d  userData                       *   value                                void *
163     d  filename                       *   value options(*string)               const char *
164
165     d xmlNanoFTPRead  pr                  extproc('xmlNanoFTPRead')
166     d                                     like(xmlCint)
167     d  ctx                            *   value                                void *
168     d  dest                           *   value                                void *
169     d  len                                value like(xmlCint)
170
171      /endif                                                                    LIBXML_FTP_ENABLED
172      /endif                                                                    NANO_FTP_H__
173