23 while(isdigit(**
msg))++*
msg;
35 const char *preserve = *
msg;
44 goto advance_until_end;
71 const char *
msg,
const char** path_end)
120 arg_match &= (*
pattern++==*arg_str++);
123 if(arg_match && !*arg_str)
133 const char *
msg,
const char** path_end)
138 else if(*arg_pattern ==
':')
160QUOTE FROM OSC 1.0 SPEC
162'?' in the OSC Address Pattern matches any single character
163'*' in the OSC Address Pattern matches any sequence of
zero or more characters
164A string of characters
in square brackets (
e.g.,
"[string]")
in the OSC Address Pattern matches any character
in the
string.
165Inside square brackets, the minus sign (-) and exclamation point (!) have special meanings:
166 two characters separated by
a minus sign indicate the range of characters between the given two
167in ASCII collating sequence. (
A minus sign at the end of the
string has no special meaning.)
168 An exclamation point at the beginning of
a bracketed
string negates the sense of the list,
169 meaning that the list matches any character not
in the list.
170(An exclamation point anywhere besides the first character after the open bracket
has no special meaning.)
171 A comma-separated list of strings enclosed
in curly braces (
e.
g.,
"{foo,bar}")
in the OSC Address Pattern
172 matches any of the strings
in the list.
191#define RTOSC_MATCH_ALL 1
192#define RTOSC_MATCH_CHAR 2
193#define RTOSC_MATCH_PARTIAL_CHAR 3
194#define RTOSC_MATCH_SUBSTRING 4
195#define RTOSC_MATCH_OPTIONS 5
196#define RTOSC_MATCH_PARTIAL_OPTIONS 6
197#define RTOSC_MATCH_ENUMERATED 7
200 return c<=0x7f &&
c !=
' ' &&
c !=
'#' &&
201 c !=
'/' &&
c !=
'{' &&
c !=
'}';
206 int charwise_only = 1;
207 const char *last_star = strrchr(
pattern,
'*');
208 const char *pound = strchr(
pattern,
'#');
214 if(charwise_only && !last_star)
226 if(**path == **
pattern && **path) {
230 }
else if(**
pattern ==
'?' && *path) {
235 bool matched =
false;
236 bool negation =
false;
237 char last_range =
'\0';
238 char to_match = **path;
251 if(range_high ==
']' || !range_high)
253 if(to_match <= range_high && to_match >= last_range)
261 return negation ^ matched;
274 char patternbuf[256];
284 else if(*
a && *
b==
'*' &&
b[1] ==
'\0')
288 }
else if(
type == 4) {
290 const char *sub=
NULL;
291 return strstr(
a,sub);
296 if(*
a && *
b==
'#' &&
b[1] !=
'\0')
297 return atoi(
a) < atoi(
b+1);
325 assert(
false &&
"This API is a WIP");
326 char subpattern[256];
327 char submessage[256];
342 if(*
p == 0 && *
m == 0)
uint8_t a
Definition Spc_Cpu.h:141
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
* e
Definition inflate.c:1404
unsigned * m
Definition inflate.c:1559
int g
Definition inflate.c:1573
bool rtosc_match_partial(const char *a, const char *b)
Definition dispatch.c:266
#define RTOSC_MATCH_ENUMERATED
Definition dispatch.c:197
int rtosc_subpath_pat_type(const char *pattern)
Definition dispatch.c:204
static bool rtosc_match_char(const char **path, const char **pattern)
Definition dispatch.c:223
#define RTOSC_MATCH_OPTIONS
Definition dispatch.c:195
bool rtosc_match_full_path(const char *pattern, const char *message)
Definition dispatch.c:323
const char * rtosc_match_options(const char *pattern, const char **msg)
Definition dispatch.c:33
static bool rtosc_match_number(const char **pattern, const char **msg)
Definition dispatch.c:11
void advance_path(const char **a)
Definition dispatch.c:318
#define RTOSC_MATCH_PARTIAL_CHAR
Definition dispatch.c:193
bool rtosc_match(const char *pattern, const char *msg, const char **path_end)
Definition dispatch.c:132
static bool rtosc_match_args(const char *pattern, const char *msg)
Definition dispatch.c:110
const char * rtosc_match_path(const char *pattern, const char *msg, const char **path_end)
Definition dispatch.c:70
#define RTOSC_MATCH_CHAR
Definition dispatch.c:192
int chunk_path(const char *a, int b, const char *c)
Definition dispatch.c:311
int rtosc_matchable_path(const char *pattern)
Definition dispatch.c:304
static bool is_charwise(uint8_t c)
Definition dispatch.c:198
#define RTOSC_MATCH_ALL
Definition dispatch.c:191
int val
Definition jpeglib.h:956
#define A(x)
Definition lice_arc.cpp:13
float in
Definition lilv_test.c:1460
unsigned char uint8_t
Definition mid.cpp:98
const char * msg
Definition missing_descriptor.c:20
void zero(float &v)
Set a float to zero.
Definition primitives.h:41
constexpr NumericType square(NumericType n) noexcept
Definition juce_MathsFunctions.h:580
#define max(x, y)
Definition os.h:78
bool has(T &t, Z &z)
Definition ports.cpp:334
const char * rtosc_argument_string(const char *msg)
Definition rtosc.c:11
uch * p
Definition crypt.c:594
return c
Definition crypt.c:175
int * pattern
Definition match.c:126
#define void
Definition unzip.h:396