webperimental: killstack decides stack protects.
[freeciv.git] / utility / netfile.h
blobb3782a143b3806fa3bcf8ddaa0c12d1c65c3c8ae
1 /**********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifndef FC__NETFILE_H
15 #define FC__NETFILE_H
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 struct netfile_post;
23 struct netfile_write_cb_data
25 char *mem;
26 int size;
29 typedef void (*nf_errmsg)(const char *msg, void *data);
31 struct section_file *netfile_get_section_file(const char *URL,
32 nf_errmsg cb, void *data);
34 bool netfile_download_file(const char *URL, const char *filename,
35 nf_errmsg cb, void *data);
37 struct netfile_post *netfile_start_post(void);
38 void netfile_add_form_str(struct netfile_post *post,
39 const char *name, const char *val);
40 void netfile_add_form_int(struct netfile_post *post,
41 const char *name, const int val);
42 void netfile_close_post(struct netfile_post *post);
44 bool netfile_send_post(const char *URL, struct netfile_post *post,
45 FILE *reply_fp, struct netfile_write_cb_data *mem_data,
46 const char *addr);
48 #ifdef __cplusplus
50 #endif /* __cplusplus */
52 #endif /* FC__NETFILE_H */