2 * Copyright (c) 1999, 2008 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Mach Operating System
25 * Copyright (c) 1991,1990 Carnegie Mellon University
26 * All Rights Reserved.
28 * Permission to use, copy, modify and distribute this software and its
29 * documentation is hereby granted, provided that both the copyright
30 * notice and this permission notice appear in all copies of the
31 * software, derivative works or modified versions, and any portions
32 * thereof, and that both notices appear in supporting documentation.
34 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
35 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
36 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
38 * Carnegie Mellon requests users of this software to return to
40 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
41 * School of Computer Science
42 * Carnegie Mellon University
43 * Pittsburgh PA 15213-3890
45 * any improvements or extensions that they make and grant Carnegie the
46 * rights to redistribute these changes.
52 #include "mig_machine.h"
54 boolean_t PrintVersion
= FALSE
;
55 boolean_t BeQuiet
= FALSE
;
56 boolean_t BeVerbose
= FALSE
;
57 boolean_t UseMsgRPC
= TRUE
;
58 boolean_t GenSymTab
= FALSE
;
59 boolean_t UseEventLogger
= FALSE
;
60 boolean_t BeLint
= FALSE
;
61 boolean_t BeAnsiC
= TRUE
;
62 boolean_t CheckNDR
= FALSE
;
63 boolean_t PackMsg
= PACK_MESSAGES
;
64 boolean_t UseSplitHeaders
= FALSE
;
65 boolean_t ShortCircuit
= FALSE
;
66 boolean_t UseRPCTrap
= FALSE
;
67 boolean_t TestRPCTrap
= FALSE
;
68 boolean_t IsVoucherCodeAllowed
= TRUE
;
70 boolean_t IsKernelUser
= FALSE
;
71 boolean_t IsKernelServer
= FALSE
;
72 boolean_t UseSpecialReplyPort
= FALSE
;
73 boolean_t HasUseSpecialReplyPort
= FALSE
;
74 boolean_t HasConsumeOnSendError
= FALSE
;
75 u_int ConsumeOnSendError
= 0;
77 string_t RCSId
= strNULL
;
79 string_t SubsystemName
= strNULL
;
80 u_int SubsystemBase
= 0;
82 string_t MsgOption
= strNULL
;
83 string_t WaitTime
= strNULL
;
84 string_t SendTime
= strNULL
;
85 string_t ErrorProc
= "MsgError";
86 string_t ServerPrefix
= "";
87 string_t UserPrefix
= "";
88 string_t ServerDemux
= strNULL
;
89 string_t ServerImpl
= strNULL
;
90 string_t ServerSubsys
= strNULL
;
91 int MaxMessSizeOnStack
= -1; /* by default, always on stack */
92 int UserTypeLimit
= -1; /* by default, assume unlimited size. */
96 char NewCDecl
[] = "(defined(__STDC__) || defined(c_plusplus))";
97 char LintLib
[] = "defined(LINTLIBRARY)";
102 yyinname
= strmake("<no name yet>");
105 string_t UserFilePrefix
= strNULL
;
106 string_t UserHeaderFileName
= strNULL
;
107 string_t ServerHeaderFileName
= strNULL
;
108 string_t InternalHeaderFileName
= strNULL
;
109 string_t DefinesHeaderFileName
= strNULL
;
110 string_t UserFileName
= strNULL
;
111 string_t ServerFileName
= strNULL
;
112 string_t GenerationDate
= strNULL
;
117 if (SubsystemName
== strNULL
)
118 fatal("no SubSystem declaration");
120 if (UserHeaderFileName
== strNULL
)
121 UserHeaderFileName
= strconcat(SubsystemName
, ".h");
122 else if (streql(UserHeaderFileName
, "/dev/null"))
123 UserHeaderFileName
= strNULL
;
125 if (UserFileName
== strNULL
)
126 UserFileName
= strconcat(SubsystemName
, "User.c");
127 else if (streql(UserFileName
, "/dev/null"))
128 UserFileName
= strNULL
;
130 if (ServerFileName
== strNULL
)
131 ServerFileName
= strconcat(SubsystemName
, "Server.c");
132 else if (streql(ServerFileName
, "/dev/null"))
133 ServerFileName
= strNULL
;
135 if (ServerDemux
== strNULL
)
136 ServerDemux
= strconcat(SubsystemName
, "_server");
138 if (ServerImpl
== strNULL
)
139 ServerImpl
= strconcat(SubsystemName
, "_impl");
141 if (ServerSubsys
== strNULL
) {
142 if (ServerPrefix
!= strNULL
)
143 ServerSubsys
= strconcat(ServerPrefix
, SubsystemName
);
145 ServerSubsys
= SubsystemName
;
146 ServerSubsys
= strconcat(ServerSubsys
, "_subsystem");
148 if (HasUseSpecialReplyPort
&& !BeAnsiC
) {
149 fatal("Cannot use UseSpecialReplyPort in non ANSI mode\n");