/*
- * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
- *
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ * @APPLE_OSREFERENCE_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.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * 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
* Please see the License for the specific language governing rights and
* limitations under the License.
*
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#include <mach/port.h>
#include <mach/message.h>
#include <mach/kern_return.h>
-#include <mach/etap_events.h>
+#include <mach/host_priv.h>
+#include <kern/kern_types.h>
+#include <kern/kalloc.h>
#include <kern/host.h>
-#include <ipc/ipc_port.h>
#include <kern/ipc_kobject.h>
+#include <ipc/ipc_port.h>
+
#include <UserNotification/UNDTypes.h>
#include <UserNotification/UNDRequest.h>
#include <UserNotification/UNDReplyServer.h>
#define UNDReply_lock_try(reply) mutex_lock_try(&(reply)->lock)
#define UNDReply_unlock(reply) mutex_unlock(&(reply)->lock)
+/* forward declarations */
+void UNDReply_deallocate(
+ UNDReplyRef reply);
+
+
void
UNDReply_deallocate(
UNDReplyRef reply)
UNDReply_unlock(reply);
ipc_port_dealloc_kernel(port);
- kfree((vm_offset_t)reply, sizeof(struct UNDReply));
+ kfree(reply, sizeof(struct UNDReply));
return;
}
CFStringRef xmlError = NULL;
CFDictionaryRef dict = NULL;
#else
- void *dict = (void *)keyRef;
+ const void *dict = (const void *)keyRef;
#endif
if (reply == UND_REPLY_NULL || !reply->inprogress)
if (reply != UND_REPLY_NULL) {
reply->self_port = ipc_port_alloc_kernel();
if (reply->self_port == IP_NULL) {
- kfree((vm_offset_t)reply, sizeof(struct UNDReply));
+ kfree(reply, sizeof(struct UNDReply));
reply = UND_REPLY_NULL;
} else {
- mutex_init(&reply->lock, ETAP_IO_UNDREPLY);
+ mutex_init(&reply->lock, 0);
reply->userLandNotificationKey = -1;
reply->inprogress = FALSE;
ipc_kobject_set(reply->self_port,
}
reply->inprogress = FALSE;
- if (ulkey = reply->userLandNotificationKey) {
+ if ((ulkey = reply->userLandNotificationKey) != 0) {
UNDServerRef UNDServer;
reply->userLandNotificationKey = 0;
kern_return_t
KUNCUserNotificationDisplayNotice(
- int timeout,
+ int noticeTimeout,
unsigned flags,
char *iconPath,
char *soundPath,
if (IP_VALID(UNDServer)) {
kern_return_t kr;
kr = UNDDisplayNoticeSimple_rpc(UNDServer,
- timeout,
+ noticeTimeout,
flags,
iconPath,
soundPath,
kern_return_t
KUNCUserNotificationDisplayAlert(
- int timeout,
+ int alertTimeout,
unsigned flags,
char *iconPath,
char *soundPath,
if (IP_VALID(UNDServer)) {
kern_return_t kr;
kr = UNDDisplayAlertSimple_rpc(UNDServer,
- timeout,
+ alertTimeout,
flags,
iconPath,
soundPath,
char *messageKey,
char *tokenString,
KUNCUserNotificationCallBack callback,
- int contextKey)
+ __unused int contextKey)
{
UNDReplyRef reply = (UNDReplyRef)id;
UNDServerRef UNDServer;
UNDReply_unlock(reply);
return KERN_INVALID_ARGUMENT;
}
- reply->inprogress == TRUE;
+ reply->inprogress = TRUE;
reply->callback = callback;
reply_port = ipc_port_make_send(reply->self_port);
UNDReply_unlock(reply);