Freeciv-3.2: /fast/freeciv/nightly/S3_2/utility/netfile.h File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
netfile.h File Reference
`#include "support.h"`

Go to the source code of this file.

## Data Structures

struct | netfile_write_cb_data

## Typedefs

typedef void(* | nf_errmsg) (const char *msg, void *data)

## Functions

struct section_file * | netfile_get_section_file (const char *URL, nf_errmsg cb, void *data)
bool | netfile_download_file (const char *URL, const char *filename, nf_errmsg cb, void *data)
struct netfile_post * | netfile_start_post (void)
void | netfile_add_form_str (struct netfile_post *post, const char *name, const char *val)
void | netfile_add_form_int (struct netfile_post *post, const char *name, const int val)
void | netfile_close_post (struct netfile_post *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)
void | netfile_free (void)

## Typedef Documentation

## ◆ nf_errmsg

typedef void(* nf_errmsg) (const char *msg, void *data)

Definition at line 32 of file netfile.h.

## Function Documentation

## ◆ netfile_add_form_int()

void netfile_add_form_int | ( | struct netfile_post * | post,
|  | const char * | name,
|  | const int | val
| ) |  |

Add one integer entry to netfile post form

Definition at line 232 of file netfile.c.

## ◆ netfile_add_form_str()

void netfile_add_form_str | ( | struct netfile_post * | post,
|  | const char * | name,
|  | const char * | val
| ) |  |

Add one entry to netfile post form

Definition at line 211 of file netfile.c.

Referenced by netfile_add_form_int().

## ◆ netfile_close_post()

void netfile_close_post | ( | struct netfile_post * | post | ) |

Free netfile_post resources

Definition at line 244 of file netfile.c.

## ◆ netfile_download_file()

bool netfile_download_file | ( | const char * | URL,
|  | const char * | filename,
|  | nf_errmsg | cb,
|  | void * | data
| ) |  |

Fetch file from given URL and save as given filename.

Definition at line 168 of file netfile.c.

Referenced by download_modpack_recursive().

## ◆ netfile_free()

void netfile_free | ( | void |  | ) |

Free resources reserved by the netfile system

Definition at line 327 of file netfile.c.

Referenced by libfreeciv_free().

## ◆ netfile_get_section_file()

struct section_file * netfile_get_section_file | ( | const char * | URL,
|  | nf_errmsg | cb,
|  | void * | data
| ) |  |

Fetch section file from net

Definition at line 146 of file netfile.c.

Referenced by download_modpack_list(), and download_modpack_recursive().

## ◆ 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
| ) |  |

Send HTTP POST

Definition at line 268 of file netfile.c.

## ◆ netfile_start_post()

struct netfile_post * netfile_start_post | ( | void |  | ) |

Allocate netfile_post

Definition at line 197 of file netfile.c.