1 | /*␊ |
2 | * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * ␊ |
5 | * This file contains Original Code and/or Modifications of Original Code␊ |
6 | * as defined in and that are subject to the Apple Public Source License␊ |
7 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
8 | * compliance with the License. Please obtain a copy of the License at␊ |
9 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
10 | * file.␊ |
11 | * ␊ |
12 | * The Original Code and all software distributed under the License are␊ |
13 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
16 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
17 | * Please see the License for the specific language governing rights and␊ |
18 | * limitations under the License.␊ |
19 | * ␊ |
20 | *-␊ |
21 | * Copyright (c) 1995␊ |
22 | *␉The Regents of the University of California. All rights reserved.␊ |
23 | * Portions Copyright (c) 1996, Jason Downs. All rights reserved.␊ |
24 | *␊ |
25 | * Redistribution and use in source and binary forms, with or without␊ |
26 | * modification, are permitted provided that the following conditions␊ |
27 | * are met:␊ |
28 | * 1. Redistributions of source code must retain the above copyright␊ |
29 | * notice, this list of conditions and the following disclaimer.␊ |
30 | * 2. Redistributions in binary form must reproduce the above copyright␊ |
31 | * notice, this list of conditions and the following disclaimer in the␊ |
32 | * documentation and/or other materials provided with the distribution.␊ |
33 | * 3. All advertising materials mentioning features or use of this software␊ |
34 | * must display the following acknowledgement:␊ |
35 | *␉This product includes software developed by the University of␊ |
36 | *␉California, Berkeley and its contributors.␊ |
37 | * 4. Neither the name of the University nor the names of its contributors␊ |
38 | * may be used to endorse or promote products derived from this software␊ |
39 | * without specific prior written permission.␊ |
40 | *␊ |
41 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND␊ |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE␊ |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE␊ |
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE␊ |
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL␊ |
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS␊ |
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)␊ |
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT␊ |
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY␊ |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF␊ |
51 | * SUCH DAMAGE.␊ |
52 | */␊ |
53 | ␊ |
54 | #ifndef _UTIL_H_␊ |
55 | #define _UTIL_H_␊ |
56 | ␊ |
57 | #include <sys/cdefs.h>␊ |
58 | #include <sys/types.h>␊ |
59 | ␊ |
60 | /*␊ |
61 | * fparseln() specific operation flags.␊ |
62 | */␊ |
63 | #define FPARSELN_UNESCESC␉0x01␊ |
64 | #define FPARSELN_UNESCCONT␉0x02␊ |
65 | #define FPARSELN_UNESCCOMM␉0x04␊ |
66 | #define FPARSELN_UNESCREST␉0x08␊ |
67 | #define FPARSELN_UNESCALL␉0x0f␊ |
68 | ␊ |
69 | /*␊ |
70 | * opendev() specific operation flags.␊ |
71 | */␊ |
72 | #define OPENDEV_PART␉0x01␉␉/* Try to open the raw partition. */␊ |
73 | #define OPENDEV_DRCT␉0x02␉␉/* Obsolete (now default behavior). */␊ |
74 | #define OPENDEV_BLCK␉0x04␉␉/* Open block, not character device. */␊ |
75 | ␊ |
76 | /*␊ |
77 | * uucplock(3) specific flags.␊ |
78 | */␊ |
79 | #define UU_LOCK_INUSE (1)␊ |
80 | #define UU_LOCK_OK (0)␊ |
81 | #define UU_LOCK_OPEN_ERR (-1)␊ |
82 | #define UU_LOCK_READ_ERR (-2)␊ |
83 | #define UU_LOCK_CREAT_ERR (-3)␊ |
84 | #define UU_LOCK_WRITE_ERR (-4)␊ |
85 | #define UU_LOCK_LINK_ERR (-5)␊ |
86 | #define UU_LOCK_TRY_ERR (-6)␊ |
87 | #define UU_LOCK_OWNER_ERR (-7)␊ |
88 | ␊ |
89 | /*␊ |
90 | * stub struct definitions.␊ |
91 | */␊ |
92 | struct __sFILE;␊ |
93 | struct login_cap;␊ |
94 | struct passwd;␊ |
95 | struct termios;␊ |
96 | struct winsize;␊ |
97 | ␊ |
98 | __BEGIN_DECLS␊ |
99 | char *fparseln __P((struct __sFILE *, size_t *, size_t *, const char[3], int));␊ |
100 | int␉login_tty __P((int));␊ |
101 | int␉logout __P((const char *));␊ |
102 | void␉logwtmp __P((const char *, const char *, const char *));␊ |
103 | int␉opendev __P((char *, int, int, char **));␊ |
104 | int␉pidfile __P((const char *));␊ |
105 | void␉pw_setdir __P((const char *));␊ |
106 | char *pw_file __P((const char *));␊ |
107 | int␉pw_lock __P((int retries));␊ |
108 | int␉pw_mkdb __P((char *, int));␊ |
109 | int␉pw_abort __P((void));␊ |
110 | void␉pw_init __P((void));␊ |
111 | void␉pw_edit __P((int, const char *));␊ |
112 | void␉pw_prompt __P((void));␊ |
113 | void␉pw_copy __P((int, int, struct passwd *));␊ |
114 | void␉pw_getconf __P((char *, size_t, const char *, const char *));␊ |
115 | int␉pw_scan __P((char *, struct passwd *, int *));␊ |
116 | void␉pw_error __P((const char *, int, int));␊ |
117 | int␉openpty __P((int *, int *, char *, struct termios *,␊ |
118 | ␉ struct winsize *));␊ |
119 | int␉opendisk __P((const char *path, int flags, char *buf, size_t buflen,␊ |
120 | ␉ int iscooked));␊ |
121 | pid_t␉forkpty __P((int *, char *, struct termios *, struct winsize *));␊ |
122 | int␉getmaxpartitions __P((void));␊ |
123 | int␉getrawpartition __P((void));␊ |
124 | void␉login_fbtab __P((char *, uid_t, gid_t));␊ |
125 | int␉login_check_expire __P((struct __sFILE *, struct passwd *, char *, int));␊ |
126 | char *readlabelfs __P((char *, int));␊ |
127 | const char *uu_lockerr __P((int _uu_lockresult));␊ |
128 | int uu_lock __P((const char *_ttyname)); ␊ |
129 | int␉uu_lock_txfr __P((const char *_ttyname, pid_t _pid));␊ |
130 | int uu_unlock __P((const char *_ttyname));␊ |
131 | __END_DECLS␊ |
132 | ␊ |
133 | #endif /* !_UTIL_H_ */␊ |
134 | |