]>
git.saurik.com Git - apple/configd.git/blob - Plugins/IPMonitor/serviceIDNumber.h
2 * Copyright (c) 2019 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@
26 * - assigns numbers to serviceID strings
29 #ifndef _SERVICEID_NUMBER_H
30 #define _SERVICEID_NUMBER_H
32 #include <CoreFoundation/CFString.h>
33 #include <sys/types.h>
36 * Type: serviceIDNumber
38 * A compact way to represent a serviceID that doesn't involve needing
39 * to worry about memory allocation or large comparisions.
41 typedef u_long serviceIDNumber
, *serviceIDNumberRef
;
44 * Const: kserviceIDNumberZero
47 * The zero value for serviceIDNumber. It will never be returned,
48 * it is a reserved value.
50 #define kserviceIDNumberZero (serviceIDNumber)(0)
53 * Function: serviceIDNumberGetIfPresent
56 * Returns TRUE and the serviceIDNumber for the given serviceID, if it
57 * is present, FALSE otherwise.
60 serviceIDNumberGetIfPresent(CFStringRef serviceID
, serviceIDNumberRef sidn
);
63 * Function: serviceIDNumberGet
66 * Returns a unique serviceIDNumber for the given serviceID.
69 serviceIDNumberGet(CFStringRef serviceID
);
72 * Function: serviceIDNumberRemove
75 * Removes the assigned serviceIDNumber for the given serviceID.
78 serviceIDNumberRemove(CFStringRef serviceID
);
82 * Function: serviceIDNumberInit
85 * Initialize the serviceID number database.
88 serviceIDNumberInit(void);
90 #endif /* _SERVICEID_NUMBER_H */