]> git.cameronkatri.com Git - apple_cmds.git/blob - bootstrap_cmds/migcom.tproj/global.c
network_cmds: use libiosexec
[apple_cmds.git] / bootstrap_cmds / migcom.tproj / global.c
1 /*
2 * Copyright (c) 1999, 2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * Mach Operating System
25 * Copyright (c) 1991,1990 Carnegie Mellon University
26 * All Rights Reserved.
27 *
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.
33 *
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.
37 *
38 * Carnegie Mellon requests users of this software to return to
39 *
40 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
41 * School of Computer Science
42 * Carnegie Mellon University
43 * Pittsburgh PA 15213-3890
44 *
45 * any improvements or extensions that they make and grant Carnegie the
46 * rights to redistribute these changes.
47 */
48
49 #include "strdefs.h"
50 #include "global.h"
51 #include "error.h"
52 #include "mig_machine.h"
53
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;
69
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;
76
77 string_t RCSId = strNULL;
78
79 string_t SubsystemName = strNULL;
80 u_int SubsystemBase = 0;
81
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. */
93
94 string_t yyinname;
95
96 char NewCDecl[] = "(defined(__STDC__) || defined(c_plusplus))";
97 char LintLib[] = "defined(LINTLIBRARY)";
98
99 void
100 init_global()
101 {
102 yyinname = strmake("<no name yet>");
103 }
104
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;
113
114 void
115 more_global()
116 {
117 if (SubsystemName == strNULL)
118 fatal("no SubSystem declaration");
119
120 if (UserHeaderFileName == strNULL)
121 UserHeaderFileName = strconcat(SubsystemName, ".h");
122 else if (streql(UserHeaderFileName, "/dev/null"))
123 UserHeaderFileName = strNULL;
124
125 if (UserFileName == strNULL)
126 UserFileName = strconcat(SubsystemName, "User.c");
127 else if (streql(UserFileName, "/dev/null"))
128 UserFileName = strNULL;
129
130 if (ServerFileName == strNULL)
131 ServerFileName = strconcat(SubsystemName, "Server.c");
132 else if (streql(ServerFileName, "/dev/null"))
133 ServerFileName = strNULL;
134
135 if (ServerDemux == strNULL)
136 ServerDemux = strconcat(SubsystemName, "_server");
137
138 if (ServerImpl == strNULL)
139 ServerImpl = strconcat(SubsystemName, "_impl");
140
141 if (ServerSubsys == strNULL) {
142 if (ServerPrefix != strNULL)
143 ServerSubsys = strconcat(ServerPrefix, SubsystemName);
144 else
145 ServerSubsys = SubsystemName;
146 ServerSubsys = strconcat(ServerSubsys, "_subsystem");
147 }
148 if (HasUseSpecialReplyPort && !BeAnsiC) {
149 fatal("Cannot use UseSpecialReplyPort in non ANSI mode\n");
150 }
151 }