xref: /trueos/usr.bin/migcom/statement.c (revision a567dc5a34c609044a1c02b08e01dc67a19b121e)
1 /*
2  * Copyright 1991-1998 by Open Software Foundation, Inc.
3  *              All Rights Reserved
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both the copyright notice and this permission notice appear in
9  * supporting documentation.
10  *
11  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
12  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
13  * FOR A PARTICULAR PURPOSE.
14  *
15  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
16  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
18  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
19  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  */
21 /*
22  * cmk1.1
23  */
24 /*
25  * Mach Operating System
26  * Copyright (c) 1991,1990 Carnegie Mellon University
27  * All Rights Reserved.
28  *
29  * Permission to use, copy, modify and distribute this software and its
30  * documentation is hereby granted, provided that both the copyright
31  * notice and this permission notice appear in all copies of the
32  * software, derivative works or modified versions, and any portions
33  * thereof, and that both notices appear in supporting documentation.
34  *
35  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
36  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
37  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
38  *
39  * Carnegie Mellon requests users of this software to return to
40  *
41  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
42  *  School of Computer Science
43  *  Carnegie Mellon University
44  *  Pittsburgh PA 15213-3890
45  *
46  * any improvements or extensions that they make and grant Carnegie the
47  * rights to redistribute these changes.
48  */
49 /*
50  * 91/02/05  17:55:44  mrt
51  * 	Changed to new Mach copyright
52  * 	[91/02/01  17:55:45  mrt]
53  *
54  * 90/06/02  15:05:37  rpd
55  * 	Created for new IPC.
56  * 	[90/03/26  21:13:24  rpd]
57  *
58  * 07-Apr-89  Richard Draves (rpd) at Carnegie-Mellon University
59  *	Extensive revamping.  Added polymorphic arguments.
60  *	Allow multiple variable-sized inline arguments in messages.
61  *
62  * 27-May-87  Richard Draves (rpd) at Carnegie-Mellon University
63  *	Created.
64  */
65 
66 #include <stdio.h>
67 #include "error.h"
68 #include "alloc.h"
69 #include "statement.h"
70 
71 statement_t *defs_stats = stNULL;
72 static statement_t **last = &defs_stats;
73 
74 statement_t *
stAlloc(void)75 stAlloc(void)
76 {
77     register statement_t *new;
78 
79     new = (statement_t *) malloc(sizeof *new);
80     if (new == stNULL)
81 	fatal("stAlloc(): %s", strerror(errno));
82     *last = new;
83     last = &new->stNext;
84     new->stNext = stNULL;
85     return new;
86 }
87