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

# Content
1 /*
2 * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game.
3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
5 * Copyright (©) 1992,2007 Frank Tore Johansen
6 *
7 * 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 */
23
24 #include <global.h>
25
26 /*
27 * Allocates a new objectlink structure, initialises it, and returns
28 * a pointer to it.
29 */
30
31 objectlink *
32 get_objectlink (void)
33 {
34 objectlink *ol = new objectlink;
35
36 ol->ob = 0;
37 ol->next = 0;
38 return ol;
39 }
40
41 /*
42 * Allocates a new oblinkpt structure, initialises it, and returns
43 * a pointer to it.
44 */
45
46 oblinkpt *
47 get_objectlinkpt (void)
48 {
49 oblinkpt *obp = new oblinkpt;
50
51 obp->link = 0;
52 obp->next = 0;
53 obp->value = 0;
54 return obp;
55 }
56
57 /*
58 * Recursively frees all objectlinks
59 */
60
61 void
62 free_objectlink (objectlink * ol)
63 {
64 if (ol->next)
65 free_objectlink (ol->next);
66
67 delete ol;
68 }
69
70 /*
71 * Recursively frees all linked list of objectlink pointers
72 */
73
74 void
75 free_objectlinkpt (oblinkpt *obp)
76 {
77 if (obp->next)
78 free_objectlinkpt (obp->next);
79
80 if (obp->link)
81 free_objectlink (obp->link);
82
83 delete obp;
84 }