2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: cmsmatch.c /main/4 1995/11/09 12:42:30 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company
26 * (c) Copyright 1993, 1994 International Business Machines Corp.
27 * (c) Copyright 1993, 1994 Novell, Inc.
28 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
31 #include <EUSCompat.h>
40 /******************************************************************************
41 * forward declaration of static functions used within the file
42 ******************************************************************************/
44 static boolean_t _MatchOneAttribute(cms_attribute eattr, cms_attribute mattr,
47 /*****************************************************************************
49 *****************************************************************************/
52 _DtCmsMatchAttributes(
60 for (i = 0; i < num_attrs; i++) {
61 if (attrs[i].name.num > entry->num_attrs)
64 if (_MatchOneAttribute(entry->attrs[attrs[i].name.num],
65 attrs[i], (ops ? ops[i] : CSA_MATCH_EQUAL_TO)) == B_FALSE)
71 /*****************************************************************************
72 * static functions used within the file
73 *****************************************************************************/
76 _MatchOneAttribute(cms_attribute eattr, cms_attribute mattr, int op)
78 if (eattr.value == NULL) {
79 if (op == CSA_MATCH_EQUAL_TO && mattr.value == NULL)
85 switch (eattr.value->type) {
86 case CSA_VALUE_ENUMERATED:
87 case CSA_VALUE_SINT32:
88 return (_DtCm_match_sint32_attribute(eattr.value, mattr.value,
91 case CSA_VALUE_BOOLEAN:
93 case CSA_VALUE_UINT32:
94 return (_DtCm_match_uint32_attribute(eattr.value, mattr.value,
97 case CSA_VALUE_STRING:
98 case CSA_VALUE_CALENDAR_USER:
99 case CSA_VALUE_DATE_TIME_RANGE:
100 return (_DtCm_match_string_attribute(eattr.value, mattr.value,
103 case CSA_VALUE_DATE_TIME:
104 return (_DtCm_match_time_attribute(eattr.value, mattr.value,
107 case CSA_VALUE_TIME_DURATION:
108 return (_DtCm_match_time_duration_attribute(eattr.value,
111 case CSA_VALUE_REMINDER:
112 return (_DtCm_match_reminder_attribute(eattr.value, mattr.value,