]>
git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCValidation.h
2 * Copyright (c) 2001, 2002, 2005 Apple Computer, 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 #ifndef _SCVALIDATION_H
25 #define _SCVALIDATION_H
27 #include <sys/cdefs.h>
28 #include <CoreFoundation/CoreFoundation.h>
32 static __inline__ CFTypeRef
33 isA_CFType(CFTypeRef obj
, CFTypeID type
)
38 if (CFGetTypeID(obj
) != type
)
44 static __inline__ CFTypeRef
45 isA_CFArray(CFTypeRef obj
)
47 return (isA_CFType(obj
, CFArrayGetTypeID()));
50 static __inline__ CFTypeRef
51 isA_CFBoolean(CFTypeRef obj
)
53 return (isA_CFType(obj
, CFBooleanGetTypeID()));
56 static __inline__ CFTypeRef
57 isA_CFData(CFTypeRef obj
)
59 return (isA_CFType(obj
, CFDataGetTypeID()));
62 static __inline__ CFTypeRef
63 isA_CFDate(CFTypeRef obj
)
65 return (isA_CFType(obj
, CFDateGetTypeID()));
68 static __inline__ CFTypeRef
69 isA_CFDictionary(CFTypeRef obj
)
71 return (isA_CFType(obj
, CFDictionaryGetTypeID()));
74 static __inline__ CFTypeRef
75 isA_CFNumber(CFTypeRef obj
)
77 return (isA_CFType(obj
, CFNumberGetTypeID()));
80 static __inline__ CFTypeRef
81 isA_CFPropertyList(CFTypeRef obj
)
88 type
= CFGetTypeID(obj
);
89 if (type
== CFArrayGetTypeID() ||
90 type
== CFBooleanGetTypeID() ||
91 type
== CFDataGetTypeID() ||
92 type
== CFDateGetTypeID() ||
93 type
== CFDictionaryGetTypeID() ||
94 type
== CFNumberGetTypeID() ||
95 type
== CFStringGetTypeID())
102 static __inline__ CFTypeRef
103 isA_CFString(CFTypeRef obj
)
105 return (isA_CFType(obj
, CFStringGetTypeID()));
110 _SC_stringIsValidDNSName (const char *name
);
114 _SC_CFStringIsValidDNSName (CFStringRef name
);
118 _SC_CFStringIsValidNetBIOSName (CFStringRef name
);
123 #endif /* _SCVALIDATION_H */