Freeciv-3.3: /fast/freeciv/nightly/main/utility/netfile.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
netfile.h
Go to the documentation of this file.
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.
7
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***********************************************************************/
13
14#ifndef FC__NETFILE_H
15#define FC__NETFILE_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
21/* utility */
22#include "support.h" /* bool */
23
24struct netfile_post;
25
26 struct netfile_write_cb_data
27{
28 char *mem;
29 int size;
30};
31
32 typedef void (*nf_errmsg)(const char *msg, void *data);
33
34struct section_file *netfile_get_section_file(const char *URL,
35 nf_errmsg cb, void *data);
36
37bool netfile_download_file(const char *URL, const char *filename,
38 nf_errmsg cb, void *data);
39
40struct netfile_post *netfile_start_post(void);
41void netfile_add_form_str(struct netfile_post *post,
42 const char *name, const char *val);
43void netfile_add_form_int(struct netfile_post *post,
44 const char *name, const int val);
45void netfile_close_post(struct netfile_post *post);
46
47bool netfile_send_post(const char *URL, struct netfile_post *post,
48 FILE *reply_fp, struct netfile_write_cb_data *mem_data,
49 const char *addr);
50
51void netfile_free(void);
52
53#ifdef __cplusplus
54}
55#endif /* __cplusplus */
56
57#endif /* FC__NETFILE_H */
incite_cost
char * incite_cost
Definition comments.c:74
name
const char * name
Definition inputfile.c:127
netfile_close_post
void netfile_close_post(struct netfile_post *post)
Definition netfile.c:244
netfile_start_post
struct netfile_post * netfile_start_post(void)
Definition netfile.c:197
netfile_send_post
bool netfile_send_post(const char *URL, struct netfile_post *post, FILE *reply_fp, struct netfile_write_cb_data *mem_data, const char *addr)
Definition netfile.c:268
nf_errmsg
void(* nf_errmsg)(const char *msg, void *data)
Definition netfile.h:32
netfile_free
void netfile_free(void)
Definition netfile.c:327
netfile_get_section_file
struct section_file * netfile_get_section_file(const char *URL, nf_errmsg cb, void *data)
Definition netfile.c:146
netfile_add_form_int
void netfile_add_form_int(struct netfile_post *post, const char *name, const int val)
Definition netfile.c:232
netfile_add_form_str
void netfile_add_form_str(struct netfile_post *post, const char *name, const char *val)
Definition netfile.c:211
netfile_download_file
bool netfile_download_file(const char *URL, const char *filename, nf_errmsg cb, void *data)
Definition netfile.c:168
netfile_post
Definition netfile.c:39
netfile_write_cb_data
Definition netfile.h:27
netfile_write_cb_data::mem
char * mem
Definition netfile.h:28
netfile_write_cb_data::size
int size
Definition netfile.h:29
section_file
Definition section_file.h:36
support.h