1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 #include <libpspp/ll.h>
31 /* An abstract base class for objects which act as line buffers for the
32 PSPP. Ie anything which might contain content for the lexer */
35 /* Returns true, if the interface is interactive */
36 bool (*interactive) (const struct getl_interface *);
38 /* Read a line from the interface */
39 bool (*read) (struct getl_interface *, struct string *);
41 /* Close and destroy the interface */
42 void (*close) (struct getl_interface *);
44 /* Filter for current and all included sources. May be NULL */
45 void (*filter) (struct getl_interface *, struct string *line);
47 /* Returns the name of the source */
48 const char * (*name) (const struct getl_interface *);
50 /* Returns the current location within the source */
51 int (*location) (const struct getl_interface *);
54 void getl_initialize (void);
55 void getl_uninitialize (void);
57 void getl_clear_include_path (void);
58 void getl_add_include_dir (const char *);
59 const char * getl_include_path (void);
61 void getl_abort_noninteractive (void);
62 bool getl_is_interactive (void);
64 bool getl_read_line (bool *interactive);
66 bool do_read_line (struct string *line, bool *interactive);
68 void getl_append_source (struct getl_interface *s) ;
69 void getl_include_source (struct getl_interface *s) ;
71 const char * getl_source_name (void);
72 int getl_source_location (void);
74 #endif /* line-buffer.h */