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
24 * $XConsortium: misc.cc /main/4 1996/07/18 14:39:26 drk $
26 * Copyright (c) 1993 HAL Computer Systems International, Ltd.
27 * All rights reserved. Unpublished -- rights reserved under
28 * the Copyright Laws of the United States. USE OF A COPYRIGHT
29 * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
32 * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
33 * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
34 * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
35 * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
38 * RESTRICTED RIGHTS LEGEND
39 * Use, duplication, or disclosure by the Government is subject
40 * to the restrictions as set forth in subparagraph (c)(l)(ii)
41 * of the Rights in Technical Data and Computer Software clause
42 * at DFARS 252.227-7013.
44 * HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
51 #include "mgrs/misc.h"
53 Boolean name_oid_ls(const void* o1, const void* o2)
55 name_oid_t *x = (name_oid_t*)o1;
56 name_oid_t *y = (name_oid_t*)o2;
59 MESSAGE(cerr, "in name_oid_ls");
60 debug(cerr, x -> v_name);
61 debug(cerr, y -> v_name);
65 return ( x -> v_name.string_LS(y -> v_name) );
68 Boolean name_oid_eq(const void* o1, const void* o2)
70 name_oid_t *x = (name_oid_t*)o1;
71 name_oid_t *y = (name_oid_t*)o2;
74 MESSAGE(cerr, "in name_oid_eq");
75 debug(cerr, x -> v_name);
76 debug(cerr, y -> v_name);
78 return ( x -> v_name.string_EQ(y -> v_name) );
81 Boolean oid_ls(const void* o1, const void* o2)
83 const oid_t& x = ((handler*)o1) -> its_oid();
84 const oid_t& y = ((handler*)o2) -> its_oid();
87 MESSAGE(cerr, "<<<<<<<<<<<<");
88 x.asciiOut(cerr); cerr << "\n";
89 y.asciiOut(cerr); cerr << "\n";
90 MESSAGE(cerr, "<<<<<<<<<<<<");
96 Boolean oid_eq(const void* o1, const void* o2)
98 const oid_t& x = ((handler*)o1) -> its_oid();
99 const oid_t& y = ((handler*)o2) -> its_oid();
102 MESSAGE(cerr, "==========");
103 x.asciiOut(cerr); cerr << "\n";
104 y.asciiOut(cerr); cerr << "\n";
105 MESSAGE(cerr, "==========");
111 Boolean oid_storage_ls(const void* o1, const void* o2)
113 name_oid_t* x = (name_oid_t*)o1;
114 name_oid_t* y = (name_oid_t*)o2;
116 if ( x->v_oid.ls(y->v_oid) == true )
120 if ( x->v_oid.eq(y->v_oid) == true )
121 if ( long(x->v_store) < long(y->v_store) )
127 Boolean oid_storage_eq(const void* o1, const void* o2)
129 name_oid_t* x = (name_oid_t*)o1;
130 name_oid_t* y = (name_oid_t*)o2;
132 return (x->v_oid.eq(y->v_oid) == true && x->v_store && y->v_store ) ?
136 void delete_name_oid_rec_f(const void* name_oid_ptr)
138 name_oid_t* x = (name_oid_t*)name_oid_ptr;
139 //debug(cerr, x -> v_name.get());
143 // ***************************************************
146 // ***************************************************
148 mark_t::mark_t(char* marks) : ostring(strlen(marks))
153 istream& operator >>(istream& in, mark_t& m)
157 Boolean read_marks = false;
159 while ( in && in.get(c) ) {
161 if ( strchr(ptr, c) == NULL ) {
163 if ( read_marks == false ) {
165 throw(formatException("bad mark to read"));
176 ostream& operator <<(ostream& out, mark_t& m)