projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update all #include directives to the currently preferred style.
[pspp-builds.git]
/
src
/
libpspp
/
getl.h
diff --git
a/src/libpspp/getl.h
b/src/libpspp/getl.h
index 26c0649cfe8da63c5f1a7704892a2356af0fc95e..c7d0967f0feef57906a9d53845c4e087b7229832 100644
(file)
--- a/
src/libpspp/getl.h
+++ b/
src/libpspp/getl.h
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006
, 2010, 2011
Free Software Foundation, Inc.
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
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
@@
-18,14
+18,14
@@
#define GETL_H 1
#include <stdbool.h>
#define GETL_H 1
#include <stdbool.h>
-#include
<libpspp/ll.h>
+#include
"libpspp/ll.h"
struct string;
struct getl_source;
/* Syntax rules that apply to a given source line. */
struct string;
struct getl_source;
/* Syntax rules that apply to a given source line. */
-enum
getl_syntax
+enum
syntax_mode
{
/* Each line that begins in column 1 starts a new command. A
`+' or `-' in column 1 is ignored to allow visual
{
/* Each line that begins in column 1 starts a new command. A
`+' or `-' in column 1 is ignored to allow visual
@@
-38,6
+38,16
@@
enum getl_syntax
GETL_INTERACTIVE
};
GETL_INTERACTIVE
};
+enum error_mode
+ {
+ /* When errors are encountered, report the error and continue to
+ the next command. */
+ ERRMODE_CONTINUE,
+
+ /* When errors are encountered, abort the current stream. */
+ ERRMODE_STOP
+ };
+
/* 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
/* 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
@@
-51,7
+61,7
@@
struct getl_interface
Returns true if succesful, false on failure or at end of
input. */
bool (*read) (struct getl_interface *,
Returns true if succesful, false on failure or at end of
input. */
bool (*read) (struct getl_interface *,
- struct string *
, enum getl_syntax *
);
+ struct string *);
/* Close and destroy the interface */
void (*close) (struct getl_interface *);
/* Close and destroy the interface */
void (*close) (struct getl_interface *);
@@
-59,7
+69,7
@@
struct getl_interface
/* Filter for current and all included sources, which may
modify the line. Usually null. */
void (*filter) (struct getl_interface *,
/* Filter for current and all included sources, which may
modify the line. Usually null. */
void (*filter) (struct getl_interface *,
- struct string *line
, enum getl_syntax
);
+ struct string *line);
/* Returns the name of the source */
const char * (*name) (const struct getl_interface *);
/* Returns the name of the source */
const char * (*name) (const struct getl_interface *);
@@
-70,21
+80,32
@@
struct getl_interface
struct source_stream;
struct source_stream;
-struct source_stream * create_source_stream (const char *);
+struct source_stream *create_source_stream (void);
+
+enum syntax_mode source_stream_current_syntax_mode
+ (const struct source_stream *);
+
+
+enum error_mode source_stream_current_error_mode
+ (const struct source_stream *);
+
+
void destroy_source_stream (struct source_stream *);
void getl_clear_include_path (struct source_stream *);
void getl_add_include_dir (struct source_stream *, const char *);
void destroy_source_stream (struct source_stream *);
void getl_clear_include_path (struct source_stream *);
void getl_add_include_dir (struct source_stream *, const char *);
-c
onst char *
getl_include_path (const struct source_stream *);
+c
har **
getl_include_path (const struct source_stream *);
void getl_abort_noninteractive (struct source_stream *);
bool getl_is_interactive (const struct source_stream *);
void getl_abort_noninteractive (struct source_stream *);
bool getl_is_interactive (const struct source_stream *);
-bool getl_read_line (struct source_stream *, struct string *,
- enum getl_syntax *);
+bool getl_read_line (struct source_stream *, struct string *);
+
+void getl_append_source (struct source_stream *, struct getl_interface *s,
+ enum syntax_mode, enum error_mode) ;
-void getl_
append_source (struct source_stream *, struct getl_interface *s) ;
-
void getl_include_source (struct source_stream *, struct getl_interface *s
) ;
+void getl_
include_source (struct source_stream *, struct getl_interface *s,
+
enum syntax_mode, enum error_mode
) ;
const char * getl_source_name (const struct source_stream *);
int getl_source_location (const struct source_stream *);
const char * getl_source_name (const struct source_stream *);
int getl_source_location (const struct source_stream *);