Crossfire Server, Branches 1.12
R18729
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
links.c
Go to the documentation of this file.
1
/*
2
* static char *rcsid_friend_c =
3
* "$Id: links.c 11578 2009-02-23 22:02:27Z lalo $";
4
*/
5
6
/*
7
CrossFire, A Multiplayer game for X-windows
8
9
Copyright (C) 1992 Frank Tore Johansen
10
11
This program is free software; you can redistribute it and/or modify
12
it under the terms of the GNU General Public License as published by
13
the Free Software Foundation; either version 2 of the License, or
14
(at your option) any later version.
15
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU General Public License for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with this program; if not, write to the Free Software
23
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
25
The author can be reached via e-mail to frankj@ifi.uio.no.
26
*/
27
33
#include <
global.h
>
34
45
objectlink
*
get_objectlink
(
void
) {
46
objectlink
*ol = (
objectlink
*)
CALLOC
(1,
sizeof
(
objectlink
));
47
if
(!ol)
48
fatal
(
OUT_OF_MEMORY
);
49
ol->
ob
= NULL;
50
ol->
next
= NULL;
51
ol->
id
= 0;
52
return
ol;
53
}
54
65
oblinkpt
*
get_objectlinkpt
(
void
) {
66
oblinkpt
*obp = (
oblinkpt
*)malloc(
sizeof
(
oblinkpt
));
67
68
if
(!obp)
69
fatal
(
OUT_OF_MEMORY
);
70
obp->
link
= NULL;
71
obp->
next
= NULL;
72
obp->
value
= 0;
73
return
obp;
74
}
75
83
void
free_objectlink
(
objectlink
*ol) {
84
if
(ol->
next
)
85
free_objectlink
(ol->
next
);
86
free(ol);
87
}
88
95
void
free_objectlinkpt
(
oblinkpt
*obp) {
96
if
(obp->
next
)
97
free_objectlinkpt
(obp->
next
);
98
if
(obp->
link
)
99
free_objectlink
(obp->
link
);
100
free(obp);
101
}
OUT_OF_MEMORY
#define OUT_OF_MEMORY
Definition:
define.h:94
oblnk
Definition:
object.h:298
CALLOC
#define CALLOC(x, y)
Definition:
global.h:295
free_objectlink
void free_objectlink(objectlink *ol)
Definition:
links.c:83
get_objectlink
objectlink * get_objectlink(void)
Definition:
links.c:45
global.h
oblinkpt::value
long value
Definition:
object.h:309
oblnk::id
tag_t id
Definition:
object.h:301
free_objectlinkpt
void free_objectlinkpt(oblinkpt *obp)
Definition:
links.c:95
oblinkpt
Definition:
object.h:307
oblinkpt::link
struct oblnk * link
Definition:
object.h:308
oblnk::ob
object * ob
Definition:
object.h:299
oblinkpt::next
struct oblinkpt * next
Definition:
object.h:310
fatal
void fatal(int err)
Definition:
glue.c:60
oblnk::next
struct oblnk * next
Definition:
object.h:300
get_objectlinkpt
oblinkpt * get_objectlinkpt(void)
Definition:
links.c:65
crossfire-code
server
branches
1.12
common
links.c
Generated on Sun Nov 18 2018 02:40:28 for Crossfire Server, Branches 1.12 by
1.8.6