1295011Sandrew/*	$NetBSD: strfile.h,v 1.6 2003/08/07 09:37:15 agc Exp $	*/
2295011Sandrew
3295011Sandrew/*-
4295011Sandrew * Copyright (c) 1991, 1993
5295011Sandrew *	The Regents of the University of California.  All rights reserved.
6295011Sandrew *
7295011Sandrew * This code is derived from software contributed to Berkeley by
8295011Sandrew * Ken Arnold.
9295011Sandrew *
10295011Sandrew * Redistribution and use in source and binary forms, with or without
11295011Sandrew * modification, are permitted provided that the following conditions
12295011Sandrew * are met:
13295011Sandrew * 1. Redistributions of source code must retain the above copyright
14295011Sandrew *    notice, this list of conditions and the following disclaimer.
15295011Sandrew * 2. Redistributions in binary form must reproduce the above copyright
16295011Sandrew *    notice, this list of conditions and the following disclaimer in the
17295011Sandrew *    documentation and/or other materials provided with the distribution.
18295011Sandrew * 3. Neither the name of the University nor the names of its contributors
19295011Sandrew *    may be used to endorse or promote products derived from this software
20295011Sandrew *    without specific prior written permission.
21295011Sandrew *
22295011Sandrew * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23295011Sandrew * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24295011Sandrew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25295011Sandrew * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26295011Sandrew * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27295011Sandrew * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28295011Sandrew * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29295011Sandrew * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30295011Sandrew * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31295011Sandrew * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32295011Sandrew * SUCH DAMAGE.
33295011Sandrew *
34295011Sandrew *	@(#)strfile.h	8.1 (Berkeley) 5/31/93
35295011Sandrew */
36295011Sandrew
37295011Sandrew#include <stdint.h>
38295011Sandrew
39295011Sandrew#define	STR_ENDSTRING(line,tbl) \
40295011Sandrew	((line)[0] == (tbl).str_delim && (line)[1] == '\n')
41295011Sandrew
42295011Sandrewtypedef struct {				/* information table */
43295011Sandrew#define	VERSION		1
44295011Sandrew	uint32_t	str_version;		/* version number */
45295011Sandrew	uint32_t	str_numstr;		/* # of strings in the file */
46295011Sandrew	uint32_t	str_longlen;		/* length of longest string */
47295011Sandrew	uint32_t	str_shortlen;		/* length of shortest string */
48295011Sandrew#define	STR_RANDOM	0x1			/* randomized pointers */
49295011Sandrew#define	STR_ORDERED	0x2			/* ordered pointers */
50295011Sandrew#define	STR_ROTATED	0x4			/* rot-13'd text */
51295011Sandrew	uint32_t	str_flags;		/* bit field for flags */
52295011Sandrew	unsigned char	stuff[4];		/* long aligned space */
53295011Sandrew#define	str_delim	stuff[0]		/* delimiting character */
54295011Sandrew} STRFILE;
55295011Sandrew