ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/links.C
Revision: 1.8
Committed: Mon May 28 21:21:40 2007 UTC (16 years, 11 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.7: +19 -19 lines
Log Message:
update copyrights in common/*.C and util/*.C

File Contents

# User Rev Content
1 elmex 1.1 /*
2 root 1.8 * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game.
3 pippijn 1.6 *
4 root 1.8 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
5     * Copyright (©) 1992,2007 Frank Tore Johansen
6 pippijn 1.6 *
7 root 1.8 * Crossfire TRT is free software; you can redistribute it and/or modify it
8     * under the terms of the GNU General Public License as published by the Free
9     * Software Foundation; either version 2 of the License, or (at your option)
10     * any later version.
11     *
12     * This program is distributed in the hope that it will be useful, but
13     * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14     * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15     * for more details.
16     *
17     * You should have received a copy of the GNU General Public License along
18     * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51
19     * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20     *
21     * The authors can be reached via e-mail to <crossfire@schmorp.de>
22 pippijn 1.6 */
23 root 1.8
24 elmex 1.1 #include <global.h>
25    
26     /*
27     * Allocates a new objectlink structure, initialises it, and returns
28     * a pointer to it.
29     */
30    
31 root 1.2 objectlink *
32     get_objectlink (void)
33     {
34 root 1.4 objectlink *ol = new objectlink;
35 root 1.2
36 root 1.4 ol->ob = 0;
37     ol->next = 0;
38 elmex 1.1 return ol;
39     }
40    
41     /*
42     * Allocates a new oblinkpt structure, initialises it, and returns
43     * a pointer to it.
44     */
45    
46 root 1.2 oblinkpt *
47     get_objectlinkpt (void)
48     {
49 root 1.4 oblinkpt *obp = new oblinkpt;
50 root 1.2
51 root 1.4 obp->link = 0;
52     obp->next = 0;
53 elmex 1.1 obp->value = 0;
54     return obp;
55     }
56    
57     /*
58     * Recursively frees all objectlinks
59     */
60    
61 root 1.2 void
62     free_objectlink (objectlink * ol)
63     {
64 elmex 1.1 if (ol->next)
65 root 1.2 free_objectlink (ol->next);
66 root 1.4
67     delete ol;
68 elmex 1.1 }
69    
70     /*
71     * Recursively frees all linked list of objectlink pointers
72     */
73    
74 root 1.2 void
75 root 1.4 free_objectlinkpt (oblinkpt *obp)
76 root 1.2 {
77 elmex 1.1 if (obp->next)
78 root 1.2 free_objectlinkpt (obp->next);
79 root 1.4
80 elmex 1.1 if (obp->link)
81 root 1.2 free_objectlink (obp->link);
82 root 1.4
83     delete obp;
84 elmex 1.1 }