]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/genSCPreferences.c
configd-293.8.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / genSCPreferences.c
1 /*
2 * Copyright (c) 2000-2009 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 /*
25 * genSCPreferences.c
26 * - generates System Configuration header/cfile
27 * - invoke with "header" to generate the header
28 * - invoke with "cfile" to generate the cfile
29 */
30
31 /*
32 * Modification History
33 *
34 * 4 March 2004 Allan Nathanson (ajn@apple.com)
35 * - an alternate scheme to help facilitate access to the schema
36 * definitions for cross-compilation to earlier releases AND
37 * access to CFM applications.
38 *
39 * 16 July 2003 Allan Nathanson (ajn@apple.com)
40 * - changes to facilitate cross-compilation to earlier releases
41 *
42 * 5 May 2003 Allan Nathanson (ajn@apple.com)
43 * - switch back to "extern const CFStringRef ..."
44 *
45 * 1 June 2001 Allan Nathanson <ajn@apple.com>
46 * - public API conversion
47 *
48 * 27 Apr 2001 Allan Nathanson (ajn@apple.com)
49 * - switch from "extern const CFStringRef ..." to "#define ..."
50 *
51 * 3 Nov 2000 Dieter Siegmund (dieter@apple)
52 * - created
53 */
54 #include <stdio.h>
55 #include <stdlib.h>
56 #include <string.h>
57 #include <unistd.h>
58 #include <mach/boolean.h>
59
60 char copyright_string[] =
61 "/*\n"
62 " * Copyright (c) 2000-2009 Apple Inc. All rights reserved.\n"
63 " *\n"
64 " * @APPLE_LICENSE_HEADER_START@\n"
65 " * \n"
66 " * This file contains Original Code and/or Modifications of Original Code\n"
67 " * as defined in and that are subject to the Apple Public Source License\n"
68 " * Version 2.0 (the 'License'). You may not use this file except in\n"
69 " * compliance with the License. Please obtain a copy of the License at\n"
70 " * http://www.opensource.apple.com/apsl/ and read it before using this\n"
71 " * file.\n"
72 " * \n"
73 " * The Original Code and all software distributed under the License are\n"
74 " * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n"
75 " * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n"
76 " * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n"
77 " * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n"
78 " * Please see the License for the specific language governing rights and\n"
79 " * limitations under the License.\n"
80 " * \n"
81 " * @APPLE_LICENSE_HEADER_END@\n"
82 " */\n";
83
84
85 typedef enum {
86 DEFINE,
87 DEFINE_PRIVATE,
88 COMMENT,
89 GROUP,
90 SC_10_1,
91 SC_10_2,
92 SC_10_3,
93 SC_10_1_10_4, // deprecated in 10.4
94 SC_10_4,
95 SC_10_1_10_5, // deprecated in 10.5
96 SC_10_5,
97 SC_10_1_10_6, // deprecated in 10.6
98 SC_10_2_10_6, // deprecated in 10.6
99 SC_10_6_IPHONE_2_0,
100 SC_10_6_IPHONE_3_0,
101 COMMENT_PRIVATE,
102 GROUP_PRIVATE,
103 SC_10_5_PRIVATE,
104 SC_10_6_IPHONE_2_0_PRIVATE,
105 SC_10_6_IPHONE_3_0_PRIVATE,
106 SC_IPHONE_2_0_PRIVATE,
107 COMMENT_DEPRECATED,
108 GROUP_DEPRECATED,
109 END
110 } controlType;
111
112 #define SC_SCHEMA_DECLARATION "SC_SCHEMA_DECLARATION"
113 #define SC_SCHEMA_KV "SC_SCHEMA_KV"
114
115 #define KEY_PREFIX "kSC"
116
117 #define COMP "Comp"
118 #define DYNAMICSTORE "DynamicStore"
119 #define PREF "Pref"
120 #define PROP "Prop"
121 #define PATH "Path"
122 #define NETENT "EntNet"
123 #define NETPROP "PropNet"
124 #define NETVAL "ValNet"
125 #define SETUPENT "EntSetup"
126 #define SETUPPROP "PropSetup"
127 #define SYSTEMENT "EntSystem"
128 #define SYSTEMPROP "PropSystem"
129 #define RESV "Resv"
130 #define USERSENT "EntUsers"
131 #define USERSPROP "PropUsers"
132 #define VERSION "Version"
133 #define VIRTUALPROP "PropVirtualNetworkInterfaces"
134
135 #define CFARRAY_CFNUMBER "CFArray[CFNumber]"
136 #define CFARRAY_CFSTRING "CFArray[CFString]"
137 #define CFBOOLEAN "CFBoolean"
138 #define CFDATA "CFData"
139 #define CFDICTIONARY "CFDictionary"
140 #define CFNUMBER "CFNumber"
141 #define CFNUMBER_BOOL "CFNumber (0 or 1)"
142 #define CFSTRING "CFString"
143
144 #define ACCESSPOINTNAME "AccessPointName"
145 #define ACSP "ACSP" // Apple Client Server Protocol
146 #define ACTIVE "Active"
147 #define ADDRESSES "Addresses"
148 #define AFTER "After"
149 #define AGGRESSIVE "Aggressive"
150 #define AIRPORT "AirPort"
151 #define ALERT "Alert"
152 #define ALLOWNETCREATION "AllowNetCreation"
153 #define ALTERNATEREMOTEADDRESS "AlternateRemoteAddress"
154 #define ALWAYS "Always"
155 #define ANYREGEX "AnyRegex"
156 #define APPLETALK "AppleTalk"
157 #define AUTH "Auth"
158 #define AUTHENTICATIONMETHOD "AuthenticationMethod"
159 #define AUTOCONFIG "AutoConfig"
160 #define AUTODISCOVERY "AutoDiscovery"
161 #define AUTOMATIC "Automatic"
162 #define BEFORE "Before"
163 #define BINDINGMETHODS "BindingMethods"
164 #define BOND "Bond"
165 #define BOOTP "BOOTP"
166 #define BROADCAST "Broadcast"
167 #define CALLWAITINGAUDIBLEALERT "CallWaitingAudibleAlert"
168 #define CAUSE "Cause"
169 #define CCP "CCP"
170 #define CHAP "CHAP"
171 #define CERTIFICATE "Certificate"
172 #define COMM "Comm"
173 #define COMPATIBLE "Compatible"
174 #define COMPRESSIONACFIELD "CompressionACField"
175 #define COMPRESSIONPFIELD "CompressionPField"
176 #define COMPRESSIONVJ "CompressionVJ"
177 #define COMPUTERNAME "ComputerName"
178 #define CONFIGMETHOD "ConfigMethod"
179 #define CONNECTDELAY "ConnectDelay"
180 #define CONNECTION "Connection"
181 #define CONNECTSPEED "ConnectSpeed"
182 #define CONNECTTIME "ConnectTime"
183 #define CONSERVATIVE "Conservative"
184 #define CONSOLEUSER "ConsoleUser"
185 #define CONTEXTID "ContextID"
186 #define CURRENTSET "CurrentSet"
187 #define DATACOMPRESSION "DataCompression"
188 #define DEFAULT "Default"
189 #define DEFAULTZONE "DefaultZone"
190 #define DEST "Dest"
191 #define DETACHING "Detaching"
192 #define DEVICE "Device"
193 #define DEVICENAME "DeviceName"
194 #define DHCP "DHCP"
195 #define DHCPCLIENTID "DHCPClientID"
196 #define DIALMODE "DialMode"
197 #define DIALONDEMAND "DialOnDemand"
198 #define DISCONNECTONANSWER "DisconnectOnAnswer"
199 #define DISCONNECTONFASTUSERSWITCH "DisconnectOnFastUserSwitch"
200 #define DISCONNECTONIDLE "DisconnectOnIdle"
201 #define DISCONNECTONIDLETIMER "DisconnectOnIdleTimer"
202 #define DISCONNECTONLOGOUT "DisconnectOnLogout"
203 #define DISCONNECTONSLEEP "DisconnectOnSleep"
204 #define DISCONNECTTIME "DisconnectTime"
205 #define DISPLAYTERMINALWINDOW "DisplayTerminalWindow"
206 #define DNS "DNS"
207 #define DOMAIN "Domain"
208 #define DOMAINS "Domains"
209 #define EAP "EAP"
210 #define EAPOL "EAPOL"
211 #define ECHO "Echo"
212 #define ECHOFAILURE "EchoFailure"
213 #define ECHOINTERVAL "EchoInterval"
214 #define ENABLE "Enable"
215 #define ENABLED "Enabled"
216 #define ENCODING "Encoding"
217 #define ENCRYPTION "Encryption"
218 #define ERRORCORRECTION "ErrorCorrection"
219 #define ETHERNET "Ethernet"
220 #define EXCEPTIONSLIST "ExceptionsList"
221 #define EXCLUDESIMPLEHOSTNAMES "ExcludeSimpleHostnames"
222 #define FAILOVER "Failover"
223 #define FILE "File"
224 #define FIREWIRE "FireWire"
225 #define FIRST "First"
226 #define FLAGS "Flags"
227 #define FTP "FTP"
228 #define GID "GID"
229 #define GLOBAL "Global"
230 #define GOPHER "Gopher"
231 #define HARDWARE "Hardware"
232 #define HIGH "High"
233 #define HOLD "Hold"
234 #define HOSTNAME "HostName"
235 #define HOSTNAMES "HostNames"
236 #define HTTP "HTTP"
237 #define HTTPS "HTTPS"
238 #define HYBRID "Hybrid"
239 #define IDLEREMINDER "IdleReminder"
240 #define IDLEREMINDERTIMER "IdleReminderTimer"
241 #define IGNOREDIALTONE "IgnoreDialTone"
242 #define IGNORELINKSTATUS "IgnoreLinkStatus"
243 #define INACTIVE "Inactive"
244 #define INFORM "INFORM"
245 #define INTERFACE "Interface"
246 #define INTERFACENAME "InterfaceName"
247 #define INTERFACES "Interfaces"
248 #define IP "IP"
249 #define IPCP "IPCP"
250 #define IPV4 "IPv4"
251 #define IPV6 "IPv6"
252 #define IPSEC "IPSec"
253 #define JOIN "Join"
254 #define KEYCHAIN "Keychain"
255 #define KEYID "KeyID"
256 #define L2TP "L2TP"
257 #define LAST "Last"
258 #define LCP "LCP"
259 #define LINK "Link"
260 #define LINKLOCAL "LinkLocal"
261 #define LOCALCERTIFICATE "LocalCertificate"
262 #define LOCALHOSTNAME "LocalHostName"
263 #define LOCALIDENTIFIER "LocalIdentifier"
264 #define LOGFILE "Logfile"
265 #define LOW "Low"
266 #define MACADDRESS "MACAddress"
267 #define MANUAL "Manual"
268 #define MATCH "Match"
269 #define MEDIA "Media"
270 #define MIXED "Mixed"
271 #define MODEL "Model"
272 #define MODE "Mode"
273 #define MODEM "Modem"
274 #define MPPE40 "MPPE40"
275 #define MPPE128 "MPPE128"
276 #define MRU "MRU"
277 #define MSCHAP1 "MSCHAP1"
278 #define MSCHAP2 "MSCHAP2"
279 #define MTU "MTU"
280 #define NAME "Name"
281 #define NETBIOS "NetBIOS"
282 #define NETINFO "NetInfo"
283 #define NETWORK "Network"
284 #define NETWORKID "NetworkID"
285 #define NETWORKRANGE "NetworkRange"
286 #define NETWORKSERVICES "NetworkServices"
287 #define NEVER "Never"
288 #define NODE "Node"
289 #define NODEID "NodeID"
290 #define NOTE "Note"
291 #define ONDEMAND "OnDemand"
292 #define ONRETRY "OnRetry"
293 #define OPTIONS "Options"
294 #define ORDER "Order"
295 #define ORDERS "Orders"
296 #define OVERRIDEPRIMARY "OverridePrimary"
297 #define PAP "PAP"
298 #define PASSIVE "Passive"
299 #define PASSWORD "Password"
300 #define PEER "Peer"
301 #define PERSONALITY "Personality"
302 #define PLUGIN "Plugin"
303 #define PLUGINS "Plugins"
304 #define POWER "Power"
305 #define PORT "Port"
306 #define PPP "PPP"
307 #define PPPOE "PPPoE"
308 #define PPPSERIAL "PPPSerial"
309 #define PPTP "PPTP"
310 #define PREFERRED "Preferred"
311 #define PREFIXLENGTH "PrefixLength"
312 #define PREFS "Prefs"
313 #define PRIMARYINTERFACE "PrimaryInterface"
314 #define PRIMARYRANK "PrimaryRank"
315 #define PRIMARYSERVICE "PrimaryService"
316 #define PRIORITY "Priority"
317 #define PROMPT "Prompt"
318 #define PROTOCOL "Protocol"
319 #define PROXIES "Proxies"
320 #define PROXY "Proxy"
321 #define PULSEDIAL "PulseDial"
322 #define RANKED "Ranked"
323 #define RECEIVEACCM "ReceiveACCM"
324 #define RECENT "Recent"
325 #define REDIALCOUNT "RedialCount"
326 #define REDIAL "Redial"
327 #define REDIALINTERVAL "RedialInterval"
328 #define REGION "Region"
329 #define RELAY "Relay"
330 #define REMINDER "Reminder"
331 #define REMINDERTIME "ReminderTime"
332 #define REMOTEADDRESS "RemoteAddress"
333 #define RETRYCONNECTTIME "RetryConnectTime"
334 #define ROOTSEPARATOR "RootSeparator"
335 #define ROUTER "Router"
336 #define ROUTERADVERTISEMENT "RouterAdvertisement"
337 #define RTSP "RTSP"
338 #define SAVEPASSWORDS "SavePasswords"
339 #define SCOPE "Scope"
340 #define SCRIPT "Script"
341 #define SEARCH "Search"
342 #define SEEDNETWORKRANGE "SeedNetworkRange"
343 #define SEEDROUTER "SeedRouter"
344 #define SEEDZONES "SeedZones"
345 #define SERVER "Server"
346 #define SERVICE "Service"
347 #define SERVICEIDS "ServiceIDs"
348 #define SESSIONTIMER "SessionTimer"
349 #define SETS "Sets"
350 #define SETUP "Setup"
351 #define SHAREDSECRET "SharedSecret"
352 #define SMB "SMB"
353 #define SOCKS "SOCKS"
354 #define SORTLIST "SortList"
355 #define SPEAKER "Speaker"
356 #define SPEED "Speed"
357 #define STATE "State"
358 #define STATUS "Status"
359 #define STF "6to4"
360 #define STRONGEST "Strongest"
361 #define SUBNETMASKS "SubnetMasks"
362 #define SUBTYPE "SubType"
363 #define SUPPLEMENTAL "Supplemental"
364 #define SUPPORTSMODEMONHOLD "SupportsModemOnHold"
365 #define SYSTEM "System"
366 #define TAG "Tag"
367 #define TAGS "Tags"
368 #define TERMINALSCRIPT "TerminalScript"
369 #define TIMEOUT "Timeout"
370 #define TOKEN "Token"
371 #define TRANSMITACCM "TransmitACCM"
372 #define TRANSPORT "Transport"
373 #define TYPE "Type"
374 #define UID "UID"
375 #define UPDATED "Updated"
376 #define URLSTRING "URLString"
377 #define USERDEFINEDNAME "UserDefinedName"
378 #define USE "Use"
379 #define USERS "Users"
380 #define VENDOR "Vendor"
381 #define VERBOSELOGGING "VerboseLogging"
382 #define VIRTUALNETWORKINTERFACES "VirtualNetworkInterfaces"
383 #define VLAN "VLAN"
384 #define WAITFORDIALTONE "WaitForDialTone"
385 #define WINS "WINS"
386 #define WORKGROUP "Workgroup"
387 #define XAUTH "XAuth"
388
389
390 typedef struct {
391 int control;
392 const char * prefix;
393 const char * key;
394 const char * value;
395 const char * type;
396 } schemaDefinition;
397
398 static schemaDefinition names[] = {
399
400 { GROUP, NULL, "Reserved Keys", NULL, NULL },
401
402 { SC_10_1, RESV, LINK, "__LINK__", CFSTRING },
403 { SC_10_1, RESV, INACTIVE, "__INACTIVE__", NULL },
404 { COMMENT, "", NULL, NULL, NULL },
405
406 { GROUP, NULL, "Generic Keys", NULL, NULL },
407
408 { SC_10_1, PROP, INTERFACENAME, NULL, CFSTRING },
409 { SC_10_1, PROP, MACADDRESS, NULL, CFSTRING },
410 { SC_10_1, PROP, USERDEFINEDNAME, NULL, CFSTRING },
411 { SC_10_1, PROP, VERSION, NULL, CFSTRING },
412 { COMMENT, "", NULL, NULL, NULL },
413
414 { GROUP, PREF, "Preference Keys", NULL, NULL },
415
416 { SC_10_1, PREF, CURRENTSET, NULL, CFSTRING },
417 { SC_10_1, PREF, NETWORKSERVICES, NULL, CFDICTIONARY },
418 { SC_10_1, PREF, SETS, NULL, CFDICTIONARY },
419 { SC_10_1, PREF, SYSTEM, NULL, CFDICTIONARY },
420 { COMMENT, "", NULL, NULL, NULL },
421
422 { GROUP_PRIVATE, PREF, "Preference Keys", NULL, NULL },
423
424 { SC_10_5_PRIVATE, PREF, VIRTUALNETWORKINTERFACES, NULL, CFDICTIONARY },
425 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
426
427 { GROUP, COMP, "Component Keys", NULL, NULL },
428
429 { SC_10_1, COMP, NETWORK, NULL, NULL },
430 { SC_10_1, COMP, SERVICE, NULL, NULL },
431 { SC_10_1, COMP, GLOBAL, NULL, NULL },
432 { SC_10_2, COMP, HOSTNAMES, NULL, NULL },
433 { SC_10_1, COMP, INTERFACE, NULL, NULL },
434 { SC_10_1, COMP, SYSTEM, NULL, NULL },
435 { SC_10_1, COMP, USERS, NULL, NULL },
436 { COMMENT, "", NULL, NULL, NULL },
437
438 { COMMENT, "--- Regex pattern which matches any component ---", NULL },
439 { SC_10_1, COMP, ANYREGEX, "[^/]+", NULL },
440 { COMMENT, "", NULL, NULL, NULL },
441
442 { GROUP, NETENT, "Network Entity Keys", NULL, NULL },
443
444 { SC_10_1, NETENT, AIRPORT, NULL, CFDICTIONARY },
445 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
446 { SC_10_1_10_6, NETENT, APPLETALK, NULL, CFDICTIONARY },
447 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
448 { SC_10_1, NETENT, DHCP, NULL, CFDICTIONARY },
449 { SC_10_1, NETENT, DNS, NULL, CFDICTIONARY },
450 { SC_10_1, NETENT, ETHERNET, NULL, CFDICTIONARY },
451 { SC_10_3, NETENT, FIREWIRE, NULL, CFDICTIONARY },
452 { SC_10_1, NETENT, INTERFACE, NULL, CFDICTIONARY },
453 { SC_10_5, NETENT, IPSEC, NULL, CFDICTIONARY },
454 { SC_10_1, NETENT, IPV4, NULL, CFDICTIONARY },
455 { SC_10_1, NETENT, IPV6, NULL, CFDICTIONARY },
456 { SC_10_3, NETENT, L2TP, NULL, CFDICTIONARY },
457 { SC_10_1, NETENT, LINK, NULL, CFDICTIONARY },
458 { SC_10_1, NETENT, MODEM, NULL, CFDICTIONARY },
459 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
460 { SC_10_1_10_5, NETENT, NETINFO, NULL, CFDICTIONARY },
461 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
462 { SC_10_1, NETENT, PPP, NULL, CFDICTIONARY },
463 { SC_10_1, NETENT, PPPOE, NULL, CFDICTIONARY },
464 { SC_10_3, NETENT, PPPSERIAL, NULL, CFDICTIONARY },
465 { SC_10_3, NETENT, PPTP, NULL, CFDICTIONARY },
466 { SC_10_1, NETENT, PROXIES, NULL, CFDICTIONARY },
467 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
468 { SC_10_5, NETENT, SMB, NULL, CFDICTIONARY },
469 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
470 { SC_10_3, NETENT, STF, NULL, CFDICTIONARY },
471 { COMMENT, "", NULL, NULL, NULL },
472
473 { GROUP_PRIVATE, NETENT, "Network Entity Keys", NULL, NULL },
474
475 { SC_10_5_PRIVATE, NETENT, EAPOL, NULL, CFDICTIONARY },
476 { SC_10_6_IPHONE_3_0_PRIVATE, NETENT, ONDEMAND, NULL, CFDICTIONARY },
477 { SC_10_6_IPHONE_2_0_PRIVATE, NETENT, SERVICE, "__SERVICE__", CFDICTIONARY },
478 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
479
480 { GROUP, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },
481
482 { SC_10_2, NETPROP, OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
483 { SC_10_1, NETPROP, SERVICE ORDER, NULL, CFARRAY_CFSTRING },
484 { SC_10_1, NETPROP, PPP OVERRIDEPRIMARY, NULL, CFNUMBER_BOOL },
485 { COMMENT, "", NULL, NULL, NULL },
486
487 { GROUP_PRIVATE, NETPROP, KEY_PREFIX COMP NETWORK " Properties", NULL, NULL },
488
489 { SC_10_5_PRIVATE, NETPROP, IGNORELINKSTATUS, NULL, CFBOOLEAN },
490 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
491
492 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK INTERFACE " Properties", NULL, NULL },
493
494 { SC_10_2, NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
495 { COMMENT, "", NULL, NULL, NULL },
496
497 { GROUP, NETPROP AIRPORT, KEY_PREFIX COMP NETWORK HOSTNAMES " Properties", NULL, NULL },
498
499 { SC_10_2, NETPROP, LOCALHOSTNAME, NULL, CFSTRING },
500 { COMMENT, "", NULL, NULL, NULL },
501
502 { GROUP, NETPROP AIRPORT, KEY_PREFIX NETENT AIRPORT " (Hardware) Entity Keys", NULL, NULL },
503
504 { SC_10_2, NETPROP AIRPORT, ALLOWNETCREATION, NULL, CFNUMBER_BOOL },
505 { SC_10_1, NETPROP AIRPORT, AUTH PASSWORD, NULL, CFDATA },
506 { SC_10_1, NETPROP AIRPORT, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
507 { SC_10_2, NETPROP AIRPORT, JOIN MODE, NULL, CFSTRING },
508 { SC_10_1, NETPROP AIRPORT, POWER ENABLED, NULL, CFNUMBER_BOOL },
509 { SC_10_1, NETPROP AIRPORT, PREFERRED NETWORK, NULL, CFSTRING },
510 { SC_10_2, NETPROP AIRPORT, SAVEPASSWORDS, NULL, CFNUMBER_BOOL },
511 { COMMENT, "", NULL, NULL, NULL },
512 { COMMENT, "--- " KEY_PREFIX NETPROP AIRPORT JOIN MODE " values ---", NULL, NULL, NULL },
513 { SC_10_3, NETVAL AIRPORT JOIN MODE, AUTOMATIC, NULL, NULL },
514 { SC_10_2, NETVAL AIRPORT JOIN MODE, PREFERRED, NULL, NULL },
515 { SC_10_4, NETVAL AIRPORT JOIN MODE, RANKED, NULL, NULL },
516 { SC_10_2, NETVAL AIRPORT JOIN MODE, RECENT, NULL, NULL },
517 { SC_10_2, NETVAL AIRPORT JOIN MODE, STRONGEST, NULL, NULL },
518 { COMMENT, "", NULL, NULL, NULL },
519 { COMMENT, "--- " KEY_PREFIX NETPROP AIRPORT PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
520 { SC_10_3, NETVAL AIRPORT AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
521 { COMMENT, "", NULL, NULL, NULL },
522
523 { GROUP_DEPRECATED, NETPROP APPLETALK, KEY_PREFIX NETENT APPLETALK " Entity Keys", NULL, NULL },
524
525 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
526 { SC_10_1_10_6, NETPROP APPLETALK, COMPUTERNAME, NULL, CFSTRING },
527 { SC_10_1_10_6, NETPROP APPLETALK, COMPUTERNAME ENCODING, NULL, CFNUMBER },
528 { SC_10_1_10_6, NETPROP APPLETALK, CONFIGMETHOD, NULL, CFSTRING },
529 { SC_10_1_10_6, NETPROP APPLETALK, DEFAULTZONE, NULL, CFSTRING },
530 { SC_10_1_10_6, NETPROP APPLETALK, NETWORKID, NULL, CFNUMBER },
531 { SC_10_2_10_6, NETPROP APPLETALK, NETWORKRANGE, NULL, CFARRAY_CFNUMBER },
532 { SC_10_1_10_6, NETPROP APPLETALK, NODEID, NULL, CFNUMBER },
533 { SC_10_1_10_6, NETPROP APPLETALK, SEEDNETWORKRANGE, NULL, CFARRAY_CFNUMBER },
534 { SC_10_1_10_6, NETPROP APPLETALK, SEEDZONES, NULL, CFARRAY_CFSTRING },
535 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
536 { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP APPLETALK CONFIGMETHOD " values ---", NULL, NULL, NULL },
537 { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, NODE, NULL, NULL },
538 { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, ROUTER, NULL, NULL },
539 { SC_10_1_10_6, NETVAL APPLETALK CONFIGMETHOD, SEEDROUTER, NULL, NULL },
540 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
541 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
542
543
544 { GROUP, NETPROP DNS, KEY_PREFIX NETENT DNS " Entity Keys", NULL, NULL },
545
546 { SC_10_1, NETPROP DNS, DOMAIN NAME, NULL, CFSTRING },
547 { SC_10_4, NETPROP DNS, OPTIONS, NULL, CFSTRING },
548 { SC_10_1, NETPROP DNS, SEARCH DOMAINS, NULL, CFARRAY_CFSTRING},
549 { SC_10_4, NETPROP DNS, SEARCH ORDER, NULL, CFNUMBER},
550 { SC_10_1, NETPROP DNS, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
551 { SC_10_4, NETPROP DNS, SERVER PORT, NULL, CFNUMBER },
552 { SC_10_4, NETPROP DNS, SERVER TIMEOUT, NULL, CFNUMBER },
553 { SC_10_1, NETPROP DNS, SORTLIST, NULL, CFARRAY_CFSTRING },
554 { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH DOMAINS, NULL, CFARRAY_CFSTRING},
555 { SC_10_4, NETPROP DNS, SUPPLEMENTAL MATCH ORDERS, NULL, CFARRAY_CFNUMBER},
556 { COMMENT, "", NULL, NULL, NULL },
557
558 { GROUP, NETPROP ETHERNET, KEY_PREFIX NETENT ETHERNET " (Hardware) Entity Keys", NULL, NULL },
559
560 { SC_10_2, NETPROP ETHERNET, MEDIA SUBTYPE, NULL, CFSTRING },
561 { SC_10_2, NETPROP ETHERNET, MEDIA OPTIONS, NULL, CFARRAY_CFSTRING },
562 { SC_10_2, NETPROP ETHERNET, MTU, NULL, CFNUMBER },
563 { COMMENT, "", NULL, NULL, NULL },
564
565 { GROUP, NETPROP FIREWIRE, KEY_PREFIX NETENT FIREWIRE " (Hardware) Entity Keys", NULL, NULL },
566
567 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
568 { COMMENT, "", NULL, NULL, NULL },
569
570 { GROUP, NETPROP INTERFACE, KEY_PREFIX NETENT INTERFACE " Entity Keys", NULL, NULL },
571
572 { SC_10_1, NETPROP INTERFACE, DEVICENAME, NULL, CFSTRING },
573 { SC_10_1, NETPROP INTERFACE, HARDWARE, NULL, CFSTRING },
574 { SC_10_1, NETPROP INTERFACE, TYPE, NULL, CFSTRING },
575 { SC_10_1, NETPROP INTERFACE, SUBTYPE, NULL, CFSTRING },
576 { SC_10_2, NETPROP INTERFACE, SUPPORTSMODEMONHOLD, NULL, CFNUMBER_BOOL },
577 { COMMENT, "", NULL, NULL, NULL },
578 { COMMENT, "--- " KEY_PREFIX NETPROP INTERFACE TYPE " values ---", NULL, NULL, NULL },
579 { SC_10_1, NETVAL INTERFACE TYPE, ETHERNET, NULL, NULL },
580 { SC_10_3, NETVAL INTERFACE TYPE, FIREWIRE, NULL, NULL },
581 { SC_10_1, NETVAL INTERFACE TYPE, PPP, NULL, NULL },
582 { SC_10_3, NETVAL INTERFACE TYPE, STF, NULL, NULL },
583 { SC_10_6_IPHONE_2_0, NETVAL INTERFACE TYPE, IPSEC, NULL, NULL },
584 { COMMENT, "", NULL, NULL, NULL },
585 { COMMENT, "--- " KEY_PREFIX NETPROP SERVICE SUBTYPE " values (for " PPP ") ---", NULL, NULL, NULL },
586 { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPOE, NULL, NULL },
587 { SC_10_1, NETVAL INTERFACE SUBTYPE, PPPSERIAL, NULL, NULL },
588 { SC_10_2, NETVAL INTERFACE SUBTYPE, PPTP, NULL, NULL },
589 { SC_10_3, NETVAL INTERFACE SUBTYPE, L2TP, NULL, NULL },
590 { COMMENT, "", NULL, NULL, NULL },
591
592 { GROUP, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },
593
594 { SC_10_5, NETPROP IPSEC, AUTHENTICATIONMETHOD, NULL, CFSTRING },
595 { SC_10_5, NETPROP IPSEC, LOCALCERTIFICATE, NULL, CFDATA },
596 { SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER, NULL, CFSTRING },
597 { SC_10_5, NETPROP IPSEC, LOCALIDENTIFIER TYPE, NULL, CFSTRING },
598 { SC_10_5, NETPROP IPSEC, SHAREDSECRET, NULL, CFSTRING },
599 { SC_10_5, NETPROP IPSEC, SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
600 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, CONNECTTIME, NULL, CFNUMBER },
601 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, REMOTEADDRESS, NULL, CFSTRING },
602 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, STATUS, STATUS, CFNUMBER },
603 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH ENABLED, NULL, CFNUMBER_BOOL },
604 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH NAME, NULL, CFSTRING },
605 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH PASSWORD, NULL, CFSTRING },
606 { SC_10_6_IPHONE_2_0, NETPROP IPSEC, XAUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
607 { COMMENT, "", NULL, NULL, NULL },
608 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC AUTHENTICATIONMETHOD " values ---", NULL, NULL, NULL },
609 { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, SHAREDSECRET, NULL, NULL },
610 { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, CERTIFICATE, NULL, NULL },
611 { SC_10_5, NETVAL IPSEC AUTHENTICATIONMETHOD, HYBRID, NULL, NULL },
612 { COMMENT, "", NULL, NULL, NULL },
613 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC LOCALIDENTIFIER TYPE " values ---", NULL, NULL, NULL },
614 { SC_10_5, NETVAL IPSEC LOCALIDENTIFIER TYPE, KEYID, NULL, NULL },
615 { COMMENT, "", NULL, NULL, NULL },
616 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
617 { SC_10_5, NETVAL IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
618 { COMMENT, "", NULL, NULL, NULL },
619 { COMMENT, "--- " KEY_PREFIX NETPROP IPSEC XAUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
620 { SC_10_6_IPHONE_2_0, NETVAL IPSEC XAUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
621 { SC_10_6_IPHONE_3_0, NETVAL IPSEC XAUTH PASSWORD ENCRYPTION, PROMPT, NULL, NULL },
622 { COMMENT, "", NULL, NULL, NULL },
623
624 { GROUP_PRIVATE, NETPROP IPSEC, KEY_PREFIX NETENT IPSEC " Entity Keys", NULL, NULL },
625
626 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, LAST CAUSE, NULL, CFNUMBER },
627 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
628 { COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
629 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
630 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
631 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
632 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP IPSEC, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
633 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
634
635 { GROUP, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
636
637 { SC_10_1, NETPROP IPV4, ADDRESSES, NULL, CFARRAY_CFSTRING },
638 { SC_10_1, NETPROP IPV4, CONFIGMETHOD, NULL, CFSTRING },
639 { SC_10_1, NETPROP IPV4, DHCPCLIENTID, NULL, CFSTRING },
640 { SC_10_1, NETPROP IPV4, ROUTER, NULL, CFSTRING },
641 { SC_10_1, NETPROP IPV4, SUBNETMASKS, NULL, CFARRAY_CFSTRING },
642 { SC_10_1, NETPROP IPV4, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
643 { SC_10_1, NETPROP IPV4, BROADCAST ADDRESSES, NULL, CFARRAY_CFSTRING },
644 { COMMENT, "", NULL, NULL, NULL },
645 { COMMENT, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
646 { SC_10_6_IPHONE_2_0, NETVAL IPV4 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
647 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, BOOTP, NULL, NULL },
648 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, DHCP, NULL, NULL },
649 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, INFORM, NULL, NULL },
650 { SC_10_2, NETVAL IPV4 CONFIGMETHOD, LINKLOCAL, NULL, NULL },
651 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, MANUAL, NULL, NULL },
652 { SC_10_1, NETVAL IPV4 CONFIGMETHOD, PPP, NULL, NULL },
653 { COMMENT, "", NULL, NULL, NULL },
654
655 { GROUP_PRIVATE, NETPROP IPV4, KEY_PREFIX NETENT IPV4 " Entity Keys", NULL, NULL },
656 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP IPV4 CONFIGMETHOD " values ---", NULL, NULL, NULL },
657 { SC_10_5_PRIVATE, NETVAL IPV4 CONFIGMETHOD, FAILOVER, NULL, NULL },
658 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
659
660 { GROUP, NETPROP IPV6, KEY_PREFIX NETENT IPV6 " Entity Keys", NULL, NULL },
661
662 { SC_10_1, NETPROP IPV6, ADDRESSES, NULL, CFARRAY_CFSTRING },
663 { SC_10_1, NETPROP IPV6, CONFIGMETHOD, NULL, CFSTRING },
664 { SC_10_3, NETPROP IPV6, DEST ADDRESSES, NULL, CFARRAY_CFSTRING },
665 { SC_10_3, NETPROP IPV6, FLAGS, NULL, CFNUMBER },
666 { SC_10_3, NETPROP IPV6, PREFIXLENGTH, NULL, CFARRAY_CFNUMBER },
667 { SC_10_3, NETPROP IPV6, ROUTER, NULL, CFSTRING },
668 { COMMENT, "", NULL, NULL, NULL },
669 { COMMENT, "--- " KEY_PREFIX NETPROP IPV6 CONFIGMETHOD " values ---", NULL, NULL, NULL },
670 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, AUTOMATIC, NULL, NULL },
671 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, MANUAL, NULL, NULL },
672 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, ROUTERADVERTISEMENT, NULL, NULL },
673 { SC_10_3, NETVAL IPV6 CONFIGMETHOD, STF, NULL, NULL },
674 { COMMENT, "", NULL, NULL, NULL },
675
676 { GROUP, NETPROP STF, KEY_PREFIX NETENT STF " Entity Keys", NULL, NULL },
677
678 { SC_10_3, NETPROP STF, RELAY, NULL, CFSTRING },
679 { COMMENT, "", NULL, NULL, NULL },
680
681 { GROUP, NETPROP LINK, KEY_PREFIX NETENT LINK " Entity Keys", NULL, NULL },
682
683 { SC_10_1, NETPROP LINK, ACTIVE, NULL, CFBOOLEAN },
684 { SC_10_2, NETPROP LINK, DETACHING, NULL, CFBOOLEAN },
685 { COMMENT, "", NULL, NULL, NULL },
686
687 { GROUP, NETPROP MODEM, KEY_PREFIX NETENT MODEM " (Hardware) Entity Keys", NULL, NULL },
688
689 { SC_10_5, NETPROP MODEM, ACCESSPOINTNAME, NULL, CFSTRING },
690 { SC_10_5, NETPROP MODEM, CONNECTION PERSONALITY, NULL, CFSTRING },
691 { SC_10_1, NETPROP MODEM, CONNECTION SCRIPT, NULL, CFSTRING },
692 { SC_10_2, NETPROP MODEM, CONNECTSPEED, NULL, CFNUMBER },
693 { SC_10_1, NETPROP MODEM, DATACOMPRESSION, NULL, CFNUMBER_BOOL },
694 { SC_10_5, NETPROP MODEM, DEVICE CONTEXTID, NULL, CFSTRING },
695 { SC_10_5, NETPROP MODEM, DEVICE MODEL, NULL, CFSTRING },
696 { SC_10_5, NETPROP MODEM, DEVICE VENDOR, NULL, CFSTRING },
697 { SC_10_1, NETPROP MODEM, DIALMODE, NULL, CFSTRING },
698 { SC_10_1, NETPROP MODEM, ERRORCORRECTION, NULL, CFNUMBER_BOOL },
699 { SC_10_2, NETPROP MODEM, HOLD CALLWAITINGAUDIBLEALERT, NULL, CFNUMBER_BOOL },
700 { SC_10_2, NETPROP MODEM, HOLD DISCONNECTONANSWER, NULL, CFNUMBER_BOOL },
701 { SC_10_2, NETPROP MODEM, HOLD ENABLED, NULL, CFNUMBER_BOOL },
702 { SC_10_2, NETPROP MODEM, HOLD REMINDER, NULL, CFNUMBER_BOOL },
703 { SC_10_2, NETPROP MODEM, HOLD REMINDERTIME, NULL, CFNUMBER },
704 { SC_10_2, NETPROP MODEM, NOTE, NULL, CFSTRING },
705 { SC_10_1, NETPROP MODEM, PULSEDIAL, NULL, CFNUMBER_BOOL },
706 { SC_10_1, NETPROP MODEM, SPEAKER, NULL, CFNUMBER_BOOL },
707 { SC_10_1, NETPROP MODEM, SPEED, NULL, CFNUMBER },
708 { COMMENT, "", NULL, NULL, NULL },
709 { COMMENT, "--- " KEY_PREFIX NETPROP MODEM DIALMODE " values ---", NULL, NULL, NULL },
710 { SC_10_1, NETVAL MODEM DIALMODE, IGNOREDIALTONE, NULL, NULL },
711 { SC_10_1, NETVAL MODEM DIALMODE, MANUAL, NULL, NULL },
712 { SC_10_1, NETVAL MODEM DIALMODE, WAITFORDIALTONE, NULL, NULL },
713 { COMMENT, "", NULL, NULL, NULL },
714
715 { GROUP_DEPRECATED, NETPROP NETINFO, KEY_PREFIX NETENT NETINFO " Entity Keys", NULL, NULL },
716
717 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
718 { SC_10_1_10_5, NETPROP NETINFO, BINDINGMETHODS, NULL, CFSTRING },
719 { SC_10_1_10_5, NETPROP NETINFO, SERVER ADDRESSES, NULL, CFARRAY_CFSTRING },
720 { SC_10_1_10_5, NETPROP NETINFO, SERVER TAGS, NULL, CFARRAY_CFSTRING },
721 { SC_10_1_10_5, NETPROP NETINFO, BROADCAST SERVER TAG, NULL, CFSTRING },
722 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
723 { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BINDINGMETHODS " values ---", NULL, NULL, NULL },
724 { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, BROADCAST, NULL, NULL },
725 { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, DHCP, NULL, NULL },
726 { SC_10_1_10_5, NETVAL NETINFO BINDINGMETHODS, MANUAL, NULL, NULL },
727 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
728 { COMMENT_DEPRECATED, "--- " KEY_PREFIX NETPROP NETINFO BROADCAST SERVER TAG " default value ---", NULL, NULL, NULL },
729 { SC_10_1_10_5, NETVAL NETINFO, DEFAULT SERVER TAG, "network", NULL },
730 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
731 { COMMENT_DEPRECATED, "", NULL, NULL, NULL },
732
733 { GROUP, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },
734
735 { SC_10_3, NETPROP PPP, ACSP ENABLED, NULL, CFNUMBER_BOOL },
736 { SC_10_2, NETPROP PPP, CONNECTTIME, NULL, CFNUMBER },
737 { SC_10_2, NETPROP PPP, DEVICE LAST CAUSE, NULL, CFNUMBER },
738 { SC_10_1, NETPROP PPP, DIALONDEMAND, NULL, CFNUMBER_BOOL },
739 { SC_10_4, NETPROP PPP, DISCONNECTONFASTUSERSWITCH, NULL, CFNUMBER_BOOL },
740 { SC_10_1, NETPROP PPP, DISCONNECTONIDLE, NULL, CFNUMBER_BOOL },
741 { SC_10_1, NETPROP PPP, DISCONNECTONIDLETIMER, NULL, CFNUMBER },
742 { SC_10_1, NETPROP PPP, DISCONNECTONLOGOUT, NULL, CFNUMBER_BOOL },
743 { SC_10_2, NETPROP PPP, DISCONNECTONSLEEP, NULL, CFNUMBER_BOOL },
744 { SC_10_3, NETPROP PPP, DISCONNECTTIME, NULL, CFNUMBER },
745 { SC_10_1, NETPROP PPP, IDLEREMINDERTIMER, NULL, CFNUMBER },
746 { SC_10_1, NETPROP PPP, IDLEREMINDER, NULL, CFNUMBER_BOOL },
747 { SC_10_2, NETPROP PPP, LAST CAUSE, NULL, CFNUMBER },
748 { SC_10_1, NETPROP PPP, LOGFILE, NULL, CFSTRING },
749 { SC_10_2, NETPROP PPP, PLUGINS, NULL, CFARRAY_CFSTRING },
750 { SC_10_3, NETPROP PPP, RETRYCONNECTTIME, NULL, CFNUMBER },
751 { SC_10_1, NETPROP PPP, SESSIONTIMER, NULL, CFNUMBER },
752 { SC_10_2, NETPROP PPP, STATUS, NULL, CFNUMBER },
753 { SC_10_2, NETPROP PPP, USE SESSIONTIMER, NULL, CFNUMBER_BOOL },
754 { SC_10_1, NETPROP PPP, VERBOSELOGGING, NULL, CFNUMBER_BOOL },
755 { COMMENT, "", NULL, NULL, NULL },
756
757 { COMMENT, "--- " AUTH ": ---", NULL, NULL, NULL },
758 { SC_10_3, NETPROP PPP, AUTH EAP PLUGINS, NULL, CFARRAY_CFSTRING },
759 { SC_10_1, NETPROP PPP, AUTH NAME, NULL, CFSTRING },
760 { SC_10_1, NETPROP PPP, AUTH PASSWORD, NULL, CFSTRING },
761 { SC_10_1, NETPROP PPP, AUTH PASSWORD ENCRYPTION, NULL, CFSTRING },
762 { SC_10_3, NETPROP PPP, AUTH PROMPT, NULL, CFSTRING },
763 { SC_10_1, NETPROP PPP, AUTH PROTOCOL, NULL, CFARRAY_CFSTRING },
764 { COMMENT, "", NULL, NULL, NULL },
765 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PASSWORD ENCRYPTION " values ---", NULL, NULL, NULL },
766 { SC_10_3, NETVAL PPP AUTH PASSWORD ENCRYPTION, KEYCHAIN, NULL, NULL },
767 { SC_10_5, NETVAL PPP AUTH PASSWORD ENCRYPTION, TOKEN, NULL, NULL },
768 { COMMENT, "", NULL, NULL, NULL },
769 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROMPT " values ---", NULL, NULL, NULL },
770 { SC_10_3, NETVAL PPP AUTH PROMPT, BEFORE, NULL, CFSTRING },
771 { SC_10_3, NETVAL PPP AUTH PROMPT, AFTER, NULL, CFSTRING },
772 { COMMENT, "", NULL, NULL, NULL },
773 { COMMENT, "--- " KEY_PREFIX NETPROP PPP AUTH PROTOCOL " values ---", NULL, NULL, NULL },
774 { SC_10_1, NETVAL PPP AUTH PROTOCOL, CHAP, NULL, CFSTRING },
775 { SC_10_3, NETVAL PPP AUTH PROTOCOL, EAP, NULL, CFSTRING },
776 { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP1, NULL, CFSTRING },
777 { SC_10_3, NETVAL PPP AUTH PROTOCOL, MSCHAP2, NULL, CFSTRING },
778 { SC_10_1, NETVAL PPP AUTH PROTOCOL, PAP, NULL, CFSTRING },
779 { COMMENT, "", NULL, NULL, NULL },
780
781 { COMMENT, "--- " COMM ": ---", NULL, NULL, NULL },
782 { SC_10_1, NETPROP PPP, COMM ALTERNATEREMOTEADDRESS, NULL, CFSTRING },
783 { SC_10_1, NETPROP PPP, COMM CONNECTDELAY, NULL, CFNUMBER },
784 { SC_10_1, NETPROP PPP, COMM DISPLAYTERMINALWINDOW, NULL, CFNUMBER_BOOL },
785 { SC_10_1, NETPROP PPP, COMM REDIALCOUNT, NULL, CFNUMBER },
786 { SC_10_1, NETPROP PPP, COMM REDIAL ENABLED, NULL, CFNUMBER_BOOL },
787 { SC_10_1, NETPROP PPP, COMM REDIALINTERVAL, NULL, CFNUMBER },
788 { SC_10_1, NETPROP PPP, COMM REMOTEADDRESS, NULL, CFSTRING },
789 { SC_10_1, NETPROP PPP, COMM TERMINALSCRIPT, NULL, CFSTRING },
790 { SC_10_2, NETPROP PPP, COMM USE TERMINALSCRIPT, NULL, CFNUMBER_BOOL },
791 { COMMENT, "", NULL, NULL, NULL },
792
793 { COMMENT, "--- " CCP ": ---", NULL, NULL, NULL },
794 { SC_10_2, NETPROP PPP, CCP ENABLED, NULL, CFNUMBER_BOOL },
795 { SC_10_4, NETPROP PPP, CCP MPPE40 ENABLED, NULL, CFNUMBER_BOOL },
796 { SC_10_4, NETPROP PPP, CCP MPPE128 ENABLED, NULL, CFNUMBER_BOOL },
797 { COMMENT, "", NULL, NULL, NULL },
798
799 { COMMENT, "--- " IPCP ": ---", NULL, NULL, NULL },
800 { SC_10_1, NETPROP PPP, IPCP COMPRESSIONVJ, NULL, CFNUMBER_BOOL },
801 { SC_10_4, NETPROP PPP, IPCP USE PEER DNS, NULL, CFNUMBER_BOOL },
802 { COMMENT, "", NULL, NULL, NULL },
803
804 { COMMENT, "--- " LCP ": ---", NULL, NULL, NULL },
805 { SC_10_1, NETPROP PPP, LCP ECHO ENABLED, NULL, CFNUMBER_BOOL },
806 { SC_10_1, NETPROP PPP, LCP ECHOFAILURE, NULL, CFNUMBER },
807 { SC_10_1, NETPROP PPP, LCP ECHOINTERVAL, NULL, CFNUMBER },
808 { SC_10_1, NETPROP PPP, LCP COMPRESSIONACFIELD, NULL, CFNUMBER_BOOL },
809 { SC_10_1, NETPROP PPP, LCP COMPRESSIONPFIELD, NULL, CFNUMBER_BOOL },
810 { SC_10_1, NETPROP PPP, LCP MRU, NULL, CFNUMBER },
811 { SC_10_1, NETPROP PPP, LCP MTU, NULL, CFNUMBER },
812 { SC_10_1, NETPROP PPP, LCP RECEIVEACCM, NULL, CFNUMBER },
813 { SC_10_1, NETPROP PPP, LCP TRANSMITACCM, NULL, CFNUMBER },
814 { COMMENT, "", NULL, NULL, NULL },
815
816 { GROUP_PRIVATE, NETPROP PPP, KEY_PREFIX NETENT PPP " Entity Keys", NULL, NULL },
817
818 { COMMENT_PRIVATE, "--- " ONDEMAND ": ---", NULL, NULL, NULL },
819 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND DOMAINS, NULL, CFARRAY_CFSTRING },
820 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND ENABLED, NULL, CFNUMBER_BOOL },
821 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND HOSTNAME, NULL, CFSTRING }, // DEPRECATED, use kSCNetworkConnectionSelectionOptionOnDemandHostName
822 #ifdef NOTYET
823 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS ALWAYS, NULL, CFARRAY_CFSTRING },
824 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS ONRETRY, NULL, CFARRAY_CFSTRING },
825 { SC_10_6_IPHONE_3_0_PRIVATE, NETPROP PPP, ONDEMAND MATCH DOMAINS NEVER, NULL, CFARRAY_CFSTRING },
826 #endif // NOTYET
827 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND MODE, NULL, CFSTRING },
828 { SC_10_5_PRIVATE, NETPROP PPP, ONDEMAND PRIORITY, NULL, CFSTRING },
829 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
830 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP PPP ONDEMAND MODE " values ---", NULL, NULL, NULL },
831 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, AGGRESSIVE, NULL, NULL },
832 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, CONSERVATIVE, NULL, NULL },
833 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND MODE, COMPATIBLE, NULL, NULL },
834 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
835 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP PPP ONDEMAND PRIORITY " values ---", NULL, NULL, NULL },
836 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, DEFAULT, NULL, NULL },
837 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, HIGH, NULL, NULL },
838 { SC_10_5_PRIVATE, NETVAL PPP ONDEMAND PRIORITY, LOW, NULL, NULL },
839 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
840
841 { GROUP, NETPROP PPPOE, KEY_PREFIX NETENT PPPOE " Entity Keys", NULL, NULL },
842
843 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
844 { COMMENT, "", NULL, NULL, NULL },
845
846 { GROUP, NETPROP PPPSERIAL, KEY_PREFIX NETENT PPPSERIAL " Entity Keys", NULL, NULL },
847
848 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
849 { COMMENT, "", NULL, NULL, NULL },
850
851 { GROUP, NETPROP PPTP, KEY_PREFIX NETENT PPTP " Entity Keys", NULL, NULL },
852
853 { COMMENT, "* RESERVED FOR FUTURE USE *", NULL, NULL, NULL },
854 { COMMENT, "", NULL, NULL, NULL },
855
856 { GROUP, NETPROP L2TP, KEY_PREFIX NETENT L2TP " Entity Keys", NULL, NULL },
857
858 { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET, NULL, CFSTRING },
859 { SC_10_3, NETPROP L2TP, IPSEC SHAREDSECRET ENCRYPTION, NULL, CFSTRING },
860 { SC_10_3, NETPROP L2TP, TRANSPORT, NULL, CFSTRING },
861 { COMMENT, "", NULL, NULL, NULL },
862 { COMMENT, "--- " KEY_PREFIX NETPROP L2TP IPSEC SHAREDSECRET ENCRYPTION " values ---", NULL, NULL, NULL },
863 { SC_10_3, NETVAL L2TP IPSEC SHAREDSECRET ENCRYPTION, KEYCHAIN, NULL, NULL },
864 { COMMENT, "", NULL, NULL, NULL },
865 { COMMENT, "--- " KEY_PREFIX NETPROP L2TP TRANSPORT " values ---", NULL, NULL, NULL },
866 { SC_10_3, NETVAL L2TP TRANSPORT, IP, NULL, NULL },
867 { SC_10_3, NETVAL L2TP TRANSPORT, IPSEC, NULL, NULL },
868 { COMMENT, "", NULL, NULL, NULL },
869
870 { GROUP, NETPROP PROXIES, KEY_PREFIX NETENT PROXIES " Entity Keys", NULL, NULL },
871
872 { SC_10_1, NETPROP PROXIES, EXCEPTIONSLIST, NULL, CFARRAY_CFSTRING },
873 { SC_10_4, NETPROP PROXIES, EXCLUDESIMPLEHOSTNAMES, NULL, CFNUMBER_BOOL },
874 { SC_10_1, NETPROP PROXIES, FTP ENABLE, NULL, CFNUMBER_BOOL },
875 { SC_10_1, NETPROP PROXIES, FTP PASSIVE, NULL, CFNUMBER_BOOL },
876 { SC_10_1, NETPROP PROXIES, FTP PORT, NULL, CFNUMBER },
877 { SC_10_1, NETPROP PROXIES, FTP PROXY, NULL, CFSTRING },
878 { SC_10_1, NETPROP PROXIES, GOPHER ENABLE, NULL, CFNUMBER_BOOL },
879 { SC_10_1, NETPROP PROXIES, GOPHER PORT, NULL, CFNUMBER },
880 { SC_10_1, NETPROP PROXIES, GOPHER PROXY, NULL, CFSTRING },
881 { SC_10_1, NETPROP PROXIES, HTTP ENABLE, NULL, CFNUMBER_BOOL },
882 { SC_10_1, NETPROP PROXIES, HTTP PORT, NULL, CFNUMBER },
883 { SC_10_1, NETPROP PROXIES, HTTP PROXY, NULL, CFSTRING },
884 { SC_10_1, NETPROP PROXIES, HTTPS ENABLE, NULL, CFNUMBER_BOOL },
885 { SC_10_1, NETPROP PROXIES, HTTPS PORT, NULL, CFNUMBER },
886 { SC_10_1, NETPROP PROXIES, HTTPS PROXY, NULL, CFSTRING },
887 { SC_10_1, NETPROP PROXIES, RTSP ENABLE, NULL, CFNUMBER_BOOL },
888 { SC_10_1, NETPROP PROXIES, RTSP PORT, NULL, CFNUMBER },
889 { SC_10_1, NETPROP PROXIES, RTSP PROXY, NULL, CFSTRING },
890 { SC_10_1, NETPROP PROXIES, SOCKS ENABLE, NULL, CFNUMBER_BOOL },
891 { SC_10_1, NETPROP PROXIES, SOCKS PORT, NULL, CFNUMBER },
892 { SC_10_1, NETPROP PROXIES, SOCKS PROXY, NULL, CFSTRING },
893 { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG ENABLE, NULL, CFNUMBER_BOOL },
894 { SC_10_4, NETPROP PROXIES, PROXY AUTOCONFIG URLSTRING, NULL, CFSTRING },
895 { SC_10_4, NETPROP PROXIES, PROXY AUTODISCOVERY ENABLE, NULL, CFNUMBER_BOOL },
896 { COMMENT, "", NULL, NULL, NULL },
897
898 { GROUP_PRIVATE, NETPROP SERVICE, KEY_PREFIX NETENT SERVICE " Entity Keys", NULL, NULL },
899
900 { SC_10_6_IPHONE_2_0_PRIVATE, NETPROP SERVICE, PRIMARYRANK, NULL, CFSTRING },
901 { SC_10_6_IPHONE_2_0_PRIVATE, NETPROP SERVICE, USERDEFINEDNAME, NULL, CFSTRING },
902 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
903 { COMMENT_PRIVATE, "--- " KEY_PREFIX NETPROP SERVICE PRIMARYRANK " values ---", NULL, NULL, NULL },
904 { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, FIRST, NULL },
905 { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, LAST, NULL },
906 { SC_10_6_IPHONE_2_0_PRIVATE, NETVAL SERVICE PRIMARYRANK, NEVER, NULL },
907 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
908
909 { GROUP, NETPROP SMB, KEY_PREFIX NETENT SMB " Entity Keys", NULL, NULL },
910
911 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
912 { SC_10_5, NETPROP SMB, NETBIOS NAME, NULL, CFSTRING },
913 { SC_10_5, NETPROP SMB, NETBIOS NODE TYPE, NULL, CFSTRING },
914 { SC_10_5, NETPROP SMB, NETBIOS SCOPE, NULL, CFSTRING },
915 { SC_10_5, NETPROP SMB, WINS ADDRESSES, NULL, CFARRAY_CFSTRING },
916 { SC_10_5, NETPROP SMB, WORKGROUP, NULL, CFSTRING },
917 { COMMENT, "", NULL, NULL, NULL },
918 { COMMENT, "--- " KEY_PREFIX NETPROP SMB NETBIOS NODE TYPE " values ---", NULL, NULL, NULL },
919 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, BROADCAST, NULL },
920 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, PEER, NULL },
921 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, MIXED, NULL },
922 { SC_10_5, NETVAL SMB NETBIOS NODE TYPE, HYBRID, NULL },
923 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
924 { COMMENT, "", NULL, NULL, NULL },
925
926 { GROUP, USERSENT CONSOLEUSER, KEY_PREFIX COMP USERS " Entity Keys", NULL, NULL },
927
928 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
929 { SC_10_1, USERSENT, CONSOLEUSER, NULL, NULL },
930 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
931 { COMMENT, "", NULL, NULL, NULL },
932
933 { GROUP, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },
934
935 { SC_10_1, SYSTEMPROP, COMPUTERNAME, NULL, CFSTRING },
936 { SC_10_1, SYSTEMPROP, COMPUTERNAME ENCODING, NULL, CFNUMBER },
937 { COMMENT, "", NULL, NULL, NULL },
938
939 { GROUP_PRIVATE, SYSTEMPROP COMPUTERNAME, KEY_PREFIX COMP SYSTEM " Properties", NULL, NULL },
940
941 { SC_10_5_PRIVATE, SYSTEMPROP, COMPUTERNAME REGION, NULL, CFNUMBER },
942 { SC_10_5_PRIVATE, SYSTEMPROP, HOSTNAME, NULL, CFSTRING },
943 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
944
945 { GROUP, DYNAMICSTORE DOMAIN, "SCDynamicStore \"domain\" prefixes", NULL, NULL },
946
947 { SC_10_1, DYNAMICSTORE DOMAIN, FILE, "File:", NULL },
948 { SC_10_1, DYNAMICSTORE DOMAIN, PLUGIN, "Plugin:", NULL },
949 { SC_10_1, DYNAMICSTORE DOMAIN, SETUP, "Setup:", NULL },
950 { SC_10_1, DYNAMICSTORE DOMAIN, STATE, "State:", NULL },
951 { SC_10_1, DYNAMICSTORE DOMAIN, PREFS, "Prefs:", NULL },
952 { COMMENT, "", NULL, NULL, NULL },
953
954 { GROUP, DYNAMICSTORE SETUPPROP, "Preference (\"location\") Keys", NULL, NULL },
955
956 { SC_10_1, DYNAMICSTORE SETUPPROP, CURRENTSET, NULL, CFSTRING },
957 { SC_10_1, DYNAMICSTORE SETUPPROP, LAST UPDATED, NULL, NULL },
958 { COMMENT, "", NULL, NULL, NULL },
959
960 { GROUP, DYNAMICSTORE NETPROP, "Common/shared Keys", NULL, NULL },
961
962 { SC_10_1, DYNAMICSTORE NETPROP, INTERFACES, NULL, CFARRAY_CFSTRING },
963 { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYINTERFACE, NULL, CFSTRING },
964 { SC_10_1, DYNAMICSTORE NETPROP, PRIMARYSERVICE, NULL, CFSTRING },
965 { SC_10_1, DYNAMICSTORE NETPROP, SERVICEIDS, NULL, CFARRAY_CFSTRING },
966 // { COMMENT, "", NULL, NULL, NULL },
967
968 { GROUP_PRIVATE, VIRTUALNETWORKINTERFACES, "Virtual Network Interface Keys", NULL, NULL },
969
970 { DEFINE_PRIVATE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
971 { SC_10_5_PRIVATE, VIRTUALPROP BOND, INTERFACES, NULL, CFARRAY_CFSTRING },
972 { SC_10_5_PRIVATE, VIRTUALPROP BOND, MODE, NULL, CFNUMBER },
973 { SC_10_5_PRIVATE, VIRTUALPROP BOND, OPTIONS, NULL, CFDICTIONARY },
974 { COMMENT_PRIVATE, "", NULL, NULL, NULL },
975 { SC_10_5_PRIVATE, VIRTUALPROP VLAN, INTERFACE, NULL, CFSTRING },
976 { SC_10_5_PRIVATE, VIRTUALPROP VLAN, TAG, NULL, CFNUMBER },
977 { SC_10_5_PRIVATE, VIRTUALPROP VLAN, OPTIONS, NULL, CFDICTIONARY },
978 { DEFINE_PRIVATE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
979 // { COMMENT_PRIVATE, "", NULL, NULL, NULL },
980
981 //{ GROUP, "DEPRECATED", "Deprecated schema definition keys", NULL, NULL },
982
983 { DEFINE, "#if", "!TARGET_OS_IPHONE", NULL, NULL },
984 { SC_10_1_10_4, USERSPROP CONSOLEUSER, NAME, NULL, CFSTRING },
985 { SC_10_1_10_4, USERSPROP CONSOLEUSER, UID, NULL, CFNUMBER },
986 { SC_10_1_10_4, USERSPROP CONSOLEUSER, GID, NULL, CFNUMBER },
987 { DEFINE, "#endif", "// !TARGET_OS_IPHONE", NULL, NULL },
988 // { COMMENT, "", NULL, NULL, NULL },
989
990 { END, NULL, NULL, NULL, NULL },
991 };
992
993 static int maxkbuf = 0;
994 static char *maxkstr = NULL;
995 static int maxvbuf = 0;
996 static char *maxvstr = NULL;
997
998 static inline void
999 setmax(int *max, char **maxstr, char *str)
1000 {
1001 int l;
1002
1003 l = strlen(str);
1004 if (l > *max) {
1005 if (*maxstr) free(*maxstr);
1006 *maxstr = strdup(str);
1007 *max = l;
1008 }
1009 return;
1010 }
1011
1012 enum {
1013 gen_header_e,
1014 gen_comments_e,
1015 gen_comments_private_e,
1016 gen_headerdoc_e,
1017 gen_headerdoc_private_e,
1018 gen_hfile_e,
1019 gen_hfile_private_e,
1020 gen_cfile_e,
1021 };
1022
1023 void
1024 print_comment(schemaDefinition *def)
1025 {
1026 char kbuf[256];
1027 char vbuf[256];
1028
1029 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1030 def->prefix, def->key);
1031 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
1032 def->value ? def->value : def->key);
1033
1034 if (def->type)
1035 printf(" * %-50s %-30s %s\n",
1036 kbuf, vbuf, def->type);
1037 else
1038 printf(" * %-50s %s\n",
1039 kbuf, vbuf);
1040
1041 return;
1042 }
1043
1044 void
1045 print_define(schemaDefinition *def)
1046 {
1047 printf("%s %s\n", def->prefix, def->key);
1048 return;
1049 }
1050
1051 void
1052 print_headerdoc(schemaDefinition *def)
1053 {
1054 char kbuf[256];
1055 char vbuf[256];
1056
1057 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1058 def->prefix, def->key);
1059 setmax(&maxkbuf, &maxkstr, kbuf);
1060
1061 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
1062 def->value ? def->value : def->key);
1063 setmax(&maxvbuf, &maxvstr, vbuf);
1064
1065 printf("\n");
1066
1067 printf("/*!\n");
1068 printf(" @const %s\n", kbuf);
1069 switch (def->control) {
1070 case SC_10_1:
1071 printf(" @availability Introduced in Mac OS X 10.1.\n");
1072 break;
1073 case SC_10_2:
1074 printf(" @availability Introduced in Mac OS X 10.2.\n");
1075 break;
1076 case SC_10_3:
1077 printf(" @availability Introduced in Mac OS X 10.3.\n");
1078 break;
1079 case SC_10_1_10_4:
1080 printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.4.\n");
1081 break;
1082 case SC_10_4:
1083 printf(" @availability Introduced in Mac OS X 10.4.\n");
1084 break;
1085 case SC_10_1_10_5:
1086 printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.5.\n");
1087 break;
1088 case SC_10_5:
1089 case SC_10_5_PRIVATE:
1090 printf(" @availability Introduced in Mac OS X 10.5.\n");
1091 break;
1092 case SC_10_1_10_6:
1093 printf(" @availability Introduced in Mac OS X 10.1, but later deprecated in Mac OS X 10.6.\n");
1094 break;
1095 case SC_10_2_10_6:
1096 printf(" @availability Introduced in Mac OS X 10.2, but later deprecated in Mac OS X 10.6.\n");
1097 break;
1098 case SC_10_6_IPHONE_2_0:
1099 case SC_10_6_IPHONE_2_0_PRIVATE:
1100 printf(" @availability Introduced in Mac OS X 10.6.\n");
1101 break;
1102 case SC_10_6_IPHONE_3_0:
1103 case SC_10_6_IPHONE_3_0_PRIVATE:
1104 printf(" @availability Introduced in Mac OS X 10.6.\n");
1105 break;
1106 case SC_IPHONE_2_0_PRIVATE:
1107 printf(" @availability Introduced in iPhone OS 2.0.\n");
1108 break;
1109 }
1110 printf(" */\n");
1111 printf("extern const CFStringRef %s;\n", kbuf);
1112
1113 return;
1114 }
1115
1116 void
1117 print_hfile(schemaDefinition *def)
1118 {
1119 char kbuf[256];
1120 char vbuf[256];
1121
1122 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1123 def->prefix, def->key);
1124 setmax(&maxkbuf, &maxkstr, kbuf);
1125
1126 snprintf(vbuf, sizeof(vbuf), "\"%s\"",
1127 def->value ? def->value : def->key);
1128 setmax(&maxvbuf, &maxvstr, vbuf);
1129
1130 printf("\n");
1131
1132 switch (def->control) {
1133 case SC_10_1:
1134 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_2_0/*SPI*/))\n", kbuf);
1135 break;
1136 case SC_10_2:
1137 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0/*SPI*/))\n", kbuf);
1138 break;
1139 case SC_10_3:
1140 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_2_0/*SPI*/))\n", kbuf);
1141 break;
1142 case SC_10_1_10_4:
1143 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
1144 break;
1145 case SC_10_4:
1146 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0/*SPI*/))\n", kbuf);
1147 break;
1148 case SC_10_1_10_5:
1149 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
1150 break;
1151 case SC_10_5:
1152 case SC_10_5_PRIVATE:
1153 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_2_0/*SPI*/))\n", kbuf);
1154 break;
1155 case SC_10_1_10_6:
1156 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
1157 break;
1158 case SC_10_2_10_6:
1159 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_2,__MAC_10_6,__IPHONE_NA,__IPHONE_NA))\n", kbuf);
1160 break;
1161 case SC_10_6_IPHONE_2_0:
1162 case SC_10_6_IPHONE_2_0_PRIVATE:
1163 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_2_0/*SPI*/))\n", kbuf);
1164 break;
1165 case SC_10_6_IPHONE_3_0:
1166 case SC_10_6_IPHONE_3_0_PRIVATE:
1167 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_0/*SPI*/))\n", kbuf);
1168 break;
1169 case SC_IPHONE_2_0_PRIVATE:
1170 printf(" " SC_SCHEMA_DECLARATION "(%s, __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_0/*SPI*/))\n", kbuf);
1171 break;
1172 default:
1173 printf(" " SC_SCHEMA_DECLARATION "(%s,)\n", kbuf);
1174 break;
1175 }
1176
1177 switch (def->control) {
1178 case SC_10_1:
1179 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1180 break;
1181 case SC_10_2:
1182 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1183 break;
1184 case SC_10_3:
1185 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1186 break;
1187 case SC_10_1_10_4:
1188 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)\n");
1189 break;
1190 case SC_10_4:
1191 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1040) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1192 break;
1193 case SC_10_1_10_5:
1194 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)\n");
1195 break;
1196 case SC_10_5:
1197 case SC_10_5_PRIVATE:
1198 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1199 break;
1200 case SC_10_1_10_6:
1201 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010)\n");
1202 break;
1203 case SC_10_2_10_6:
1204 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)\n");
1205 break;
1206 case SC_10_6_IPHONE_2_0:
1207 case SC_10_6_IPHONE_2_0_PRIVATE:
1208 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1209 break;
1210 case SC_10_6_IPHONE_3_0:
1211 case SC_10_6_IPHONE_3_0_PRIVATE:
1212 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) || (__IPHONE_OS_VERSION_MIN_REQUIRED >= 30000)/*SPI*/\n");
1213 break;
1214 case SC_IPHONE_2_0_PRIVATE:
1215 printf("#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 20000)/*SPI*/\n");
1216 break;
1217 }
1218
1219 printf(" #define %-48s \\\n",
1220 kbuf);
1221 printf(" " SC_SCHEMA_KV "(%-48s \\\n",
1222 kbuf);
1223 printf(" ,%-48s \\\n",
1224 vbuf);
1225 printf(" ,%-48s )\n",
1226 def->type ? def->type : "");
1227
1228 switch (def->control) {
1229 case SC_10_1:
1230 case SC_10_2:
1231 case SC_10_3:
1232 case SC_10_1_10_4:
1233 case SC_10_4:
1234 case SC_10_1_10_5:
1235 case SC_10_5:
1236 case SC_10_5_PRIVATE:
1237 case SC_10_1_10_6:
1238 case SC_10_2_10_6:
1239 case SC_10_6_IPHONE_2_0:
1240 case SC_10_6_IPHONE_3_0:
1241 case SC_10_6_IPHONE_2_0_PRIVATE:
1242 case SC_10_6_IPHONE_3_0_PRIVATE:
1243 case SC_IPHONE_2_0_PRIVATE:
1244 printf("#endif\n");
1245 break;
1246 }
1247
1248 return;
1249 }
1250
1251 void
1252 dump_names(int type)
1253 {
1254 int i;
1255
1256 for (i = 0; TRUE; i++) {
1257 switch (names[i].control) {
1258 case END: {
1259 goto done;
1260 }
1261
1262 case COMMENT: {
1263 switch (type) {
1264 case gen_comments_e:
1265 if (names[i].prefix)
1266 if (strlen(names[i].prefix) > 0)
1267 printf(" * %s\n", names[i].prefix);
1268 else
1269 printf(" *\n");
1270 break;
1271 default:
1272 break;
1273 }
1274 break;
1275 }
1276
1277 case COMMENT_PRIVATE: {
1278 switch (type) {
1279 case gen_comments_private_e:
1280 if (names[i].prefix)
1281 if (strlen(names[i].prefix) > 0)
1282 printf(" * %s\n", names[i].prefix);
1283 else
1284 printf(" *\n");
1285 break;
1286 default:
1287 break;
1288 }
1289 break;
1290 }
1291
1292 case COMMENT_DEPRECATED: {
1293 break;
1294 }
1295
1296 case DEFINE: {
1297 switch (type) {
1298 case gen_hfile_e:
1299 printf("\n");
1300 print_define(&names[i]);
1301 break;
1302 case gen_cfile_e:
1303 if ((strcmp(names[i].prefix, "#if") == 0) ||
1304 (strcmp(names[i].prefix, "#ifdef") == 0) ||
1305 (strcmp(names[i].prefix, "#ifndef") == 0))
1306 printf("\n");
1307 print_define(&names[i]);
1308 if (strcmp(names[i].prefix, "#endif") == 0)
1309 printf("\n");
1310 break;
1311 default:
1312 break;
1313 }
1314 break;
1315 }
1316
1317 case DEFINE_PRIVATE: {
1318 switch (type) {
1319 case gen_hfile_private_e:
1320 printf("\n");
1321 print_define(&names[i]);
1322 break;
1323 case gen_cfile_e:
1324 if ((strcmp(names[i].prefix, "#if") == 0) ||
1325 (strcmp(names[i].prefix, "#ifdef") == 0) ||
1326 (strcmp(names[i].prefix, "#ifndef") == 0))
1327 printf("\n");
1328 print_define(&names[i]);
1329 if (strcmp(names[i].prefix, "#endif") == 0)
1330 printf("\n");
1331 break;
1332 default:
1333 break;
1334 }
1335 break;
1336 }
1337
1338 case GROUP:
1339 case GROUP_DEPRECATED: {
1340 switch (type) {
1341 case gen_comments_e:
1342 if (names[i].control == GROUP) {
1343 if (names[i].key)
1344 printf(" * %s\n *\n", names[i].key);
1345 }
1346 break;
1347 case gen_headerdoc_e:
1348 if (names[i].prefix)
1349 printf("\n/*!\n @group %s\n */\n", names[i].key);
1350 break;
1351 default:
1352 break;
1353 }
1354 break;
1355 }
1356
1357 case GROUP_PRIVATE: {
1358 switch (type) {
1359 case gen_comments_private_e:
1360 if (names[i].key)
1361 printf(" * %s\n *\n", names[i].key);
1362 break;
1363 case gen_headerdoc_private_e:
1364 if (names[i].prefix)
1365 printf("\n/*!\n @group %s\n */\n", names[i].key);
1366 break;
1367 default:
1368 break;
1369 }
1370 break;
1371 }
1372
1373 default: {
1374 char kbuf[256];
1375 char vbuf[256];
1376
1377 switch (type) {
1378 case gen_header_e:
1379 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1380 names[i].prefix, names[i].key);
1381
1382 if (names[i].value)
1383 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
1384 names[i].value);
1385 else
1386 snprintf(vbuf, sizeof(vbuf), "SCSTR(\"%s\")",
1387 names[i].key);
1388
1389 printf("#define %-50s %s\n",
1390 kbuf, vbuf);
1391 break;
1392
1393 case gen_comments_e:
1394 switch (names[i].control) {
1395 case SC_10_1_10_4:
1396 case SC_10_1_10_5:
1397 case SC_10_1_10_6:
1398 case SC_10_2_10_6:
1399 // don't report deprecated keys
1400 break;
1401 case SC_10_5_PRIVATE:
1402 case SC_10_6_IPHONE_2_0_PRIVATE:
1403 case SC_10_6_IPHONE_3_0_PRIVATE:
1404 case SC_IPHONE_2_0_PRIVATE:
1405 // don't report private definitions
1406 break;
1407 default:
1408 print_comment(&names[i]);
1409 break;
1410 }
1411 break;
1412 case gen_comments_private_e:
1413 switch (names[i].control) {
1414 case SC_10_1_10_4:
1415 case SC_10_1_10_5:
1416 case SC_10_1_10_6:
1417 case SC_10_2_10_6:
1418 // don't report deprecated keys
1419 break;
1420 case SC_10_5_PRIVATE:
1421 case SC_10_6_IPHONE_2_0_PRIVATE:
1422 case SC_10_6_IPHONE_3_0_PRIVATE:
1423 case SC_IPHONE_2_0_PRIVATE:
1424 print_comment(&names[i]);
1425 break;
1426 default:
1427 // don't report public definitions
1428 break;
1429 }
1430 break;
1431
1432 case gen_headerdoc_e:
1433 switch (names[i].control) {
1434 case SC_10_5_PRIVATE:
1435 case SC_10_6_IPHONE_2_0_PRIVATE:
1436 case SC_10_6_IPHONE_3_0_PRIVATE:
1437 case SC_IPHONE_2_0_PRIVATE:
1438 // don't report private definitions
1439 break;
1440 default:
1441 print_headerdoc(&names[i]);
1442 break;
1443 }
1444 break;
1445 case gen_headerdoc_private_e:
1446 switch (names[i].control) {
1447 case SC_10_5_PRIVATE:
1448 case SC_10_6_IPHONE_2_0_PRIVATE:
1449 case SC_10_6_IPHONE_3_0_PRIVATE:
1450 case SC_IPHONE_2_0_PRIVATE:
1451 print_headerdoc(&names[i]);
1452 break;
1453 default:
1454 // don't report public definitions
1455 break;
1456 }
1457 break;
1458
1459 case gen_hfile_e:
1460 switch (names[i].control) {
1461 case SC_10_5_PRIVATE:
1462 case SC_10_6_IPHONE_2_0_PRIVATE:
1463 case SC_10_6_IPHONE_3_0_PRIVATE:
1464 case SC_IPHONE_2_0_PRIVATE:
1465 break;
1466 // don't report private definitions
1467 default:
1468 print_hfile(&names[i]);
1469 break;
1470 }
1471 break;
1472 case gen_hfile_private_e:
1473 switch (names[i].control) {
1474 case SC_10_5_PRIVATE:
1475 case SC_10_6_IPHONE_2_0_PRIVATE:
1476 case SC_10_6_IPHONE_3_0_PRIVATE:
1477 case SC_IPHONE_2_0_PRIVATE:
1478 print_hfile(&names[i]);
1479 break;
1480 default:
1481 // don't report public definitions
1482 break;
1483 }
1484 break;
1485
1486 case gen_cfile_e:
1487 snprintf(kbuf, sizeof(kbuf), KEY_PREFIX "%s%s",
1488 names[i].prefix, names[i].key);
1489
1490 if (names[i].value)
1491 printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
1492 kbuf, names[i].value);
1493 else
1494 printf("const CFStringRef %-48s = CFSTR(\"%s\");\n",
1495 kbuf, names[i].key);
1496 break;
1497 default:
1498 break;
1499 }
1500 break;
1501 }
1502 }
1503 }
1504 done:
1505 switch (type) {
1506 case gen_hfile_e:
1507 fprintf(stderr, "max key: length = %2d, string = %s\n", maxkbuf, maxkstr);
1508 fprintf(stderr, "max val: length = %2d, string = %s\n", maxvbuf, maxvstr);
1509 break;
1510 }
1511 return;
1512 }
1513
1514 int
1515 main(int argc, char * argv[])
1516 {
1517 char * type = "";
1518
1519 if (argc >= 2)
1520 type = argv[1];
1521
1522 if (strcmp(type, "header") == 0) {
1523 printf("%s\n", copyright_string);
1524 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1525
1526 printf("/*\n");
1527 dump_names(gen_comments_e);
1528 printf(" */\n\n\n");
1529
1530 printf("/*\n");
1531 printf(" * Note: The MACOSX_DEPLOYMENT_TARGET environment variable should be used\n");
1532 printf(" * when building an application targeted for an earlier version of\n");
1533 printf(" * Mac OS X. Please reference Technical Note TN2064 for more details.\n");
1534 printf(" */\n\n");
1535
1536 printf("/*\n");
1537 printf(" * Note: For Cocoa/Obj-C/Foundation applications accessing these preference\n");
1538 printf(" * keys you may want to consider the following :\n");
1539 printf(" *\n");
1540 printf(" * #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k;\n");
1541 printf(" * #import <SystemConfiguration/SystemConfiguration.h>\n");
1542 printf(" */\n\n");
1543
1544 printf("/*\n");
1545 printf(" * Note: For CFM applications using these schema keys you may want to\n");
1546 printf(" * consider the following :\n");
1547 printf(" *\n");
1548 printf(" * #define " SC_SCHEMA_DECLARATION "(k,q)\n");
1549 printf(" * #define " SC_SCHEMA_KV "(k,v,t)\tlookup_SC_key( CFSTR( #k ) )\n");
1550 printf(" * #include <SystemConfiguration/SystemConfiguration.h>\n");
1551 printf(" *\n");
1552 printf(" * CFStringRef lookup_SC_key(CFStringRef key)\n");
1553 printf(" * {\n");
1554 printf(" * // this function should [dynamically, on-demand] load the\n");
1555 printf(" * // SystemConfiguration.framework, look up the provided key,\n");
1556 printf(" * // and return the associated value.\n");
1557 printf(" * }\n");
1558 printf(" */\n\n");
1559
1560 printf("/*\n");
1561 printf(" * Note: Earlier versions of this header file defined a \"SCSTR\" macro\n");
1562 printf(" * which helped to facilitate Obj-C development. Use of this macro\n");
1563 printf(" * has been deprecated (in Mac OS X 10.4) in favor of the newer\n");
1564 printf(" * \"" SC_SCHEMA_DECLARATION "\" and \"" SC_SCHEMA_KV "\" macros\n");
1565 printf(" */\n\n\n");
1566
1567 printf("#ifndef\t_SCSCHEMADEFINITIONS_H\n");
1568 printf("#ifdef\tUSE_SYSTEMCONFIGURATION_PRIVATE_HEADERS\n");
1569 printf("#include <SystemConfiguration/_SCSchemaDefinitions.h>\n");
1570 printf("#else\t/* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */\n");
1571 printf("#define\t_SCSCHEMADEFINITIONS_H\n");
1572 printf("\n");
1573
1574 printf("/* -------------------- Macro declarations -------------------- */\n\n");
1575
1576 printf("#include <Availability.h>\n");
1577 printf("#include <TargetConditionals.h>\n");
1578 printf("\n");
1579
1580 printf("/*\n");
1581 printf(" * let's \"do the right thing\" for those wishing to build for\n");
1582 printf(" * Mac OS X 10.1.0 ... 10.2.x\n");
1583 printf(" */\n");
1584
1585 printf("#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED <= 1020) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)\n");
1586 printf(" #ifndef SCSTR\n");
1587 printf(" #include <CoreFoundation/CFString.h>\n");
1588 printf(" #define SCSTR(s) CFSTR(s)\n");
1589 printf(" #endif\n");
1590 printf(" #ifndef " SC_SCHEMA_DECLARATION "\n");
1591 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
1592 printf(" #endif\n");
1593 printf(" #ifndef " SC_SCHEMA_KV "\n");
1594 printf(" #define " SC_SCHEMA_KV "(k,v,t)\tSCSTR( v )\n");
1595 printf(" #endif\n");
1596 printf("#endif\n\n");
1597
1598 printf("/*\n");
1599 printf(" * Define a schema key/value/type tuple\n");
1600 printf(" */\n");
1601 printf("#ifndef " SC_SCHEMA_KV "\n");
1602 printf(" #define " SC_SCHEMA_KV "(k,v,t)\tk\n");
1603 printf("#endif\n\n");
1604
1605 printf("/*\n");
1606 printf(" * Provide an \"extern\" for the key/value\n");
1607 printf(" */\n");
1608 printf("#ifndef " SC_SCHEMA_DECLARATION "\n");
1609 printf(" #ifndef SCSTR\n");
1610 printf(" #include <CoreFoundation/CFString.h>\n");
1611 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern const CFStringRef k q;\n");
1612 printf(" #else\n");
1613 printf(" #import <Foundation/NSString.h>\n");
1614 printf(" #define " SC_SCHEMA_DECLARATION "(k,q)\textern NSString * k q;\n");
1615 printf(" #endif\n");
1616 printf("#endif\n");
1617
1618 // The SCSTR() macro should only be availble for Mac OS X 10.1.0 ... 10.4.x
1619 printf("#if (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1010) && (__MAC_OS_X_VERSION_MAX_ALLOWED <= 1040) && !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)\n");
1620 printf(" #ifndef SCSTR\n");
1621 printf(" #include <CoreFoundation/CFString.h>\n");
1622 printf(" #define SCSTR(s) CFSTR(s)\n");
1623 printf(" #endif\n");
1624 printf("#endif\n\n\n");
1625
1626 printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
1627 printf("#if\t0\n");
1628 printf("/*!\n");
1629 printf(" *\t@header SCSchemaDefinitions\n");
1630 printf(" */\n");
1631 dump_names(gen_headerdoc_e);
1632 printf("\n");
1633 printf("#endif\t/* 0 */\n\n\n");
1634
1635 printf("/* -------------------- Schema declarations -------------------- */\n\n");
1636 dump_names(gen_hfile_e);
1637 printf("\n");
1638
1639 printf("#endif\t/* USE_SYSTEMCONFIGURATION_PRIVATE_HEADERS */\n");
1640 printf("#endif\t/* _SCSCHEMADEFINITIONS_H */\n");
1641 }
1642 else if (strcmp(type, "private") == 0) {
1643 printf("%s\n", copyright_string);
1644 printf("/*\n * This file is automatically generated\n * DO NOT EDIT!\n */\n\n");
1645
1646 printf("/*\n");
1647 dump_names(gen_comments_private_e);
1648 printf(" */\n\n\n");
1649
1650 printf("#ifndef _SCSCHEMADEFINITIONSPRIVATE_H\n");
1651 printf("#define _SCSCHEMADEFINITIONSPRIVATE_H\n");
1652 printf("\n");
1653
1654 printf("/* -------------------- Macro declarations -------------------- */\n\n");
1655
1656 printf("#include <SystemConfiguration/SCSchemaDefinitions.h>\n\n");
1657
1658 printf("/* -------------------- HeaderDoc comments -------------------- */\n\n\n");
1659 printf("#if\t0\n");
1660 printf("/*!\n");
1661 printf(" *\t@header SCSchemaDefinitionsPrivate\n");
1662 printf(" */\n");
1663 dump_names(gen_headerdoc_private_e);
1664 printf("\n");
1665 printf("#endif\t/* 0 */\n\n\n");
1666
1667 printf("/* -------------------- Schema declarations -------------------- */\n\n");
1668 dump_names(gen_hfile_private_e);
1669 printf("\n");
1670
1671 printf("#endif /* _SCSCHEMADEFINITIONSPRIVATE_H */\n");
1672 }
1673 else if (strcmp(type, "cfile") == 0) {
1674 printf("/*\n");
1675 printf(" * This file is automatically generated\n");
1676 printf(" * DO NOT EDIT!\n");
1677 printf(" */\n");
1678 printf("\n");
1679 printf("#include <Availability.h>\n");
1680 printf("#include <TargetConditionals.h>\n");
1681 printf("#include <CoreFoundation/CFString.h>\n");
1682 printf("\n");
1683 dump_names(gen_cfile_e);
1684 }
1685 exit(0);
1686 return (0);
1687 }
1688