X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/5b2abdfbf4211b6592cdd02b9507555a0ecbb04b..refs/heads/master:/include/util.h diff --git a/include/util.h b/include/util.h index 42dbdab..bbfad2b 100644 --- a/include/util.h +++ b/include/util.h @@ -1,21 +1,22 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000, 2007, 2008 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * 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. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -63,45 +64,52 @@ #include #include #include -#include +#include #define PIDLOCK_NONBLOCK 1 #define PIDLOCK_USEHOSTNAME 2 +/* + * fparseln() specific operation flags. + */ #define FPARSELN_UNESCESC 0x01 #define FPARSELN_UNESCCONT 0x02 #define FPARSELN_UNESCCOMM 0x04 #define FPARSELN_UNESCREST 0x08 #define FPARSELN_UNESCALL 0x0f +/* + * opendev() specific operation flags. + */ +#define OPENDEV_PART 0x01 /* Try to open the raw partition. */ +#define OPENDEV_BLCK 0x04 /* Open block, not character device. */ + __BEGIN_DECLS -void login __P((struct utmp *)); -int login_tty __P((int)); -int logout __P((const char *)); -void logwtmp __P((const char *, const char *, const char *)); -int pw_lock __P((int retries)); -int pw_mkdb __P((void)); -int pw_abort __P((void)); -void pw_init __P((void)); -void pw_edit __P((int notsetuid, const char *filename)); -void pw_prompt __P((void)); -void pw_copy __P((int ffd, int tfd, struct passwd *pw, - struct passwd *old_pw)); -int pw_scan __P((char *bp, struct passwd *pw, int *flags)); -void pw_error __P((const char *name, int err, int eval)); -int openpty __P((int *, int *, char *, struct termios *, - struct winsize *)); -char *fparseln __P((FILE *, size_t *, size_t *, const char[3], int)); -pid_t forkpty __P((int *, char *, struct termios *, struct winsize *)); -int getmaxpartitions __P((void)); -int getrawpartition __P((void)); -int opendisk __P((const char *, int, char *, size_t, int)); -int pidlock __P((const char *, int, pid_t *, const char *)); -int ttylock __P((const char *, int, pid_t *)); -int ttyunlock __P((const char *)); -int ttyaction __P((char *tty, char *act, char *user)); +#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); +#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 **); +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 *); +int pidlock(const char *, int, pid_t *, const char *); +int ttylock(const char *, int, pid_t *); +int ttyunlock(const char *); +int ttyaction(char *tty, char *act, char *user); struct iovec; -char *ttymsg __P((struct iovec *, int, const char *, int)); +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 +#endif /* UNIFDEF_LEGACY_UTMP_APIS */ #endif /* !_UTIL_H_ */