Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / object / dl_list_cell.C
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /*
24  * $XConsortium: dl_list_cell.cc /main/4 1996/06/11 17:24:22 cde-hal $
25  *
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
30  * OR DISCLOSURE.
31  * 
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
36  * INTERNATIONAL, LTD.
37  * 
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.
43  *
44  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
45  *                  1315 Dell Avenue
46  *                  Campbell, CA  95008
47  * 
48  */
49
50
51 #include "object/dl_list_cell.h"
52
53 dl_list_cell::dl_list_cell(c_code_t c_id) : composite(c_id)
54 {
55       v_forward_ptr.become(ground);
56       v_backward_ptr.become(ground);
57 }
58
59 dl_list_cell::dl_list_cell(const dl_list_cell& x) : 
60 composite(x), 
61 v_backward_ptr(x.v_backward_ptr), 
62 v_forward_ptr(x.v_forward_ptr)
63 {
64 }
65
66 dl_list_cell::~dl_list_cell()
67 {
68 }
69
70 void dl_list_cell::set_backward_ptr(const oid_t& x)
71 {
72    v_backward_ptr.become(x);
73    set_mode(UPDATE, true);
74 }
75
76 void dl_list_cell::set_forward_ptr(const oid_t& x)
77 {
78    v_forward_ptr.become(x);
79    set_mode(UPDATE, true);
80 }
81
82 oid_t& dl_list_cell::get_backward_ptr()
83 {
84    return v_backward_ptr;
85 }
86
87 oid_t& dl_list_cell::get_forward_ptr()
88 {
89    return v_forward_ptr;
90 }
91
92
93 /*
94 boolean dl_list_cell::value_LS(root& x, boolean safe) const
95 {
96    if ( safe == true &&
97         ( f_oid.ccode() != DL_LIST_CELL_CODE ||
98           x.my_oid().ccode() != DL_LIST_CELL_CODE 
99         ) 
100       )
101       return false;
102
103    dl_list_cell &y = *(dl_list_cell*)&x;
104    if ( v_backward_ptr.ls(y.v_backward_ptr) == true ||
105         ( v_backward_ptr.eq(y.v_backward_ptr) == true &&
106           v_forward_ptr.ls(y.v_forward_ptr) == true 
107         )
108       )
109       return true;
110    else
111       return false;
112 }
113
114 boolean dl_list_cell::value_EQ(root& x, boolean safe) const
115 {
116    if ( safe == true &&
117         ( f_oid.ccode() != DL_LIST_CELL_CODE || 
118           x.my_oid().ccode() != DL_LIST_CELL_CODE 
119         ) 
120       ) 
121       return false;
122
123    dl_list_cell &y = *(dl_list_cell*)&x;
124    if ( v_backward_ptr.eq(y.v_backward_ptr) == true )
125       return true;
126    else
127       return false;
128 }
129 */
130
131 io_status dl_list_cell::asciiOut(ostream& out) 
132 {
133    out << "OID_T:\n";
134    my_oid().asciiOut(out);
135    out << "\n";
136
137    v_backward_ptr.asciiOut(out);
138    out << "\n";
139    v_forward_ptr.asciiOut(out);
140    return done;
141 }
142
143 io_status dl_list_cell::asciiIn(istream& in) 
144 {
145    v_backward_ptr.asciiIn(in);
146    v_forward_ptr.asciiIn(in);
147    set_mode(UPDATE, true);
148    return done;
149 }
150
151
152 int dl_list_cell::cdr_sizeof()
153 {
154    return composite::cdr_sizeof() + v_backward_ptr.cdr_sizeof() + 
155           v_forward_ptr.cdr_sizeof();
156 }
157
158 io_status dl_list_cell::cdrOut(buffer& buf)
159 {
160    composite::cdrOut(buf);
161    v_backward_ptr.cdrOut(buf);
162    v_forward_ptr.cdrOut(buf);
163    return done;
164 }
165
166 io_status dl_list_cell::cdrIn(buffer& buf)
167 {
168    composite::cdrIn(buf);
169    v_backward_ptr.cdrIn(buf);
170    v_forward_ptr.cdrIn(buf);
171    return done;
172 }
173
174 MMDB_BODIES(dl_list_cell)
175 HANDLER_BODIES(dl_list_cell)
176