]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/ORTEPattern.c
updated email address - petr@smoliku.cz
[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  *
6  *  -------------------------------------------------------------------  
7  *                                ORTE                                 
8  *                      Open Real-Time Ethernet                       
9  *                                                                    
10  *                      Copyright (C) 2001-2006                       
11  *  Department of Control Engineering FEE CTU Prague, Czech Republic  
12  *                      http://dce.felk.cvut.cz                       
13  *                      http://www.ocera.org                          
14  *                                                                    
15  *  Author:              Petr Smolik    petr@smoliku.cz             
16  *  Advisor:             Pavel Pisa                                   
17  *  Project Responsible: Zdenek Hanzalek                              
18  *  --------------------------------------------------------------------
19  *
20  *  This program is free software; you can redistribute it and/or modify
21  *  it under the terms of the GNU General Public License as published by
22  *  the Free Software Foundation; either version 2 of the License, or
23  *  (at your option) any later version.
24  *  
25  *  This program is distributed in the hope that it will be useful,
26  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28  *  GNU General Public License for more details.
29  *  
30  */ 
31
32 #include "orte_all.h"
33
34 /**********************************************************************************/
35 Boolean
36 ORTEPatternCheckDefault(const char *topic) {
37   if (strchr(topic, '*')!=NULL) 
38     return ORTE_TRUE;
39   return ORTE_FALSE;
40 }
41
42 /**********************************************************************************/
43 Boolean
44 ORTEPatternMatchDefault(const char *topic,const char *pattern,void *param) {
45   fnmatch((const char *)pattern, (const char*)topic,0);
46   return ORTE_FALSE;
47 }
48
49 /**********************************************************************************/
50 void
51 ORTEPatternRegister(ORTEDomain *d,ORTEPatternCheck check,
52      ORTEPatternMatch match,void *param) {
53   pthread_rwlock_wrlock(&d->patternEntry.lock);
54   d->patternEntry.check=check;
55   d->patternEntry.match=match;
56   d->patternEntry.param=param;
57   pthread_rwlock_unlock(&d->patternEntry.lock);
58 }