Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_query.c File Reference
#include "nilorea/n_log.h"
#include "nilorea/n_query.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for ex_query.c:

Go to the source code of this file.

Data Structures

struct  REC

Functions

static void expect (const char *label, int got, int want)
static void expect_parse_error (const char *expr)
int main (void)
static const char * rec_get (const char *field, void *ud)
static int run (const char *expr, const REC *r)

Variables

static int failures = 0

Data Structure Documentation

◆ REC

struct REC
Examples
ex_query.c.

Definition at line 36 of file ex_query.c.

Collaboration diagram for REC:
Data Fields
const char * host
const char * method
const char * mime
const char * path
const char * status

Function Documentation

◆ expect()

void expect ( const char * label,
int got,
int want )
static

Definition at line 73 of file ex_query.c.

References failures, LOG_ERR, and n_log.

◆ expect_parse_error()

void expect_parse_error ( const char * expr)
static
Examples
ex_query.c.

Definition at line 80 of file ex_query.c.

References failures, LOG_ERR, n_log, n_query_compile(), and n_query_free().

Referenced by main().

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

◆ main()

int main ( void )

Definition at line 90 of file ex_query.c.

References expect(), expect_parse_error(), failures, REC::host, LOG_ERR, LOG_INFO, LOG_NOTICE, REC::method, REC::mime, n_log, n_query_compile_ex(), n_query_free(), REC::path, run, set_log_level(), and REC::status.

Here is the call graph for this function:

◆ rec_get()

const char * rec_get ( const char * field,
void * ud )
static
Examples
ex_query.c.

Definition at line 44 of file ex_query.c.

References REC::host, REC::method, REC::mime, REC::path, and REC::status.

Referenced by run().

Here is the caller graph for this function:

◆ run()

int run ( const char * expr,
const REC * r )
static

Definition at line 60 of file ex_query.c.

References LOG_ERR, n_log, n_query_compile(), n_query_eval(), n_query_free(), and rec_get().

Here is the call graph for this function:

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 33 of file ex_query.c.