cmds.h revision 114472
1/* cmds.h -- declarations for cmds.c. 2 $Id: cmds.h,v 1.3 2002/11/04 22:15:19 karl Exp $ 3 4 Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License along 17 with this program; if not, write to the Free Software Foundation, Inc., 18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 19 20#ifndef CMDS_H 21#define CMDS_H 22 23/* The three arguments a command can get are a flag saying whether it is 24 before argument parsing (START) or after (END), the starting position 25 of the arguments, and the ending position. */ 26typedef void COMMAND_FUNCTION (); /* So we can say COMMAND_FUNCTION *foo; */ 27 28/* Each command has an associated function. When the command is 29 encountered in the text, the associated function is called with START 30 as the argument. If the function expects arguments in braces, it 31 remembers itself on the stack. When the corresponding close brace is 32 encountered, the function is called with END as the argument. */ 33#define START 0 34#define END 1 35 36/* Does the command expect braces? */ 37#define NO_BRACE_ARGS 0 38#define BRACE_ARGS 1 39#define MAYBE_BRACE_ARGS 2 40 41typedef struct 42{ 43 char *name; 44 COMMAND_FUNCTION *proc; 45 int argument_in_braces; 46} COMMAND; 47 48extern COMMAND command_table[]; 49 50/* Nonzero if we have seen an @titlepage command. */ 51extern int titlepage_cmd_present; 52 53#endif /* !CMDS_H */ 54