diff options
author | N.N. <krzyszcz@users.sourceforge.net> | 2005-11-21 22:16:37 +0000 |
---|---|---|
committer | N.N. <krzyszcz@users.sourceforge.net> | 2005-11-21 22:16:37 +0000 |
commit | c2014a0a771e621cec552c6ee88daddcb46d13fe (patch) | |
tree | 183540090b25920599d86cddfa03e37cefe45dec /shared/common/messtree.h | |
parent | a1ef2f36df1754e1146a8ed50c9ac6a1b0f33697 (diff) |
cyclone alpha55 (see notes.txt for cyclone and shared)
svn path=/trunk/externals/miXed/; revision=4011
Diffstat (limited to 'shared/common/messtree.h')
-rw-r--r-- | shared/common/messtree.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/shared/common/messtree.h b/shared/common/messtree.h new file mode 100644 index 0000000..a3a3326 --- /dev/null +++ b/shared/common/messtree.h @@ -0,0 +1,47 @@ +/* Copyright (c) 2005 krzYszcz and others. + * For information on usage and redistribution, and for a DISCLAIMER OF ALL + * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ + +#ifndef __MESSTREE_H__ +#define __MESSTREE_H__ + +typedef int (*t_messcall)(t_pd *, t_symbol *, int, t_atom *); +typedef char *t_messarg; + +typedef struct _messslot +{ + char *ms_name; + t_messcall ms_call; + char *ms_argument; + int ms_flags; + struct _messnode *ms_subnode; +} t_messslot; + +typedef struct _messnode /* a parser's symbol definition, sort of... */ +{ + t_messslot *mn_table; + int mn_nslots; + int mn_index; +} t_messnode; + +EXTERN_STRUCT _messtree; +#define t_messtree struct _messtree + +#define MESSTREE_NSLOTS(slots) (sizeof(slots)/sizeof(*(slots))) + +enum { MESSTREE_OK, /* done current message parsing, parse next */ + MESSTREE_CONTINUE, /* continue current message parsing */ + MESSTREE_UNKNOWN, /* current message unknown, parse next */ + MESSTREE_CORRUPT, /* current message corrupt, parse next */ + MESSTREE_FATAL /* exit parsing */ +}; + +#define MESSTREE_NONEXCLUSIVE 1 + +t_messtree *messtree_new(t_symbol *selector); +void messtree_add(t_messtree *mt, t_messnode *rootnode); +t_messtree *messtree_build(t_messslot *rootslot); +int messtree_doit(t_messtree *mt, t_messslot **msp, int *nargp, + t_pd *target, t_symbol *s, int ac, t_atom *av); + +#endif |