dhcpd-pools  3.0
ISC dhcpd lease usage analyser
Data Structures | Functions | Variables
mustach-dhcpd-pools.c File Reference

Mustache templating specific functions. More...

#include <config.h>
#include <fcntl.h>
#include <errno.h>
#include <error.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include "close-stream.h"
#include "dhcpd-pools.h"
#include "mustach.h"
#include "xalloc.h"
Include dependency graph for mustach-dhcpd-pools.c:

Data Structures

struct  expl
 A structure that travels through mustach via closure void pointer. More...
 

Functions

static int must_enter (void *closure, const char *name)
 Function that is called when mustach is searching output loops from template file. More...
 
static int must_leave (void *closure)
 Function that is called when all elements within a print loop are outputed. More...
 
static int must_put_base (void *closure, const char *name, int escape __attribute__((unused)), FILE *file)
 Template base level tag parser and printer. More...
 
static int must_put_range (void *closure, const char *name, int escape __attribute__((unused)), FILE *file)
 Mustach range aka {{#subnets}} tag parser and printer. More...
 
static int must_put_shnet (void *closure, const char *name, int escape __attribute__((unused)), FILE *file)
 Mustach shared networks aka {{#shared-networks}} tag parser and printer. More...
 
static int must_next_range (void *closure)
 A function to move to next range when {{/subnets}} is encountered. More...
 
static int must_next_shnet (void *closure)
 A function to move to next shared network when {{/shared-networks}} is encountered. More...
 
static char * must_read_template (const char *filename)
 Read mustach template to memory. More...
 
int mustach_dhcpd_pools (struct conf_t *state)
 Start mustach processing. More...
 

Variables

static struct mustach_itf itf
 

Detailed Description

Mustache templating specific functions.

Function Documentation

◆ must_enter()

static int must_enter ( void *  closure,
const char *  name 
)
static

Function that is called when mustach is searching output loops from template file.

Here is the call graph for this function:

◆ must_leave()

static int must_leave ( void *  closure)
static

Function that is called when all elements within a print loop are outputed.

Here is the call graph for this function:

◆ must_next_range()

static int must_next_range ( void *  closure)
static

A function to move to next range when {{/subnets}} is encountered.

Referenced by must_enter().

Here is the call graph for this function:

◆ must_next_shnet()

static int must_next_shnet ( void *  closure)
static

A function to move to next shared network when {{/shared-networks}} is encountered.

Referenced by must_enter().

Here is the call graph for this function:

◆ must_put_base()

static int must_put_base ( void *  closure,
const char *  name,
int escape   __attribute__(unused),
FILE *  file 
)
static

Template base level tag parser and printer.

Referenced by must_leave().

Here is the call graph for this function:

◆ must_put_range()

static int must_put_range ( void *  closure,
const char *  name,
int escape   __attribute__(unused),
FILE *  file 
)
static

Mustach range aka {{#subnets}} tag parser and printer.

Referenced by must_enter().

Here is the call graph for this function:

◆ must_put_shnet()

static int must_put_shnet ( void *  closure,
const char *  name,
int escape   __attribute__(unused),
FILE *  file 
)
static

Mustach shared networks aka {{#shared-networks}} tag parser and printer.

Referenced by must_enter().

Here is the call graph for this function:

◆ must_read_template()

static char* must_read_template ( const char *  filename)
static

Read mustach template to memory.

Referenced by mustach_dhcpd_pools().

Here is the call graph for this function:

◆ mustach_dhcpd_pools()

int mustach_dhcpd_pools ( struct conf_t state)

Start mustach processing.

Referenced by output_analysis().

Here is the call graph for this function:

Variable Documentation

◆ itf

struct mustach_itf itf
static
Initial value:
= {
.start = NULL,
.enter = must_enter,
.put = must_put_base,
.next = NULL,
.leave = must_leave
}
static int must_put_base(void *closure, const char *name, int escape __attribute__((unused)), FILE *file)
Template base level tag parser and printer.
Definition: mustach-dhcpd-pools.c:71
#define NULL
Definition: stddef.in.h:72
static int must_leave(void *closure)
Function that is called when all elements within a print loop are outputed.
Definition: mustach-dhcpd-pools.c:366
static int must_enter(void *closure, const char *name)
Function that is called when mustach is searching output loops from template file.
Definition: mustach-dhcpd-pools.c:333