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
26 * $XConsortium: Node.C /main/4 1996/04/21 19:42:41 drk $
28 * RESTRICTED CONFIDENTIAL INFORMATION:
30 * The information in this document is subject to special
31 * restrictions in a confidential disclosure agreement between
32 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
33 * document outside HP, IBM, Sun, USL, SCO, or Univel without
34 * Sun's specific written approval. This document and all copies
35 * and derivative works thereof must be returned or destroyed at
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
47 // In the design, we had abstracted out the DOMF related activities
48 // (insertion in lookup table, creation of the objref corresponding to
49 // servant...) into <>Impl classes.
50 // The <>Servant classes derive from the <>Impl classes.
51 // Note how, in the constructor of the NodeServant class, we call the
52 // constructor of the parent NodeImpl class passing in "this".
53 // The NodeImpl constructor uses "this" to insert into the lookup table...
59 my_message_handle = NULL;
60 my_message_header = NULL;
63 deleted_p = DTM_FALSE;
64 my_previous_node = NULL;
69 DtMailMessageHandle msg_num,
73 my_message_handle = msg_num;
74 my_message_header = hdr;
77 deleted_p = DTM_FALSE;
78 my_previous_node = NULL;
98 // Starting with the current node "this", traverse nodes until
99 // home node is reached.
106 unsigned char is_home_p;
111 is_home_p = a_node->is_home();
125 Node::set_message_handle(
126 DtMailMessageHandle a_hndl
129 my_message_handle = a_hndl;
134 Node::get_message_handle()
136 return(my_message_handle);
140 Node::set_message_header(
144 my_message_header = hdr;
148 Node::get_message_header()
150 return(my_message_header);
158 return(my_next_node);
162 // Don't attempt duplicating a nil objref!
169 return(my_previous_node);
173 // Don't attempt duplicating a nil objref!
176 Node::set_previous_node(
180 my_previous_node = a_node;
184 // Don't attempt duplicating a nil objref!
191 my_next_node = a_node;
194 // append anyNode to self
206 if (anyNode == NULL) {
207 printf("Cannot append NIL node!");
217 tmpNext = my_next_node;
218 my_next_node = inNode;
219 inNode->set_previous_node(tmpSelf);
220 inNode->set_next_node(my_next_node);
221 tmpNext->set_previous_node(inNode);
225 my_next_node = inNode;
226 my_previous_node = inNode;
227 inNode->set_previous_node(tmpSelf);
228 inNode->set_next_node(tmpSelf);
232 // prepend anyNode to self
244 if (anyNode == NULL) {
245 printf("Cannot prepend NIL node!");
252 if (my_previous_node)
254 tmpPrev = my_previous_node;
255 my_previous_node = inNode;
256 inNode->set_next_node(tmpSelf);
257 inNode->set_previous_node(tmpPrev);
258 tmpPrev->set_next_node(inNode);
262 my_next_node = inNode;
263 my_previous_node = inNode;
264 inNode->set_previous_node(tmpSelf);
265 inNode->set_next_node(tmpSelf);
270 // Good etiquette requires that clients remove() a node
271 // before destroy()-ing it.
278 my_previous_node->set_next_node(my_next_node);
280 my_next_node->set_previous_node(my_previous_node);
286 Node::set_number(int i)
295 return(bogus_number);