LMMS
Loading...
Searching...
No Matches
serd_internal.h File Reference
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "serd/serd.h"
#include "serd_config.h"

Go to the source code of this file.

Classes

struct  SerdStack
struct  SerdBulkSinkImpl

Macros

#define _POSIX_C_SOURCE   200809L /* for posix_memalign and posix_fadvise */
#define SERD_PAGE_SIZE   4096
#define MIN(a, b)
#define SERD_STACK_BOTTOM   sizeof(void*)

Typedefs

typedef struct SerdBulkSinkImpl SerdBulkSink

Functions

static FILE * serd_fopen (const char *path, const char *mode)
static voidserd_bufalloc (size_t size)
static SerdStack serd_stack_new (size_t size)
static bool serd_stack_is_empty (SerdStack *stack)
static void serd_stack_free (SerdStack *stack)
static uint8_tserd_stack_push (SerdStack *stack, size_t n_bytes)
static void serd_stack_pop (SerdStack *stack, size_t n_bytes)
static voidserd_stack_push_aligned (SerdStack *stack, size_t n_bytes, size_t align)
static void serd_stack_pop_aligned (SerdStack *stack, size_t n_bytes)
static SerdBulkSink serd_bulk_sink_new (SerdSink sink, void *stream, size_t block_size)
static void serd_bulk_sink_flush (SerdBulkSink *bsink)
static void serd_bulk_sink_free (SerdBulkSink *bsink)
static size_t serd_bulk_sink_write (const void *buf, size_t len, SerdBulkSink *bsink)
static bool in_range (const uint8_t c, const uint8_t min, const uint8_t max)
static bool is_alpha (const uint8_t c)
static bool is_digit (const uint8_t c)
static bool is_space (const char c)
static bool is_base64 (const uint8_t c)
static bool is_windows_path (const uint8_t *path)
static bool chunk_equals (const SerdChunk *a, const SerdChunk *b)
static size_t uri_path_len (const SerdURI *uri)
static uint8_t uri_path_at (const SerdURI *uri, size_t i)
static bool uri_is_under (const SerdURI *uri, const SerdURI *root)
static void serd_error (SerdErrorSink error_sink, void *handle, const SerdError *e)

Macro Definition Documentation

◆ _POSIX_C_SOURCE

#define _POSIX_C_SOURCE   200809L /* for posix_memalign and posix_fadvise */

◆ MIN

#define MIN ( a,
b )
Value:
(((a) < (b)) ? (a) : (b))
uint8_t a
Definition Spc_Cpu.h:141
b
Definition crypt.c:628

◆ SERD_PAGE_SIZE

#define SERD_PAGE_SIZE   4096

◆ SERD_STACK_BOTTOM

#define SERD_STACK_BOTTOM   sizeof(void*)

An offset to start the stack at. Note 0 is reserved for NULL.

Typedef Documentation

◆ SerdBulkSink

Function Documentation

◆ chunk_equals()

bool chunk_equals ( const SerdChunk * a,
const SerdChunk * b )
inlinestatic

◆ in_range()

bool in_range ( const uint8_t c,
const uint8_t min,
const uint8_t max )
inlinestatic

Return true if c lies within [min...max] (inclusive)

◆ is_alpha()

bool is_alpha ( const uint8_t c)
inlinestatic

RFC2234: ALPHA := x41-5A / x61-7A ; A-Z / a-z

◆ is_base64()

bool is_base64 ( const uint8_t c)
inlinestatic

◆ is_digit()

bool is_digit ( const uint8_t c)
inlinestatic

RFC2234: DIGIT ::= x30-39 ; 0-9

◆ is_space()

bool is_space ( const char c)
inlinestatic

◆ is_windows_path()

bool is_windows_path ( const uint8_t * path)
inlinestatic

◆ serd_bufalloc()

void * serd_bufalloc ( size_t size)
inlinestatic

◆ serd_bulk_sink_flush()

void serd_bulk_sink_flush ( SerdBulkSink * bsink)
inlinestatic

◆ serd_bulk_sink_free()

void serd_bulk_sink_free ( SerdBulkSink * bsink)
inlinestatic

◆ serd_bulk_sink_new()

SerdBulkSink serd_bulk_sink_new ( SerdSink sink,
void * stream,
size_t block_size )
inlinestatic

◆ serd_bulk_sink_write()

size_t serd_bulk_sink_write ( const void * buf,
size_t len,
SerdBulkSink * bsink )
inlinestatic

◆ serd_error()

void serd_error ( SerdErrorSink error_sink,
void * handle,
const SerdError * e )
inlinestatic

◆ serd_fopen()

FILE * serd_fopen ( const char * path,
const char * mode )
inlinestatic

◆ serd_stack_free()

void serd_stack_free ( SerdStack * stack)
inlinestatic

◆ serd_stack_is_empty()

bool serd_stack_is_empty ( SerdStack * stack)
inlinestatic

◆ serd_stack_new()

SerdStack serd_stack_new ( size_t size)
inlinestatic

◆ serd_stack_pop()

void serd_stack_pop ( SerdStack * stack,
size_t n_bytes )
inlinestatic

◆ serd_stack_pop_aligned()

void serd_stack_pop_aligned ( SerdStack * stack,
size_t n_bytes )
inlinestatic

◆ serd_stack_push()

uint8_t * serd_stack_push ( SerdStack * stack,
size_t n_bytes )
inlinestatic

◆ serd_stack_push_aligned()

void * serd_stack_push_aligned ( SerdStack * stack,
size_t n_bytes,
size_t align )
inlinestatic

◆ uri_is_under()

bool uri_is_under ( const SerdURI * uri,
const SerdURI * root )
inlinestatic

Return true iff uri is within the base of root

◆ uri_path_at()

uint8_t uri_path_at ( const SerdURI * uri,
size_t i )
inlinestatic

◆ uri_path_len()

size_t uri_path_len ( const SerdURI * uri)
inlinestatic