Loading...
--- Libc/Libc-320/include/util.h
+++ Libc/Libc-1725.40.4/include/util.h
@@ -1,9 +1,7 @@
/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000, 2007, 2008 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
- *
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
@@ -60,13 +58,18 @@
#ifndef _UTIL_H_
#define _UTIL_H_
+#include <_bounds.h>
#include <sys/cdefs.h>
#include <sys/ttycom.h>
#include <sys/types.h>
#include <stdio.h>
#include <pwd.h>
#include <termios.h>
-#include <utmp.h>
+#include <Availability.h>
+
+_LIBC_SINGLE_BY_DEFAULT()
+#define __PTYNAMELEN 128
+#define _LIBC_PTYNAME_OR_NULL _LIBC_COUNT_OR_NULL(__PTYNAMELEN)
#define PIDLOCK_NONBLOCK 1
#define PIDLOCK_USEHOSTNAME 2
@@ -87,15 +90,21 @@
#define OPENDEV_BLCK 0x04 /* Open block, not character device. */
__BEGIN_DECLS
-void login(struct utmp *);
+#ifdef UNIFDEF_LEGACY_UTMP_APIS
+struct utmp; /* forward reference to /usr/include/utmp.h */
+void login(struct utmp *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
+#endif /* UNIFDEF_LEGACY_UTMP_APIS */
int login_tty(int);
-int logout(const char *);
-void logwtmp(const char *, const char *, const char *);
-int opendev(char *, int, int, char **);
-int openpty(int *, int *, char *, struct termios *,
- struct winsize *);
-char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
-pid_t forkpty(int *, char *, struct termios *, struct winsize *);
+#ifdef UNIFDEF_LEGACY_UTMP_APIS
+int logout(const char *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
+#endif /* UNIFDEF_LEGACY_UTMP_APIS */
+void logwtmp(const char *, const char *, const char *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_2_0,__IPHONE_2_0);
+int opendev(char *, int, int, char *_LIBC_CSTR *);
+int openpty(int *, int *, char * _LIBC_PTYNAME_OR_NULL,
+ struct termios *, struct winsize *);
+char *_LIBC_CSTR fparseln(FILE *, size_t *, size_t *, const char[3], int);
+pid_t forkpty(int *, char * _LIBC_PTYNAME_OR_NULL,
+ struct termios *, struct winsize *);
int pidlock(const char *, int, pid_t *, const char *);
int ttylock(const char *, int, pid_t *);
int ttyunlock(const char *);
@@ -103,5 +112,10 @@
struct iovec;
char *ttymsg(struct iovec *, int, const char *, int);
__END_DECLS
+#ifdef UNIFDEF_LEGACY_UTMP_APIS
+
+/* Include utmp.h last to avoid deprecation warning above */
+#include <utmp.h>
+#endif /* UNIFDEF_LEGACY_UTMP_APIS */
#endif /* !_UTIL_H_ */