strfile.h revision 15944
1146824Srodrigc/*- 2146824Srodrigc * Copyright (c) 1991, 1993 3146824Srodrigc * The Regents of the University of California. All rights reserved. 4146824Srodrigc * 5146824Srodrigc * This code is derived from software contributed to Berkeley by 6146824Srodrigc * Ken Arnold. 7146824Srodrigc * 8146824Srodrigc * Redistribution and use in source and binary forms, with or without 9146824Srodrigc * modification, are permitted provided that the following conditions 10146824Srodrigc * are met: 11146824Srodrigc * 1. Redistributions of source code must retain the above copyright 12146824Srodrigc * notice, this list of conditions and the following disclaimer. 13146824Srodrigc * 2. Redistributions in binary form must reproduce the above copyright 14146824Srodrigc * notice, this list of conditions and the following disclaimer in the 15146824Srodrigc * documentation and/or other materials provided with the distribution. 16146824Srodrigc * 3. All advertising materials mentioning features or use of this software 17146824Srodrigc * must display the following acknowledgement: 18146824Srodrigc * This product includes software developed by the University of 19146824Srodrigc * California, Berkeley and its contributors. 20146824Srodrigc * 4. Neither the name of the University nor the names of its contributors 21146824Srodrigc * may be used to endorse or promote products derived from this software 22146824Srodrigc * without specific prior written permission. 23146824Srodrigc * 24146824Srodrigc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25146824Srodrigc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26146824Srodrigc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27146824Srodrigc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28146824Srodrigc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29146824Srodrigc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30146824Srodrigc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31146824Srodrigc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32146824Srodrigc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33146824Srodrigc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34146824Srodrigc * SUCH DAMAGE. 35146824Srodrigc * 36146824Srodrigc * @(#)strfile.h 8.1 (Berkeley) 5/31/93 37146824Srodrigc */ 38146824Srodrigc 39146824Srodrigc#define STR_ENDSTRING(line,tbl) \ 40146824Srodrigc (((unsigned char)(line)[0]) == (tbl).str_delim && (line)[1] == '\n') 41146824Srodrigc 42146824Srodrigctypedef struct { /* information table */ 43146824Srodrigc#define VERSION 1 44146824Srodrigc unsigned long str_version; /* version number */ 45146824Srodrigc unsigned long str_numstr; /* # of strings in the file */ 46146824Srodrigc unsigned long str_longlen; /* length of longest string */ 47146824Srodrigc unsigned long str_shortlen; /* length of shortest string */ 48146824Srodrigc#define STR_RANDOM 0x1 /* randomized pointers */ 49146824Srodrigc#define STR_ORDERED 0x2 /* ordered pointers */ 50146824Srodrigc#define STR_ROTATED 0x4 /* rot-13'd text */ 51146824Srodrigc unsigned long str_flags; /* bit field for flags */ 52146824Srodrigc unsigned char stuff[4]; /* long aligned space */ 53146824Srodrigc#define str_delim stuff[0] /* delimiting character */ 54146824Srodrigc} STRFILE; 55146824Srodrigc