/*
- * Copyright (c) 2001-2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2001, 2003-2005, 2011, 2013 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
S_get_char_array(CFArrayRef arr, CFIndex * len)
{
UInt8 * buf = NULL;
- int count = 0;
- int i;
- int real_count;
+ CFIndex count = 0;
+ CFIndex i;
+ CFIndex real_count;
if (arr) {
count = CFArrayGetCount(arr);
static void
my_CFArrayAppendUniqueValue(CFMutableArrayRef arr, CFTypeRef new)
{
- int i;
- int n = CFArrayGetCount(arr);
+ CFIndex i;
+ CFIndex n = CFArrayGetCount(arr);
for (i = 0; i < n; i++) {
CFStringRef element = CFArrayGetValueAtIndex(arr, i);
return;
}
-static __inline__ CFStringRef
+static __inline__ CF_RETURNS_RETAINED CFStringRef
S_application_path(CFStringRef applicationID)
{
return (CFStringCreateWithFormat(NULL, NULL,
{
CFDictionaryRef dhcp_dict = NULL;
CFStringRef key = NULL;
- boolean_t needs_close = FALSE;
CFDictionaryRef primary_dict = NULL;
- if (store == NULL) {
- needs_close = TRUE;
- store = SCDynamicStoreCreate(NULL,
- CFSTR("SCDynamicStoreCopyDHCPInfo"),
- NULL, NULL);
- if (store == NULL) {
- goto done;
- }
- }
-
if (serviceID == NULL) {
/* get the primary service name */
key = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
if (primary_dict) {
CFRelease(primary_dict);
}
- if (needs_close == TRUE && store != NULL) {
- CFRelease(store);
- }
return (dhcp_dict);
}
return (CFDictionaryGetValue(dhcp_dict, CFSTR("LeaseStartTime")));
}
+CFDateRef
+DHCPInfoGetLeaseExpirationTime(CFDictionaryRef dhcp_dict)
+{
+ return (CFDictionaryGetValue(dhcp_dict, CFSTR("LeaseExpirationTime")));
+}
+
#ifdef TEST_DHCPCLIENT_PREFERENCES
void
print_data(u_char * data_p, int n_bytes)
exit(0);
return(0);
}
-#endif TEST_DHCPCLIENT_PREFERENCES
+#endif // TEST_DHCPCLIENT_PREFERENCES