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
23 //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
24 //%% (c) Copyright 1993, 1994 International Business Machines Corp.
25 //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
26 //%% (c) Copyright 1993, 1994 Novell, Inc.
27 //%% $XConsortium: tttk2free.C /main/3 1995/10/23 10:33:09 rswiston $
29 * @(#)tttk2free.C 1.3 93/09/07
31 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
33 #include "tttk/tttk2free.h"
35 _TttkItem2Free::_TttkItem2Free()
40 _TttkItem2Free::_TttkItem2Free(
47 _TttkItem2Free::_TttkItem2Free(
54 _TttkItem2Free::_TttkItem2Free(
61 _TttkItem2Free::~_TttkItem2Free()
66 tttk_message_destroy( _msg );
71 tt_pattern_destroy( _pat );
85 _TttkItem2Free::operator =(
95 _TttkItem2Free::operator =(
105 _TttkItem2Free::operator =(
114 _TttkList2Free::_TttkList2Free(
115 unsigned int maxElems
121 _items = new _TttkItem2Free[ maxElems ];
126 _items = (_TttkItem2Free **)malloc( maxElems * sizeof(_TttkItem2Free *));
130 for (int i = 0; i < _max; i++) {
131 _items[ i ] = new _TttkItem2Free();
132 if (_items[ i ] == 0) {
141 _TttkList2Free::~_TttkList2Free()
147 _TttkList2Free::operator +=(
155 _item( _max - _num - 1 ) = msg;
161 _TttkList2Free::operator +=(
169 _item( _max - _num - 1 ) = pat;
175 _TttkList2Free::operator +=(
183 _item( _max - _num - 1 ) = ptr;
189 _TttkList2Free::flush()
191 for (int i = 0; i < _num; i++) {
192 _item( i ) = (caddr_t)0;
197 _TttkList2Free::_destruct()
203 for (int i = 0; i < _max; i++) {
204 if (_items[ i ] != 0) {
216 _TttkList2Free::_item(