X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fgetl.h;h=26c0649cfe8da63c5f1a7704892a2356af0fc95e;hb=c17ea35a73b7a690a54c5c6a213de19f0376e74f;hp=27faee6445818e1ca29f68e71a74daae4789c39f;hpb=8381768f3394a907c621cb9acbb77b83f5cd4875;p=pspp diff --git a/src/libpspp/getl.h b/src/libpspp/getl.h index 27faee6445..26c0649cfe 100644 --- a/src/libpspp/getl.h +++ b/src/libpspp/getl.h @@ -1,21 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - Written by Ben Pfaff . - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef GETL_H #define GETL_H 1 @@ -23,12 +20,12 @@ #include #include -struct string; +struct string; struct getl_source; /* Syntax rules that apply to a given source line. */ -enum getl_syntax +enum getl_syntax { /* Each line that begins in column 1 starts a new command. A `+' or `-' in column 1 is ignored to allow visual @@ -41,14 +38,14 @@ enum getl_syntax GETL_INTERACTIVE }; -/* An abstract base class for objects which act as line buffers for the +/* An abstract base class for objects which act as line buffers for the PSPP. Ie anything which might contain content for the lexer */ -struct getl_interface +struct getl_interface { /* Returns true if the interface is interactive, that is, if it prompts a human user. This property is independent of the syntax mode returned by the read member function. */ - bool (*interactive) (const struct getl_interface *); + bool (*interactive) (const struct getl_interface *); /* Read a line the intended syntax mode from the interface. Returns true if succesful, false on failure or at end of @@ -71,24 +68,25 @@ struct getl_interface int (*location) (const struct getl_interface *); }; -void getl_initialize (void); -void getl_uninitialize (void); +struct source_stream; -void getl_clear_include_path (void); -void getl_add_include_dir (const char *); -const char * getl_include_path (void); +struct source_stream * create_source_stream (const char *); +void destroy_source_stream (struct source_stream *); -void getl_abort_noninteractive (void); -bool getl_is_interactive (void); +void getl_clear_include_path (struct source_stream *); +void getl_add_include_dir (struct source_stream *, const char *); +const char * getl_include_path (const struct source_stream *); -bool getl_read_line (bool *interactive); +void getl_abort_noninteractive (struct source_stream *); +bool getl_is_interactive (const struct source_stream *); -bool do_read_line (struct string *line, enum getl_syntax *syntax); +bool getl_read_line (struct source_stream *, struct string *, + enum getl_syntax *); -void getl_append_source (struct getl_interface *s) ; -void getl_include_source (struct getl_interface *s) ; +void getl_append_source (struct source_stream *, struct getl_interface *s) ; +void getl_include_source (struct source_stream *, struct getl_interface *s) ; -const char * getl_source_name (void); -int getl_source_location (void); +const char * getl_source_name (const struct source_stream *); +int getl_source_location (const struct source_stream *); #endif /* line-buffer.h */