File: parse.h

package info (click to toggle)
apt-spy 3.1-19
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 252 kB
  • ctags: 54
  • sloc: ansic: 898; makefile: 51; sh: 12
file content (38 lines) | stat: -rw-r--r-- 1,025 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
34
35
36
37
38
/* 
 * apt-spy (c) Steven Holmes, 2003. 
 *         (c) Stefano Canepa <sc@linux.it> , 2008 
 * 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_list(FILE *outfile_p, server_t *best, char *dist, char *section_list, char *args[], int l);
int write_top(FILE *infile_p, FILE *outfile_p, server_t *best);

#endif