Debian Codegraph @

include/fopen.h

raw symbols SCIP
1 /* see src/fopen.c for copyright information */
2
3 #ifndef _FOPEN_H_INCLUDED
4 #define _FOPEN_H_INCLUDED
5
6 #include <stdio.h>
7 #include <curl/curl.h>
8
9 enum fcurl_type_e {
10 CFTYPE_NONE=0,
11 CFTYPE_FILE=1,
12 CFTYPE_CURL=2
13 };
14
15 struct fcurl_data
16 {
17 enum fcurl_type_e type; /* type of handle */
18 union {
19 CURL *curl;
20 FILE *file;
21 } handle; /* handle */
22
23 char *buffer; /* buffer to store cached data*/
24 size_t buffer_len; /* currently allocated buffers length */
25 size_t buffer_pos; /* end of data in buffer*/
26 int still_running; /* Is background url fetch still in progress */
27 };
28
29 typedef struct fcurl_data URL_FILE;
30
31 /* exported functions */
32 URL_FILE *url_fopen(const char *url,const char *operation);
33 int url_fclose(URL_FILE *file);
34 int url_feof(URL_FILE *file);
35 size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
36 char * url_fgets(char *ptr, size_t size, URL_FILE *file);
37 void url_rewind(URL_FILE *file);
38
39 #endif /* _FOPEN_H_INCLUDED */