1*cb5fd834Sjsm /* $NetBSD: quiz.h,v 1.7 2004/01/27 20:30:30 jsm Exp $ */ 2ee0f9d10Scgd 35bfb98b1Scgd /*- 4a432dc58Scgd * Copyright (c) 1991, 1993 5a432dc58Scgd * The Regents of the University of California. All rights reserved. 65bfb98b1Scgd * 75bfb98b1Scgd * This code is derived from software contributed to Berkeley by 8a432dc58Scgd * Jim R. Oldroyd at The Instruction Set and Keith Gabryelski at 9a432dc58Scgd * Commodore Business Machines. 105bfb98b1Scgd * 115bfb98b1Scgd * Redistribution and use in source and binary forms, with or without 125bfb98b1Scgd * modification, are permitted provided that the following conditions 135bfb98b1Scgd * are met: 145bfb98b1Scgd * 1. Redistributions of source code must retain the above copyright 155bfb98b1Scgd * notice, this list of conditions and the following disclaimer. 165bfb98b1Scgd * 2. Redistributions in binary form must reproduce the above copyright 175bfb98b1Scgd * notice, this list of conditions and the following disclaimer in the 185bfb98b1Scgd * documentation and/or other materials provided with the distribution. 19e5aeb4eaSagc * 3. Neither the name of the University nor the names of its contributors 205bfb98b1Scgd * may be used to endorse or promote products derived from this software 215bfb98b1Scgd * without specific prior written permission. 225bfb98b1Scgd * 235bfb98b1Scgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 245bfb98b1Scgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 255bfb98b1Scgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 265bfb98b1Scgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 275bfb98b1Scgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 285bfb98b1Scgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 295bfb98b1Scgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 305bfb98b1Scgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 315bfb98b1Scgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 325bfb98b1Scgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 335bfb98b1Scgd * SUCH DAMAGE. 345bfb98b1Scgd * 35a432dc58Scgd * @(#)quiz.h 8.1 (Berkeley) 5/31/93 365bfb98b1Scgd */ 375bfb98b1Scgd 385bfb98b1Scgd #define TRUE 1 395bfb98b1Scgd #define FALSE 0 405bfb98b1Scgd 415bfb98b1Scgd /* Length of compiled regexp machine; increase if not big enough. */ 425bfb98b1Scgd #define RXP_LINE_SZ 8192 435bfb98b1Scgd 445bfb98b1Scgd /* Maximum line length for data files. */ 455bfb98b1Scgd #define LINE_SZ 1024 465bfb98b1Scgd 475bfb98b1Scgd /* Linked list for holding index and data file information. */ 485bfb98b1Scgd typedef struct qentry { 495bfb98b1Scgd struct qentry *q_next; /* next one */ 505bfb98b1Scgd char *q_text; /* category text string from file */ 515bfb98b1Scgd int q_asked; /* TRUE if question's been asked */ 525bfb98b1Scgd int q_answered; /* TRUE if question's been answered */ 535bfb98b1Scgd } QE; 545bfb98b1Scgd 555bfb98b1Scgd extern char rxperr[]; 565bfb98b1Scgd 57*cb5fd834Sjsm int rxp_compile(const char *); 58*cb5fd834Sjsm char *rxp_expand(void); 59*cb5fd834Sjsm int rxp_match(const char *); 60