Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / tt / demo / CoEd / libCoEd / CoEdChangeQueue.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 //%%  (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: CoEdChangeQueue.C /main/3 1995/10/20 17:06:28 rswiston $                                                    
28 /*
29  * CoEdChangeQueue.cc
30  *
31  * Copyright (c) 1991 by Sun Microsystems.  All Rights Reserved.
32  *
33  * Permission to use, copy, modify, distribute, and sell this software
34  * and its documentation for any purpose is hereby granted without
35  * fee, provided that the above copyright notice appear in all copies
36  * and that both that copyright notice and this permission notice
37  * appear in supporting documentation, and that the names of Sun
38  * Microsystems and its subsidiaries not be used in advertising or
39  * publicity pertaining to distribution of the software without
40  * specific, written prior permission.  Sun Microsystems and its
41  * subsidiaries make no representations about the suitability of this
42  * software for any purpose.  It is provided "as is" without express
43  * or implied warranty.
44  *
45  * Sun Microsystems and its subsidiaries disclaim all warranties with
46  * regard to this software, including all implied warranties of
47  * merchantability and fitness.  In no event shall Sun Microsystems or
48  * its subsidiaries be liable for any special, indirect or
49  * consequential damages or any damages whatsoever resulting from loss
50  * of use, data or profits, whether in an action of contract,
51  * negligence or other tortious action, arising out of or in
52  * connection with the use or performance of this software.
53  */
54
55 #include <string.h>
56 #include "CoEdChangeQueue.h"
57
58 CoEdChangeQueue::
59 CoEdChangeQueue() : CoEdTextChangeList()
60 {
61 }
62
63 void CoEdChangeQueue::
64 insert( CoEdTextChange *change )
65 {
66         append( change );
67 }
68
69 CoEdTextChange *CoEdChangeQueue::
70 deQEligibleChng( const CoEdTextVersion &version )
71 {
72         CoEdTextChange *curr = _head;
73         while (curr != 0) {
74                 if (! curr->knowsOfNewerChangesThan( version )) {
75                         return remove( curr );
76                 }
77                 curr = curr->_next;
78         }
79         return 0;
80 }