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 libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
26 * $TOG: MsgHndArray.hh /main/9 1998/09/02 15:54:58 mgreess $
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.
43 #ifndef _MSGHNDARRAY_HH
44 #define _MSGHNDARRAY_HH
48 #if defined(USL) && (OSMAJORVERSION == 2)
51 #if defined(USL) && (OSMAJORVERSION == 2)
54 #include <DtMail/DtMail.hh>
58 MsgStruct() : indexNumber(0), sessionNumber(0), message_handle(NULL), is_deleted(false) {};
63 DtMailMessageHandle message_handle;
70 MsgStruct **_contents;
74 MsgHndArray(int sz = 1024, int zeroed = 1)
76 _contents = (MsgStruct**) malloc(sizeof(MsgStruct*)*sz);
78 if (zeroed) memset(_contents, 0, sizeof(MsgStruct *)*sz);
86 // for (int ent = 0; ent < _length; ent++) {
87 // delete _contents[ent];
90 free((void*) _contents);
94 MsgStruct* at(int a_number);
95 int insert(MsgStruct* a_msg_struct);
97 int indexof(MsgStruct* a_msg_struct);
98 int indexof(DtMailMessageHandle a_msg_handle);
99 void remove_entry(int position);
100 void remove_entry(MsgStruct *ms);
101 void append(MsgStruct *a_msg_struct);
102 void mark_for_delete(int position);
103 void compact(int start_pos);
104 void replace(int postition, MsgStruct *a_msg_struct);