Blame


1 5dc21454 2023-07-14 jrmu ////**********/////**///***////
2 5dc21454 2023-07-14 jrmu /* $OpenBSD: locale.h,v 1.11 2017/09/05 03:16:13 schwarze Exp $ */
3 5dc21454 2023-07-14 jrmu /* $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $ */
4 5dc21454 2023-07-14 jrmu
5 5dc21454 2023-07-14 jrmu /*
6 5dc21454 2023-07-14 jrmu * Copyright (c) 1991 The Regents of the University of California.
7 5dc21454 2023-07-14 jrmu * All rights reserved.
8 5dc21454 2023-07-14 jrmu *
9 5dc21454 2023-07-14 jrmu * Redistribution and use in source and binary forms, with or without
10 5dc21454 2023-07-14 jrmu * modification, are permitted provided that the following conditions
11 5dc21454 2023-07-14 jrmu * are met:
12 5dc21454 2023-07-14 jrmu * 1. Redistributions of source code must retain the above copyright
13 5dc21454 2023-07-14 jrmu * notice, this list of conditions and the following disclaimer.
14 5dc21454 2023-07-14 jrmu * 2. Redistributions in binary form must reproduce the above copyright
15 5dc21454 2023-07-14 jrmu * notice, this list of conditions and the following disclaimer in the
16 5dc21454 2023-07-14 jrmu * documentation and/or other materials provided with the distribution.
17 5dc21454 2023-07-14 jrmu * 3. Neither the name of the University nor the names of its contributors
18 5dc21454 2023-07-14 jrmu * may be used to endorse or promote products derived from this software
19 5dc21454 2023-07-14 jrmu * without specific prior written permission.
20 5dc21454 2023-07-14 jrmu *
21 5dc21454 2023-07-14 jrmu * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 5dc21454 2023-07-14 jrmu * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 5dc21454 2023-07-14 jrmu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 5dc21454 2023-07-14 jrmu * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 5dc21454 2023-07-14 jrmu * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 5dc21454 2023-07-14 jrmu * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 5dc21454 2023-07-14 jrmu * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 5dc21454 2023-07-14 jrmu * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 5dc21454 2023-07-14 jrmu * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 5dc21454 2023-07-14 jrmu * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 5dc21454 2023-07-14 jrmu * SUCH DAMAGE.
32 5dc21454 2023-07-14 jrmu *
33 5dc21454 2023-07-14 jrmu * @(#)locale.h 5.2 (Berkeley) 2/24/91
34 5dc21454 2023-07-14 jrmu */
35 5dc21454 2023-07-14 jrmu
36 5dc21454 2023-07-14 jrmu #ifndef _LOCALE_H_
37 5dc21454 2023-07-14 jrmu #define _LOCALE_H_
38 5dc21454 2023-07-14 jrmu
39 5dc21454 2023-07-14 jrmu #include <sys/_null.h>
40 5dc21454 2023-07-14 jrmu
41 5dc21454 2023-07-14 jrmu struct lconv {
42 5dc21454 2023-07-14 jrmu char *decimal_point;
43 5dc21454 2023-07-14 jrmu char *thousands_sep;
44 5dc21454 2023-07-14 jrmu char *grouping;
45 5dc21454 2023-07-14 jrmu char *int_curr_symbol;
46 5dc21454 2023-07-14 jrmu char *currency_symbol;
47 5dc21454 2023-07-14 jrmu char *mon_decimal_point;
48 5dc21454 2023-07-14 jrmu char *mon_thousands_sep;
49 5dc21454 2023-07-14 jrmu char *mon_grouping;
50 5dc21454 2023-07-14 jrmu char *positive_sign;
51 5dc21454 2023-07-14 jrmu char *negative_sign;
52 5dc21454 2023-07-14 jrmu char int_frac_digits;
53 5dc21454 2023-07-14 jrmu char frac_digits;
54 5dc21454 2023-07-14 jrmu char p_cs_precedes;
55 5dc21454 2023-07-14 jrmu char p_sep_by_space;
56 5dc21454 2023-07-14 jrmu char n_cs_precedes;
57 5dc21454 2023-07-14 jrmu char n_sep_by_space;
58 5dc21454 2023-07-14 jrmu char p_sign_posn;
59 5dc21454 2023-07-14 jrmu char n_sign_posn;
60 5dc21454 2023-07-14 jrmu char int_p_cs_precedes;
61 5dc21454 2023-07-14 jrmu char int_p_sep_by_space;
62 5dc21454 2023-07-14 jrmu char int_n_cs_precedes;
63 5dc21454 2023-07-14 jrmu char int_n_sep_by_space;
64 5dc21454 2023-07-14 jrmu char int_p_sign_posn;
65 5dc21454 2023-07-14 jrmu char int_n_sign_posn;
66 5dc21454 2023-07-14 jrmu };
67 5dc21454 2023-07-14 jrmu
68 5dc21454 2023-07-14 jrmu #define LC_ALL 0
69 5dc21454 2023-07-14 jrmu #define LC_COLLATE 1
70 5dc21454 2023-07-14 jrmu #define LC_CTYPE 2
71 5dc21454 2023-07-14 jrmu #define LC_MONETARY 3
72 5dc21454 2023-07-14 jrmu #define LC_NUMERIC 4
73 5dc21454 2023-07-14 jrmu #define LC_TIME 5
74 5dc21454 2023-07-14 jrmu #define LC_MESSAGES 6
75 5dc21454 2023-07-14 jrmu
76 5dc21454 2023-07-14 jrmu #define _LC_LAST 7 /* marks end */
77 5dc21454 2023-07-14 jrmu
78 5dc21454 2023-07-14 jrmu #include <sys/cdefs.h>
79 5dc21454 2023-07-14 jrmu
80 5dc21454 2023-07-14 jrmu #if __POSIX_VISIBLE >= 200809
81 5dc21454 2023-07-14 jrmu
82 5dc21454 2023-07-14 jrmu #ifndef _LOCALE_T_DEFINED_
83 5dc21454 2023-07-14 jrmu #define _LOCALE_T_DEFINED_
84 5dc21454 2023-07-14 jrmu typedef void *locale_t;
85 5dc21454 2023-07-14 jrmu #endif
86 5dc21454 2023-07-14 jrmu
87 5dc21454 2023-07-14 jrmu #define LC_COLLATE_MASK (1 << LC_COLLATE)
88 5dc21454 2023-07-14 jrmu #define LC_CTYPE_MASK (1 << LC_CTYPE)
89 5dc21454 2023-07-14 jrmu #define LC_MONETARY_MASK (1 << LC_MONETARY)
90 5dc21454 2023-07-14 jrmu #define LC_NUMERIC_MASK (1 << LC_NUMERIC)
91 5dc21454 2023-07-14 jrmu #define LC_TIME_MASK (1 << LC_TIME)
92 5dc21454 2023-07-14 jrmu #define LC_MESSAGES_MASK (1 << LC_MESSAGES)
93 5dc21454 2023-07-14 jrmu
94 5dc21454 2023-07-14 jrmu #define LC_ALL_MASK ((1 << _LC_LAST) - 2)
95 5dc21454 2023-07-14 jrmu
96 5dc21454 2023-07-14 jrmu #define LC_GLOBAL_LOCALE ((locale_t)-1)
97 5dc21454 2023-07-14 jrmu
98 5dc21454 2023-07-14 jrmu #endif /* __POSIX_VISIBLE >= 200809 */
99 5dc21454 2023-07-14 jrmu
100 5dc21454 2023-07-14 jrmu
101 5dc21454 2023-07-14 jrmu __BEGIN_DECLS
102 5dc21454 2023-07-14 jrmu struct lconv *localeconv(void);
103 5dc21454 2023-07-14 jrmu char *setlocale(int, const char *);
104 5dc21454 2023-07-14 jrmu
105 5dc21454 2023-07-14 jrmu #if __POSIX_VISIBLE >= 200809
106 5dc21454 2023-07-14 jrmu locale_t duplocale(locale_t);
107 5dc21454 2023-07-14 jrmu void freelocale(locale_t);
108 5dc21454 2023-07-14 jrmu locale_t newlocale(int, const char *, locale_t);
109 5dc21454 2023-07-14 jrmu locale_t uselocale(locale_t);
110 5dc21454 2023-07-14 jrmu #endif
111 5dc21454 2023-07-14 jrmu __END_DECLS
112 5dc21454 2023-07-14 jrmu
113 5dc21454 2023-07-14 jrmu #endif /* _LOCALE_H_ */
114 5dc21454 2023-07-14 jrmu /* $OpenBSD: dumprestore.h,v 1.11 2021/01/21 00:16:36 mortimer Exp $ */
115 5dc21454 2023-07-14 jrmu /* $NetBSD: dumprestore.h,v 1.14 2005/12/26 19:01:47 perry Exp $ */
116 5dc21454 2023-07-14 jrmu
117 5dc21454 2023-07-14 jrmu /*
118 5dc21454 2023-07-14 jrmu * Copyright (c) 1980, 1993
119 5dc21454 2023-07-14 jrmu * The Regents of the University of California. All rights reserved.
120 5dc21454 2023-07-14 jrmu * (c) UNIX System Laboratories, Inc.
121 5dc21454 2023-07-14 jrmu * All or some portions of this file are derived from material licensed
122 5dc21454 2023-07-14 jrmu * to the University of California by American Telephone and Telegraph
123 5dc21454 2023-07-14 jrmu * Co. or Unix System Laboratories, Inc. and are reproduced herein with
124 5dc21454 2023-07-14 jrmu * the permission of UNIX System Laboratories, Inc.
125 5dc21454 2023-07-14 jrmu *
126 5dc21454 2023-07-14 jrmu * Redistribution and use in source and binary forms, with or without
127 5dc21454 2023-07-14 jrmu * modification, are permitted provided that the following conditions
128 5dc21454 2023-07-14 jrmu * are met:
129 5dc21454 2023-07-14 jrmu * 1. Redistributions of source code must retain the above copyright
130 5dc21454 2023-07-14 jrmu * notice, this list of conditions and the following disclaimer.
131 5dc21454 2023-07-14 jrmu * 2. Redistributions in binary form must reproduce the above copyright
132 5dc21454 2023-07-14 jrmu * notice, this list of conditions and the following disclaimer in the
133 5dc21454 2023-07-14 jrmu * documentation and/or other materials provided with the distribution.
134 5dc21454 2023-07-14 jrmu * 3. Neither the name of the University nor the names of its contributors
135 5dc21454 2023-07-14 jrmu * may be used to endorse or promote products derived from this software
136 5dc21454 2023-07-14 jrmu * without specific prior written permission.
137 5dc21454 2023-07-14 jrmu *
138 5dc21454 2023-07-14 jrmu * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
139 5dc21454 2023-07-14 jrmu * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
140 5dc21454 2023-07-14 jrmu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
141 5dc21454 2023-07-14 jrmu * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
142 5dc21454 2023-07-14 jrmu * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
143 5dc21454 2023-07-14 jrmu * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
144 5dc21454 2023-07-14 jrmu * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
145 5dc21454 2023-07-14 jrmu * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
146 5dc21454 2023-07-14 jrmu * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
147 5dc21454 2023-07-14 jrmu * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
148 5dc21454 2023-07-14 jrmu * SUCH DAMAGE.
149 5dc21454 2023-07-14 jrmu *
150 5dc21454 2023-07-14 jrmu * @(#)dumprestore.h 8.2 (Berkeley) 1/21/94
151 5dc21454 2023-07-14 jrmu */
152 5dc21454 2023-07-14 jrmu
153 5dc21454 2023-07-14 jrmu #ifndef _PROTOCOLS_DUMPRESTORE_H_
154 5dc21454 2023-07-14 jrmu #define _PROTOCOLS_DUMPRESTORE_H_
155 5dc21454 2023-07-14 jrmu
156 5dc21454 2023-07-14 jrmu /*
157 5dc21454 2023-07-14 jrmu * TP_BSIZE is the size of file blocks on the dump tapes.
158 5dc21454 2023-07-14 jrmu * Note that TP_BSIZE must be a multiple of DEV_BSIZE.
159 5dc21454 2023-07-14 jrmu *
160 5dc21454 2023-07-14 jrmu * NTREC is the number of TP_BSIZE blocks that are written
161 5dc21454 2023-07-14 jrmu * in each tape record. HIGHDENSITYTREC is the number of
162 5dc21454 2023-07-14 jrmu * TP_BSIZE blocks that are written in each tape record on
163 5dc21454 2023-07-14 jrmu * 6250 BPI or higher density tapes.
164 5dc21454 2023-07-14 jrmu *
165 5dc21454 2023-07-14 jrmu * TP_NINDIR is the number of indirect pointers in a TS_INODE
166 5dc21454 2023-07-14 jrmu * or TS_ADDR record. Note that it must be a power of two.
167 5dc21454 2023-07-14 jrmu */
168 5dc21454 2023-07-14 jrmu #define TP_BSIZE 1024
169 5dc21454 2023-07-14 jrmu #define NTREC 10
170 5dc21454 2023-07-14 jrmu #define HIGHDENSITYTREC 32
171 5dc21454 2023-07-14 jrmu #define TP_NINDIR (TP_BSIZE/2)
172 5dc21454 2023-07-14 jrmu #define LBLSIZE 16
173 5dc21454 2023-07-14 jrmu #define NAMELEN 64
174 5dc21454 2023-07-14 jrmu
175 5dc21454 2023-07-14 jrmu #define OFS_MAGIC (int)60011
176 5dc21454 2023-07-14 jrmu #define NFS_MAGIC (int)60012
177 5dc21454 2023-07-14 jrmu #ifndef FS_UFS2_MAGIC
178 5dc21454 2023-07-14 jrmu #define FS_UFS2_MAGIC (int)0x19540119
179 5dc21454 2023-07-14 jrmu #endif
180 5dc21454 2023-07-14 jrmu #define CHECKSUM (int)84446
181 5dc21454 2023-07-14 jrmu
182 5dc21454 2023-07-14 jrmu extern union u_spcl {
183 5dc21454 2023-07-14 jrmu char dummy[TP_BSIZE];
184 5dc21454 2023-07-14 jrmu struct s_spcl {
185 5dc21454 2023-07-14 jrmu int32_t c_type; /* record type (see below) */
186 5dc21454 2023-07-14 jrmu int32_t c_old_date; /* date of this dump */
187 5dc21454 2023-07-14 jrmu int32_t c_old_ddate; /* date of previous dump */
188 5dc21454 2023-07-14 jrmu int32_t c_volume; /* dump volume number */
189 5dc21454 2023-07-14 jrmu int32_t c_old_tapea; /* logical block of this record */
190 5dc21454 2023-07-14 jrmu uint32_t c_inumber; /* number of inode */
191 5dc21454 2023-07-14 jrmu int32_t c_magic; /* magic number (see above) */
192 5dc21454 2023-07-14 jrmu int32_t c_checksum; /* record checksum */
193 5dc21454 2023-07-14 jrmu union {
194 5dc21454 2023-07-14 jrmu struct ufs1_dinode __uc_dinode;
195 5dc21454 2023-07-14 jrmu struct {
196 5dc21454 2023-07-14 jrmu uint16_t __uc_mode;
197 5dc21454 2023-07-14 jrmu int16_t __uc_spare1[3];
198 5dc21454 2023-07-14 jrmu uint64_t __uc_size;
199 5dc21454 2023-07-14 jrmu int32_t __uc_old_atime;
200 5dc21454 2023-07-14 jrmu int32_t __uc_atimensec;
201 5dc21454 2023-07-14 jrmu int32_t __uc_old_mtime;
202 5dc21454 2023-07-14 jrmu int32_t __uc_mtimensec;
203 5dc21454 2023-07-14 jrmu int32_t __uc_spare2[2];
204 5dc21454 2023-07-14 jrmu int32_t __uc_rdev;
205 5dc21454 2023-07-14 jrmu int32_t __uc_birthtimensec;
206 5dc21454 2023-07-14 jrmu int64_t __uc_birthtime;
207 5dc21454 2023-07-14 jrmu int64_t __uc_atime;
208 5dc21454 2023-07-14 jrmu int64_t __uc_mtime;
209 5dc21454 2023-07-14 jrmu int32_t __uc_spare4[7];
210 5dc21454 2023-07-14 jrmu uint32_t __uc_file_flags;
211 5dc21454 2023-07-14 jrmu int32_t __uc_spare5[2];
212 5dc21454 2023-07-14 jrmu uint32_t __uc_uid;
213 5dc21454 2023-07-14 jrmu uint32_t __uc_gid;
214 5dc21454 2023-07-14 jrmu int32_t __uc_spare6[2];
215 5dc21454 2023-07-14 jrmu } __uc_ino;
216 5dc21454 2023-07-14 jrmu } __c_ino;
217 5dc21454 2023-07-14 jrmu int32_t c_count; /* number of valid c_addr entries */
218 5dc21454 2023-07-14 jrmu char c_addr[TP_NINDIR]; /* 1 => data; 0 => hole in inode */
219 5dc21454 2023-07-14 jrmu char c_label[LBLSIZE]; /* dump label */
220 5dc21454 2023-07-14 jrmu int32_t c_level; /* level of this dump */
221 5dc21454 2023-07-14 jrmu char c_filesys[NAMELEN]; /* name of dumped file system */
222 5dc21454 2023-07-14 jrmu char c_dev[NAMELEN]; /* name of dumped device */
223 5dc21454 2023-07-14 jrmu char c_host[NAMELEN]; /* name of dumped host */
224 5dc21454 2023-07-14 jrmu int32_t c_flags; /* additional information */
225 5dc21454 2023-07-14 jrmu int32_t c_old_firstrec; /* first record on volume */
226 5dc21454 2023-07-14 jrmu int64_t c_date; /* date of this dump */
227 5dc21454 2023-07-14 jrmu int64_t c_ddate; /* date of previous dump */
228 5dc21454 2023-07-14 jrmu int64_t c_tapea; /* logical block of this record */
229 5dc21454 2023-07-14 jrmu int64_t c_firstrec; /* first record on volume */
230 5dc21454 2023-07-14 jrmu int32_t c_spare[24]; /* reserved for future uses */
231 5dc21454 2023-07-14 jrmu } s_spcl;
232 5dc21454 2023-07-14 jrmu } u_spcl;
233 5dc21454 2023-07-14 jrmu #define spcl u_spcl.s_spcl
234 5dc21454 2023-07-14 jrmu
235 5dc21454 2023-07-14 jrmu #define c_dinode __c_ino.__uc_dinode
236 5dc21454 2023-07-14 jrmu #define c_mode __c_ino.__uc_ino.__uc_mode
237 5dc21454 2023-07-14 jrmu #define c_spare1 __c_ino.__uc_ino.__uc_spare1
238 5dc21454 2023-07-14 jrmu #define c_size __c_ino.__uc_ino.__uc_size
239 5dc21454 2023-07-14 jrmu #define c_old_atime __c_ino.__uc_ino.__uc_old_atime
240 5dc21454 2023-07-14 jrmu #define c_atime __c_ino.__uc_ino.__uc_atime
241 5dc21454 2023-07-14 jrmu #define c_atimensec __c_ino.__uc_ino.__uc_atimensec
242 5dc21454 2023-07-14 jrmu #define c_mtime __c_ino.__uc_ino.__uc_mtime
243 5dc21454 2023-07-14 jrmu #define c_mtimensec __c_ino.__uc_ino.__uc_mtimensec
244 5dc21454 2023-07-14 jrmu #define c_birthtime __c_ino.__uc_ino.__uc_birthtime
245 5dc21454 2023-07-14 jrmu #define c_birthtimensec __c_ino.__uc_ino.__uc_birthtimensec
246 5dc21454 2023-07-14 jrmu #define c_old_mtime __c_ino.__uc_ino.__uc_old_mtime
247 5dc21454 2023-07-14 jrmu #define c_rdev __c_ino.__uc_ino.__uc_rdev
248 5dc21454 2023-07-14 jrmu #define c_file_flags __c_ino.__uc_ino.__uc_file_flags
249 5dc21454 2023-07-14 jrmu #define c_uid __c_ino.__uc_ino.__uc_uid
250 5dc21454 2023-07-14 jrmu #define c_gid __c_ino.__uc_ino.__uc_gid
251 5dc21454 2023-07-14 jrmu
252 5dc21454 2023-07-14 jrmu /*
253 5dc21454 2023-07-14 jrmu * special record types
254 5dc21454 2023-07-14 jrmu */
255 5dc21454 2023-07-14 jrmu #define TS_TAPE 1 /* dump tape header */
256 5dc21454 2023-07-14 jrmu #define TS_INODE 2 /* beginning of file record */
257 5dc21454 2023-07-14 jrmu #define TS_ADDR 4 /* continuation of file record */
258 5dc21454 2023-07-14 jrmu #define TS_BITS 3 /* map of inodes on tape */
259 5dc21454 2023-07-14 jrmu #define TS_CLRI 6 /* map of inodes deleted since last dump */
260 5dc21454 2023-07-14 jrmu #define TS_END 5 /* end of volume marker */
261 5dc21454 2023-07-14 jrmu
262 5dc21454 2023-07-14 jrmu /*
263 5dc21454 2023-07-14 jrmu * flag values
264 5dc21454 2023-07-14 jrmu */
265 5dc21454 2023-07-14 jrmu #define DR_NEWHEADER 0x0001 /* new format tape header */
266 5dc21454 2023-07-14 jrmu #define DR_NEWINODEFMT 0x0002 /* new format inodes on tape */
267 5dc21454 2023-07-14 jrmu
268 5dc21454 2023-07-14 jrmu #define DUMPOUTFMT "%-18s %c %s" /* for printf */
269 5dc21454 2023-07-14 jrmu /* name, level, ctime(date) */
270 5dc21454 2023-07-14 jrmu #define DUMPINFMT "%18s %c %[^\n]\n" /* inverse for scanf */
271 5dc21454 2023-07-14 jrmu
272 5dc21454 2023-07-14 jrmu #endif /* !_PROTOCOLS_DUMPRESTORE_H_ */