Barrelfish
Macros | Functions
codegen.h File Reference

Code synthesizer for bfdmux filters. More...

Macros

#define MAX_FILTER_CODE_SIZE   256
 Maximum number of bytes for a compiled filter. More...
 
#define INITIAL_ALLOC_SIZE   64
 
#define INCREMENTAL_ALLOC_SIZE   64
 

Functions

void compile_filter (char *expression, uint8_t **filter_code, int32_t *filter_len)
 Compiles a filter expression in Bfdmux Filter Language into Bfdmux Intermediate Code. More...
 

Detailed Description

Code synthesizer for bfdmux filters.

This file provides the interface for the filter code generator.

Macro Definition Documentation

#define INCREMENTAL_ALLOC_SIZE   64

Size of realloc'ed blocks if filter code doesn't fit

#define INITIAL_ALLOC_SIZE   64

Size of initially allocated filter code block

#define MAX_FILTER_CODE_SIZE   256

Maximum number of bytes for a compiled filter.

This is used to limit bfdmux's workload in some way.

Function Documentation

void compile_filter ( char *  expression,
uint8_t **  filter_code,
int32_t *  filter_len 
)

Compiles a filter expression in Bfdmux Filter Language into Bfdmux Intermediate Code.

Parameters
expressionthe expression to compile
[out]filter_codePoints to the memory buffer that contains the compiled filter, or NULL, if an error occurred
[out]filter_lenIndicates the length of the compiled code, or contains the error position in the filter string on failure