Blob


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