]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/ORTEPattern.c
225c7d691c081f949403ee1ddf3f674b98d82001
[orte.git] / orte / liborte / ORTEPattern.c
1 /*
2  *  $Id: ORTEPattern.c,v 0.0.0.1        2003/07/12 
3  *
4  *  DEBUG:  section 28                  Pattern
5  *  AUTHOR: Petr Smolik                 petr.smolik@wo.cz
6  *
7  *  ORTE - OCERA Real-Time Ethernet     http://www.ocera.org/
8  *  --------------------------------------------------------------------
9  *
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.
14  *  
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.
19  *  
20  */ 
21
22 #include "orte.h"
23
24 /**********************************************************************************/
25 Boolean
26 ORTEPatternCheckDefault(const char *topic) {
27   if (strchr(topic, '*')!=NULL) 
28     return ORTE_TRUE;
29   return ORTE_FALSE;
30 }
31
32 /**********************************************************************************/
33 Boolean
34 ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param) {
35   fnmatch(pattern,topic,0);
36   return ORTE_FALSE;
37 }
38
39 /**********************************************************************************/
40 void
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);
48 }