~ubuntu-branches/ubuntu/hoary/malaga/hoary

« back to all changes in this revision

Viewing changes to source/commands.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2004-08-20 12:58:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040820125850-rx9s8bn0ep8jgist
Tags: 6.13-4
This should have been urgency=high, because it is an important and
long-delayed accomodation to new upstream with a bajillion bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of Malaga, a system for Natural Language Analysis.
2
 
 * Copyright (C) 1995-1999 Bjoern Beutel
3
 
 *
4
 
 * Bjoern Beutel
5
 
 * Universitaet Erlangen-Nuernberg
6
 
 * Abteilung fuer Computerlinguistik
7
 
 * Bismarckstrasse 12
8
 
 * D-91054 Erlangen
9
 
 * e-mail: malaga@linguistik.uni-erlangen.de 
10
 
 *
11
 
 * This program is free software; you can redistribute it and/or modify
12
 
 * it under the terms of the GNU General Public License as published by
13
 
 * the Free Software Foundation; either version 2 of the License, or
14
 
 * (at your option) any later version.
15
 
 *
16
 
 * This program is distributed in the hope that it will be useful,
17
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 
 * GNU General Public License for more details.
20
 
 *
21
 
 * You should have received a copy of the GNU General Public License
22
 
 * along with this program; if not, write to the Free Software
23
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
24
 
 
25
 
/* description ==============================================================*/
26
 
 
27
 
/* Tools for a command line interpreter. */
28
 
 
29
 
/* types ====================================================================*/
30
 
 
31
 
/* Use a vector of "command_t" command descriptions
32
 
 * (terminated by a {NULL, NULL} entry) as argument for "command_loop". */ 
33
 
typedef struct
34
 
{
35
 
  string_t names; /* the command name followed by its
36
 
                   * shortcuts, separated by spaces */
37
 
  void (*command) (string_t arguments); /* the command function */
38
 
  string_t help; /* help string or NULL */
39
 
} command_t; 
40
 
 
41
 
/* variables ================================================================*/
42
 
 
43
 
GLOBAL jmp_buf *error_jump_point; /* the current return point after an error */
44
 
 
45
 
GLOBAL command_t **options;
46
 
/* The options that can be set by the set command.
47
 
 * This has to be set before executing "set_command". */
48
 
 
49
 
GLOBAL bool_t quit_requested; /* TRUE if quit command has been executed */
50
 
GLOBAL bool_t leave_command_loop; /* set to TRUE if command loop is to leave */
51
 
 
52
 
/* functions for user interrupts ============================================*/
53
 
 
54
 
extern void check_user_break (void);
55
 
/* Abort command execution if user has sent an interrupt signal. */
56
 
 
57
 
/* functions for reading and executing commands =============================*/
58
 
 
59
 
extern void execute_command_file (string_t command_file, string_t line_header, 
60
 
                                  command_t *commands[]);
61
 
/* Execute commands in <command_file> using <commands>.
62
 
 * If <line_header> != NULL, command lines must start with <line_header>. */
63
 
 
64
 
extern void command_loop (string_t prompt, command_t *commands[]);
65
 
/* Read user commands, look for them in <commands> and execute them
66
 
 * until a command returns FALSE. */
67
 
 
68
 
extern void execute_set_commands (string_t file_name, string_t prefix);
69
 
/* Execute set commands in file <file_name> that are prefixed with <prefix>. */
70
 
 
71
 
/* general commands =========================================================*/
72
 
 
73
 
extern command_t help_command; /* Print a command summary. */
74
 
 
75
 
extern command_t quit_command; /* Quit the program. */
76
 
 
77
 
extern command_t get_command; /* Query options. */
78
 
 
79
 
extern command_t set_command; /* Set options. */
80
 
 
81
 
extern command_t alias_option; /* Define command line abbreviations. */
82
 
 
83
 
/* end of file ==============================================================*/