2 * $Id: ORTEPattern.c,v 0.0.0.1 2003/07/12
4 * DEBUG: section 28 Pattern
5 * AUTHOR: Petr Smolik petr.smolik@wo.cz
7 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
8 * --------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
24 /**********************************************************************************/
26 ORTEPatternCheckDefault(const char *topic) {
27 if (strchr(topic, '*')!=NULL)
32 /**********************************************************************************/
34 ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param) {
35 fnmatch(pattern,topic,0);
39 /**********************************************************************************/
41 ORTEPatternRegister(ORTEDomain *d,ORTEPatternCheck check,
42 ORTEPatternMatch match,void *param) {
43 pthread_rwlock_wrlock(&d->patternEntry.lock);
44 d->patternEntry.check=check;
45 d->patternEntry.match=match;
46 d->patternEntry.param=param;
47 pthread_rwlock_unlock(&d->patternEntry.lock);