~ubuntu-branches/ubuntu/gutsy/aide/gutsy-proposed

« back to all changes in this revision

Viewing changes to include/fopen.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Haber
  • Date: 2006-10-20 07:39:25 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061020073925-0qp33f39socewrj4
Tags: 0.12-2
* first try at dotlocking the cron job. This might be a possible
  solution for #245423.
* Update French (fr) debconf translation.
  Thanks to Gregory Colpart. Closes: #393294
* Update Spanish (es) debconf translation.
  Thanks to Rudy Godoy. Closes: #393781

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "aide.h"
 
2
 
 
3
#ifdef WITH_CURL
 
4
 
 
5
#include <stdio.h>
 
6
#include <string.h>
 
7
#include <sys/time.h>
 
8
#include <stdlib.h>
 
9
#include <errno.h>
 
10
 
 
11
#include <curl/curl.h>
 
12
 
 
13
enum fcurl_type_e { CFTYPE_NONE=0, CFTYPE_FILE=1, CFTYPE_CURL=2 };
 
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
    int buffer_len;             /* currently allocated buffers length */
 
25
    int 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(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, int size, URL_FILE *file);
 
37
void url_rewind(URL_FILE *file);
 
38
 
 
39
#endif