The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions
fopencookie.c File Reference

Wrap funopen to provide an fopencookie compatible interface on systems that don't support it. More...

#include <freeradius-devel/util/talloc.h>
#include <stdio.h>
#include "fopencookie.h"
+ Include dependency graph for fopencookie.c:

Go to the source code of this file.

Data Structures

Macros

#define NEED_READ   0x01
 
#define NEED_SEEK   0x04
 
#define NEED_WRITE   0x02
 

Functions

static int _close (void *c)
 Wrap fopencookie close function and free our fr_funopen_cookie_t. More...
 
static int _read (void *c, char *buf, int n)
 Wrap fopencookie read function. More...
 
static fpos_t _seek (void *c, fpos_t offset, int whence)
 Wrap fopencookie seek function. More...
 
static int _write (void *c, const char *buf, int n)
 Wrap fopencookie write function. More...
 
FILE * fopencookie (void *cookie, const char *mode, cookie_io_functions_t io_funcs)
 

Detailed Description

Wrap funopen to provide an fopencookie compatible interface on systems that don't support it.

Definition in file fopencookie.c.


Data Structure Documentation

◆ fr_funopen_cookie_t

struct fr_funopen_cookie_t

Holds the fopencookie function pointers plus the funopen cookie.

Definition at line 38 of file fopencookie.c.

+ Collaboration diagram for fr_funopen_cookie_t:
Data Fields
void * cookie Original cookie passed to fopencookie.
cookie_io_functions_t io_funcs Fopencookie callbacks (which we wrap)

Macro Definition Documentation

◆ NEED_READ

#define NEED_READ   0x01

Definition at line 31 of file fopencookie.c.

◆ NEED_SEEK

#define NEED_SEEK   0x04

Definition at line 33 of file fopencookie.c.

◆ NEED_WRITE

#define NEED_WRITE   0x02

Definition at line 32 of file fopencookie.c.

Function Documentation

◆ _close()

static int _close ( void *  c)
static

Wrap fopencookie close function and free our fr_funopen_cookie_t.

Definition at line 89 of file fopencookie.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _read()

static int _read ( void *  c,
char *  buf,
int  n 
)
static

Wrap fopencookie read function.

Definition at line 47 of file fopencookie.c.

+ Here is the caller graph for this function:

◆ _seek()

static fpos_t _seek ( void *  c,
fpos_t  offset,
int  whence 
)
static

Wrap fopencookie seek function.

Definition at line 67 of file fopencookie.c.

+ Here is the caller graph for this function:

◆ _write()

static int _write ( void *  c,
const char *  buf,
int  n 
)
static

Wrap fopencookie write function.

Definition at line 57 of file fopencookie.c.

+ Here is the caller graph for this function:

◆ fopencookie()

FILE* fopencookie ( void *  cookie,
const char *  mode,
cookie_io_functions_t  io_funcs 
)

Definition at line 99 of file fopencookie.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: