Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_wrap.c File Reference
#include "nilorea/n_log.h"
#include "nilorea/n_wrap.h"
Include dependency graph for ex_wrap.c:

Go to the source code of this file.

Data Structures

struct  collector
struct  rects

Macros

#define CHECK(cond, msg)
#define MAX_LINES   16

Functions

static void collect (size_t first, size_t last, size_t line, double width, void *user)
static int eq (double a, double b)
int main (void)
static void rect_collect (size_t line, double x0, double x1, void *user)
static size_t run (const n_wrap_item *items, size_t count, double max_width, collector *c)

Variables

static int failures = 0

Data Structure Documentation

◆ collector

struct collector
Examples
ex_wrap.c.

Definition at line 44 of file ex_wrap.c.

Collaboration diagram for collector:
Data Fields
size_t first[16]
size_t last[16]
size_t n
double width[16]

◆ rects

struct rects
Examples
ex_wrap.c.

Definition at line 66 of file ex_wrap.c.

Collaboration diagram for rects:
Data Fields
size_t line[16]
size_t n
double x0[16]
double x1[16]

Macro Definition Documentation

◆ CHECK

#define CHECK ( cond,
msg )
Value:
do { \
if (!(cond)) { \
n_log(LOG_ERR, "FAIL: %s", (msg)); \
failures++; \
} \
} while (0)
static int failures
Definition ex_atlas.c:51
#define LOG_ERR
error conditions
Definition n_log.h:100

Definition at line 34 of file ex_wrap.c.

◆ MAX_LINES

#define MAX_LINES   16
Examples
ex_wrap.c.

Definition at line 43 of file ex_wrap.c.

Referenced by collect(), and rect_collect().

Function Documentation

◆ collect()

void collect ( size_t first,
size_t last,
size_t line,
double width,
void * user )
static

Definition at line 50 of file ex_wrap.c.

References failures, collector::first, collector::last, last, line(), LOG_ERR, MAX_LINES, collector::n, n_log, and collector::width.

Here is the call graph for this function:

◆ eq()

int eq ( double a,
double b )
static
Examples
ex_wrap.c.

Definition at line 93 of file ex_wrap.c.

Referenced by _n_html_skip_rawtext(), _n_parse_query_params(), main(), and n_cookiejar_add_from_header().

Here is the caller graph for this function:

◆ main()

◆ rect_collect()

void rect_collect ( size_t line,
double x0,
double x1,
void * user )
static
Examples
ex_wrap.c.

Definition at line 72 of file ex_wrap.c.

References line(), rects::line, MAX_LINES, rects::n, rects::x0, and rects::x1.

Referenced by main().

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

◆ run()

size_t run ( const n_wrap_item * items,
size_t count,
double max_width,
collector * c )
static

Definition at line 84 of file ex_wrap.c.

References CHECK, collect(), collector::n, and n_wrap_layout().

Here is the call graph for this function:

Variable Documentation

◆ failures

int failures = 0
static

Definition at line 32 of file ex_wrap.c.