Post Scarcity
A prototype for a post scarcity programming environment
Loading...
Searching...
No Matches
fopen.h File Reference
#include <curl/curl.h>
#include <wchar.h>
#include <wctype.h>
Include dependency graph for fopen.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fcurl_data
 
union  fcurl_data.handle
 

Macros

#define url_fputwc(wc, f)   ((f->type = CFTYPE_FILE) ? fputwc(wc, f->handle.file) : 0)
 
#define url_fputws(ws, f)   ((f->type = CFTYPE_FILE) ? fputws(ws, f->handle.file) : 0)
 
#define url_fwprintf(f, ...)   ((f->type = CFTYPE_FILE) ? fwprintf( f->handle.file, __VA_ARGS__) : -1)
 

Typedefs

typedef struct fcurl_data URL_FILE
 

Enumerations

enum  fcurl_type_e { CFTYPE_NONE = 0 , CFTYPE_FILE = 1 , CFTYPE_CURL = 2 }
 

Functions

int url_fclose (URL_FILE *file)
 
int url_feof (URL_FILE *file)
 
char * url_fgets (char *ptr, size_t size, URL_FILE *file)
 
URL_FILEurl_fopen (const char *url, const char *operation)
 
size_t url_fread (void *ptr, size_t size, size_t nmemb, URL_FILE *file)
 
void url_rewind (URL_FILE *file)
 

Data Structure Documentation

◆ fcurl_data

struct fcurl_data

Definition at line 60 of file fopen.h.

Data Fields
char * buffer
size_t buffer_len
size_t buffer_pos
union fcurl_data.handle handle
int still_running
enum fcurl_type_e type

◆ fcurl_data.handle

union fcurl_data.handle

Definition at line 62 of file fopen.h.

Data Fields
CURL * curl
FILE * file

Macro Definition Documentation

◆ url_fputwc

#define url_fputwc (   wc,
 
)    ((f->type = CFTYPE_FILE) ? fputwc(wc, f->handle.file) : 0)

Definition at line 52 of file fopen.h.

◆ url_fputws

#define url_fputws (   ws,
 
)    ((f->type = CFTYPE_FILE) ? fputws(ws, f->handle.file) : 0)

Definition at line 51 of file fopen.h.

◆ url_fwprintf

#define url_fwprintf (   f,
  ... 
)    ((f->type = CFTYPE_FILE) ? fwprintf( f->handle.file, __VA_ARGS__) : -1)

Definition at line 50 of file fopen.h.

Typedef Documentation

◆ URL_FILE

typedef struct fcurl_data URL_FILE

Definition at line 73 of file fopen.h.

Enumeration Type Documentation

◆ fcurl_type_e

Enumerator
CFTYPE_NONE 
CFTYPE_FILE 
CFTYPE_CURL 

Definition at line 54 of file fopen.h.

Function Documentation

◆ url_fclose()

int url_fclose ( URL_FILE file)

Definition at line 258 of file fopen.c.

References fcurl_data::buffer, CFTYPE_CURL, CFTYPE_FILE, fcurl_data::handle, and fcurl_data::type.

Referenced by free_cell(), and lisp_close().

◆ url_feof()

◆ url_fgets()

char * url_fgets ( char *  ptr,
size_t  size,
URL_FILE file 
)

◆ url_fopen()

URL_FILE * url_fopen ( const char *  url,
const char *  operation 
)

◆ url_fread()

size_t url_fread ( void *  ptr,
size_t  size,
size_t  nmemb,
URL_FILE file 
)

◆ url_rewind()