dhcpd-pools  3.0
ISC dhcpd lease usage analyser
Macros | Functions
mustach.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "mustach.h"
Include dependency graph for mustach.c:

Macros

#define _GNU_SOURCE
 
#define NAME_LENGTH_MAX   1024
 
#define DEPTH_MAX   256
 

Functions

static int getpartial (struct mustach_itf *itf, void *closure, const char *name, char **result)
 
static int process (const char *template, struct mustach_itf *itf, void *closure, FILE *file, const char *opstr, const char *clstr)
 
int fmustach (const char *template, struct mustach_itf *itf, void *closure, FILE *file)
 
int fdmustach (const char *template, struct mustach_itf *itf, void *closure, int fd)
 fmustach - Renders the mustache 'template' in 'fd' for 'itf' and 'closure'. More...
 
int mustach (const char *template, struct mustach_itf *itf, void *closure, char **result, size_t *size)
 fmustach - Renders the mustache 'template' in 'result' for 'itf' and 'closure'. More...
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ DEPTH_MAX

#define DEPTH_MAX   256

Referenced by process().

◆ NAME_LENGTH_MAX

#define NAME_LENGTH_MAX   1024

Referenced by process().

Function Documentation

◆ fdmustach()

int fdmustach ( const char *  template,
struct mustach_itf itf,
void *  closure,
int  fd 
)

fmustach - Renders the mustache 'template' in 'fd' for 'itf' and 'closure'.

: the template string to instanciate : the interface to the functions that mustach calls : the closure to pass to functions called : the file descriptor number where to write the result

Returns 0 in case of success, -1 with errno set in case of system error a other negative value in case of error.

Here is the call graph for this function:

◆ fmustach()

int fmustach ( const char *  template,
struct mustach_itf itf,
void *  closure,
FILE *  file 
)

Referenced by fdmustach(), mustach(), and mustach_dhcpd_pools().

Here is the call graph for this function:

◆ getpartial()

static int getpartial ( struct mustach_itf itf,
void *  closure,
const char *  name,
char **  result 
)
static

Referenced by process().

◆ mustach()

int mustach ( const char *  template,
struct mustach_itf itf,
void *  closure,
char **  result,
size_t *  size 
)

fmustach - Renders the mustache 'template' in 'result' for 'itf' and 'closure'.

: the template string to instanciate : the interface to the functions that mustach calls : the closure to pass to functions called

Returns
: the pointer receiving the result when 0 is returned : the size of the returned result

Returns 0 in case of success, -1 with errno set in case of system error a other negative value in case of error.

Here is the call graph for this function:

◆ process()

static int process ( const char *  template,
struct mustach_itf itf,
void *  closure,
FILE *  file,
const char *  opstr,
const char *  clstr 
)
static

Referenced by fmustach().

Here is the call graph for this function: