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: mark_base.cc /main/7 1996/07/18 14:47:29 drk $
26 * Copyright (c) 1992 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.
52 #include "oliasdb/mark_base.h"
53 #include "oliasdb/mark.h"
54 #include "utility/debug.h"
55 #include "misc/unique_id.h"
57 mark_base::mark_base(user_base::rw_flag_t rw) :
58 user_base(MARK_SPEC, rw)
63 mark_base::mark_base( const char* base_dir,
66 user_base::rw_flag_t rw
68 user_base(base_dir, base_nm, base_ds, MARK_SPEC, rw)
70 if ( checking_status != SUCC )
73 desc* ptr = first_desc_ptr;
76 throw(stringException("empty mark specification"));
79 if ( strcmp( ptr -> get_type(), "container set") == 0 ) {
80 mark_set_hd = (cset_handler*)
81 (f_obj_dict -> get_handler(ptr -> get_nm()));
84 ptr = ptr -> get_next_desc();
87 throw(stringException("can't find mark set description record"));
90 mark_base::~mark_base()
94 oid_list_handler* mark_base::get_mark_list(const char* node_locator)
96 #ifdef INTERCEPT_MARK_BASE_CALLS
97 MESSAGE(cerr, "mark_base::get_mark_list()");
98 debug(cerr, node_locator);
101 pstring* x = new pstring(node_locator, strlen(node_locator));
104 oid_list_handler*z = (*mark_set_hd) -> get_locs(y, 1);
106 #ifdef INTERCEPT_MARK_BASE_CALLS
108 debug(cerr, (*z) -> asciiOut(cerr));
114 mmdb_pos_t mark_base::first()
116 page_storage *s = (page_storage*)((*mark_set_hd) -> get_store());
118 mmdb_pos_t ind = s -> first_loc();
120 if ( managers::template_mgr -> peek_slot(s, ind) != USER_MARK_CODE ) {
127 oid_t mark_base::get_mark_oid(mmdb_pos_t& ind)
129 page_storage *s = (page_storage*)((*mark_set_hd) -> get_store());
132 managers::template_mgr -> init_obj(s, ind, r);
135 throw(stringException("null root object pointer"));
137 oid_t x = r -> my_oid();
143 void mark_base::next(mmdb_pos_t& ind)
145 page_storage *s = (page_storage*)((*mark_set_hd) -> get_store());
147 while ( s -> seek_loc( ind, positive, spointer_t::IS_OBJECT ) == true ) {
148 if ( managers::template_mgr -> peek_slot(s, ind) == USER_MARK_CODE ) {