File: wget_common.h

package info (click to toggle)
pcb-rnd 2.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 35,428 kB
  • sloc: ansic: 249,627; yacc: 5,981; sh: 5,748; makefile: 3,595; awk: 2,704; lex: 1,094; python: 519; lisp: 169; xml: 128; tcl: 67; perl: 34; javascript: 6; ruby: 5
file content (18 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>

typedef enum {
	FP_WGET_UPDATE = 1,  /* wget -c: update existing file, don't replace (a.k.a. cache) */
	FP_WGET_OFFLINE = 2  /* do not wget, open cached file or fail */
} fp_get_mode;

int fp_wget_open(const char *url, const char *cache_path, FILE **f, int *fctx, fp_get_mode mode);
int fp_wget_close(FILE **f, int *fctx);

char *load_md5_sum(FILE *f);
int md5_cmp_free(const char *last_fn, char *md5_last, char *md5_new);

/* search fn in an auto updated index file; return 0 on success and
   fill in out with the full path from the index. Search_cb: 
   search fn in an index file; return 0 on success and fill in out with the
   full path from the index. */
int fp_wget_search(char *out, int out_len, const char *fn, int offline, const char *idx_url, const char *idx_cache, int (*search_cb)(char *out, int out_len, FILE *f, const char *fn));