aboutsummaryrefslogtreecommitdiffstats
path: root/scheme-private.h
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-02-28 08:40:01 +0000
committerJustus Winter <[email protected]>2017-02-28 09:00:29 +0000
commit9b23e71a6b41cd11b39ab1e1d18c140eaf63c3e7 (patch)
tree815c326c8be5654e623c05f4985cffb1792a19dc /scheme-private.h
parentClean up word replication. (diff)
downloadlibgpg-error-9b23e71a6b41cd11b39ab1e1d18c140eaf63c3e7.tar.gz
libgpg-error-9b23e71a6b41cd11b39ab1e1d18c140eaf63c3e7.zip
gpgscm: Track source locations in every kind of ports.
* tests/gpgscm/scheme-private.h (struct port): Move location information out of the union. * tests/gpgscm/scheme.c (mark): All ports need marking now. (gc): Likewise all ports on the load stack. (port_clear_location): Adapt accordingly. Also, add an empty function for !SHOW_ERROR_LINE. (port_increment_current_line): Likewise. (port_reset_current_line): Drop function in favor of... (port_init_location): ... this new function. (file_push): Simplify. (file_pop): Likewise. (port_rep_from_filename): Likewise. (port_rep_from_file): Likewise. (port_rep_from_string): Also initialize the location. (port_rep_from_scratch): Likewise. (port_close): Simplify and generalize. (skipspace): Likewise. (token): Likewise. (_Error_1): Generalize. (opexe_5): Likewise. (scheme_deinit): Simplify and generalize. (scheme_load_named_file): Likewise. (scheme_load_string): Also initialize the location. -- This change tracks the location of source code loaded from non-file ports that is used in error messages. It also simplifies the code quite a bit. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to '')
-rw-r--r--scheme-private.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/scheme-private.h b/scheme-private.h
index ad8f571..abd89e8 100644
--- a/scheme-private.h
+++ b/scheme-private.h
@@ -27,10 +27,6 @@ typedef struct port {
struct {
FILE *file;
int closeit;
-#if SHOW_ERROR_LINE
- pointer curr_line;
- pointer filename;
-#endif
} stdio;
struct {
char *start;
@@ -38,6 +34,10 @@ typedef struct port {
char *curr;
} string;
} rep;
+#if SHOW_ERROR_LINE
+ pointer curr_line;
+ pointer filename;
+#endif
} port;
/* cell structure */