Something went wrong. Try again.
Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
5.2 kB · 249 lines
C
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250/* * Copyright (c) 2001, 2004, 2005, 2010, 2015 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */
/* * Modification History * * October 29, 2001 Allan Nathanson <ajn@apple.com> * - initial revision */
#include <SystemConfiguration/SystemConfiguration.h>
#include <stdarg.h>
CFStringRefSCPreferencesPathKeyCreate(CFAllocatorRef allocator, CFStringRef fmt, ...){ va_list args; CFStringRef result;
va_start(args, fmt); result = CFStringCreateWithFormatAndArguments(allocator, NULL, fmt, args); va_end(args);
return result;}
CFStringRefSCPreferencesPathKeyCreateNetworkServices(CFAllocatorRef allocator){ /* * create "/NetworkServices" */ return CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@"), kSCPrefNetworkServices);}
CFStringRefSCPreferencesPathKeyCreateNetworkServiceEntity(CFAllocatorRef allocator, CFStringRef service, CFStringRef entity){ CFStringRef path;
if (entity == NULL) { /* * create "/NetworkServices/service-id" */ path = CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@"), kSCPrefNetworkServices, service); } else { /* * create "/NetworkServices/service-id/entity" */ path = CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@"), kSCPrefNetworkServices, service, entity); }
return path;}
CFStringRefSCPreferencesPathKeyCreateSets(CFAllocatorRef allocator){ /* * create "/Sets" */ return (CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@"), kSCPrefSets));}
CFStringRefSCPreferencesPathKeyCreateSet(CFAllocatorRef allocator, CFStringRef set){ /* * create "/Sets/set-id" */ return (CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@"), kSCPrefSets, set));}
CFStringRefSCPreferencesPathKeyCreateSetNetworkGlobalEntity(CFAllocatorRef allocator, CFStringRef set, CFStringRef entity){ /* * create "/Sets/set-id/Network/Global/entity" */ return CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompGlobal, entity);}
CFStringRefSCPreferencesPathKeyCreateSetNetworkInterfaceEntity(CFAllocatorRef allocator, CFStringRef set, CFStringRef ifname, CFStringRef entity){ /* * create "/Sets/set-id/Network/Interface/interface-name/entity" */ if (entity == NULL) { return CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompInterface, ifname); } return CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompInterface, ifname, entity);}
CFStringRefSCPreferencesPathKeyCreateSetNetworkService(CFAllocatorRef allocator, CFStringRef set, CFStringRef service){ CFStringRef path;
if (service == NULL) { /* * create "/Sets/set-id/Network/Service" */ path = CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompService); } else { /* * create "/Sets/set-id/Network/Service/service-id" */ path = CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompService, service); }
return path;}
CFStringRefSCPreferencesPathKeyCreateSetNetworkServiceEntity(CFAllocatorRef allocator, CFStringRef set, CFStringRef service, CFStringRef entity){ CFStringRef path;
if (entity == NULL) { /* * create "/Sets/set-id/Network/Service/service-id" */ path = CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompService, service); } else { /* * create "/Sets/set-id/Network/Service/service-id/entity" */ path = CFStringCreateWithFormat(allocator, NULL, CFSTR("/%@/%@/%@/%@/%@/%@"), kSCPrefSets, set, kSCCompNetwork, kSCCompService, service, entity); }
return path;}