]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/RTPSUtils.c
89ca08520bb311f287a806db5863b3b3485c3c94
[orte.git] / orte / liborte / RTPSUtils.c
1 /*
2  *  $Id: RTPSUtils.c,v 0.0.0.1          2003/09/13 
3  *
4  *  DEBUG:  section 50          Utils
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 int gavl_cmp_ntp_time(const NtpTime *a,const NtpTime *b) {
36   return NtpTimeCmp(*a,*b);
37 }
38
39 /**********************************************************************************/
40 int gavl_cmp_sn(const SequenceNumber *a, const SequenceNumber *b) {
41   return SeqNumberCmp(*a,*b);
42 }
43
44 /**********************************************************************************/
45 int 
46 gavl_cmp_guid(const GUID_RTPS *a, const GUID_RTPS *b) {
47   //HID
48   if (a->hid>b->hid) return 1;
49   if (a->hid<b->hid) return -1;
50   //AID
51   if (a->aid>b->aid) return 1;
52   if (a->aid<b->aid) return -1;
53   //OID
54   if (a->oid>b->oid) return 1;
55   if (a->oid<b->oid) return -1;
56   return 0;
57 }
58
59 /**********************************************************************************/
60 int 
61 gavl_cmp_str(const char *const *a,const char *const *b) {
62   return strcmp((const char *)*a, (const char*)*b);
63 }
64