Crossfire Server, Branches 1.12  R18729
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 
46  objectlink *ol = (objectlink *)CALLOC(1, sizeof(objectlink));
47  if (!ol)
49  ol->ob = NULL;
50  ol->next = NULL;
51  ol->id = 0;
52  return ol;
53 }
54 
66  oblinkpt *obp = (oblinkpt *)malloc(sizeof(oblinkpt));
67 
68  if (!obp)
70  obp->link = NULL;
71  obp->next = NULL;
72  obp->value = 0;
73  return obp;
74 }
75 
84  if (ol->next)
85  free_objectlink(ol->next);
86  free(ol);
87 }
88 
96  if (obp->next)
97  free_objectlinkpt(obp->next);
98  if (obp->link)
99  free_objectlink(obp->link);
100  free(obp);
101 }
#define OUT_OF_MEMORY
Definition: define.h:94
Definition: object.h:298
#define CALLOC(x, y)
Definition: global.h:295
long value
Definition: object.h:309
tag_t id
Definition: object.h:301
struct oblnk * link
Definition: object.h:308
object * ob
Definition: object.h:299
struct oblinkpt * next
Definition: object.h:310
void fatal(int err)
Definition: glue.c:60
struct oblnk * next
Definition: object.h:300