LMMS
Loading...
Searching...
No Matches
dispatch.c File Reference
#include <rtosc/rtosc.h>
#include <ctype.h>
#include <assert.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define RTOSC_MATCH_ALL   1
#define RTOSC_MATCH_CHAR   2
#define RTOSC_MATCH_PARTIAL_CHAR   3
#define RTOSC_MATCH_SUBSTRING   4
#define RTOSC_MATCH_OPTIONS   5
#define RTOSC_MATCH_PARTIAL_OPTIONS   6
#define RTOSC_MATCH_ENUMERATED   7

Functions

static bool rtosc_match_number (const char **pattern, const char **msg)
const char * rtosc_match_options (const char *pattern, const char **msg)
const char * rtosc_match_path (const char *pattern, const char *msg, const char **path_end)
static bool rtosc_match_args (const char *pattern, const char *msg)
bool rtosc_match (const char *pattern, const char *msg, const char **path_end)
static bool is_charwise (uint8_t c)
int rtosc_subpath_pat_type (const char *pattern)
static bool rtosc_match_char (const char **path, const char **pattern)
bool rtosc_match_partial (const char *a, const char *b)
int rtosc_matchable_path (const char *pattern)
int chunk_path (const char *a, int b, const char *c)
void advance_path (const char **a)
bool rtosc_match_full_path (const char *pattern, const char *message)

Macro Definition Documentation

◆ RTOSC_MATCH_ALL

#define RTOSC_MATCH_ALL   1

◆ RTOSC_MATCH_CHAR

#define RTOSC_MATCH_CHAR   2

◆ RTOSC_MATCH_ENUMERATED

#define RTOSC_MATCH_ENUMERATED   7

◆ RTOSC_MATCH_OPTIONS

#define RTOSC_MATCH_OPTIONS   5

◆ RTOSC_MATCH_PARTIAL_CHAR

#define RTOSC_MATCH_PARTIAL_CHAR   3

◆ RTOSC_MATCH_PARTIAL_OPTIONS

#define RTOSC_MATCH_PARTIAL_OPTIONS   6

◆ RTOSC_MATCH_SUBSTRING

#define RTOSC_MATCH_SUBSTRING   4

Function Documentation

◆ advance_path()

void advance_path ( const char ** a)

◆ chunk_path()

int chunk_path ( const char * a,
int b,
const char * c )

◆ is_charwise()

bool is_charwise ( uint8_t c)
static

◆ rtosc_match()

bool rtosc_match ( const char * pattern,
const char * msg,
const char ** path_end )

This is a non-compliant pattern matcher for dispatching OSC messages

Overall the pattern specification is (normal-path)(#digit-specifier)?(/)?(:argument-restrictor)*

Parameters
patternThe pattern string stored in the Port
msgThe OSC message to be matched
path_endif non-NULL, will point to where parsing stopped in the path (in case of a match, *path_end is always '/' or '\0')
Returns
true if a normal match and false if unmatched

◆ rtosc_match_args()

bool rtosc_match_args ( const char * pattern,
const char * msg )
static

◆ rtosc_match_char()

bool rtosc_match_char ( const char ** path,
const char ** pattern )
static

◆ rtosc_match_full_path()

bool rtosc_match_full_path ( const char * pattern,
const char * message )

◆ rtosc_match_number()

bool rtosc_match_number ( const char ** pattern,
const char ** msg )
static

◆ rtosc_match_options()

const char * rtosc_match_options ( const char * pattern,
const char ** msg )

◆ rtosc_match_partial()

bool rtosc_match_partial ( const char * a,
const char * b )

◆ rtosc_match_path()

const char * rtosc_match_path ( const char * pattern,
const char * msg,
const char ** path_end )

Attempt to match a rtosc style path while ignoring arguments

Parameters
patternrtosc pattern
msga normal C string or a rtosc message
path_endif non-NULL, will point to where parsing stopped in the path (in case of a match, *path_end is always '/' or '\0')

◆ rtosc_matchable_path()

int rtosc_matchable_path ( const char * pattern)

◆ rtosc_subpath_pat_type()

int rtosc_subpath_pat_type ( const char * pattern)