File: parse.h

package info (click to toggle)
apt-spy 3.1-16
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 312 kB
  • ctags: 55
  • sloc: ansic: 826; makefile: 53; sh: 6
file content (33 lines) | stat: -rw-r--r-- 855 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* apt-spy (c) Steven Holmes, 2003. This software is licensed as detailed in the LICENSE file. */

#ifndef __PARSE_H
#define __PARSE_H

enum protocol { FTP, HTTP };

/* hack */
extern int BESTNUMBER;

struct stats_struct {
	int protocol;
	double speed;
};

struct server_struct {
	char	*hostname;
	char	*path[2];
	char	*url[2];
	struct	stats_struct stats;
};

typedef struct server_struct server_t;

int build_area_file(FILE *config_p, FILE *infile_p, FILE *mirror_list, char *area);
int build_country_file(FILE *config_p, FILE *infile_p, FILE *mirror_p, char *country_list);
int find_country(FILE *mirror_list, char *country_code);
void tokenise(server_t *current, char *cur_entry);
char *get_mirrors(FILE *mirror_list);
int write_list(FILE *outfile_p, server_t *best, char *dist);
int write_top(FILE *infile_p, FILE *outfile_p, server_t *best);

#endif