X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flanguage%2Fline-buffer.c;h=e451532082b06a9f88ac10ed8fcf0cf6ed289892;hb=f5eee9d8478b154444bb0eede53fb892b8130974;hp=0803f0825ed712e2be08b27f19263adc28fb0d9c;hpb=a19b858e0ac3c69e4a28c0ca6d8674427268a863;p=pspp-builds.git diff --git a/src/language/line-buffer.c b/src/language/line-buffer.c index 0803f082..e4515320 100644 --- a/src/language/line-buffer.c +++ b/src/language/line-buffer.c @@ -18,21 +18,25 @@ 02110-1301, USA. */ #include + #include -#include + #include #include #include -#include + +#include +#include +#include #include -#include -#include #include -#include +#include +#include +#include #include -#include -#include +#include #include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -45,7 +49,7 @@ struct getl_source struct getl_source *next; /* Next file in list. */ /* Current location. */ - char *fn; /* Filename. */ + char *fn; /* File name. */ int ln; /* Line number. */ enum getl_source_type @@ -123,7 +127,7 @@ void getl_add_include_dir (const char *path) { if (ds_length (&getl_include_path)) - ds_putc (&getl_include_path, PATH_DELIMITER); + ds_putc (&getl_include_path, ':'); ds_puts (&getl_include_path, path); } @@ -228,15 +232,15 @@ getl_append_syntax_file (const char *fn) append_source (create_syntax_file_source (fn)); } -/* Inserts the given file with filename FN into the current file after - the current line. */ +/* Inserts the given file with name FN into the current file + after the current line. */ void getl_include_syntax_file (const char *fn) { if (cur_source != NULL) { char *found_fn = fn_search_path (fn, ds_c_str (&getl_include_path), - fn_dirname (cur_source->fn)); + fn_dir_name (cur_source->fn)); if (found_fn != NULL) { include_source (create_syntax_file_source (found_fn)); @@ -372,7 +376,7 @@ getl_location (const char **fn, int *ln) } /* File locator stack. */ -static const struct file_locator **file_loc; +static const struct msg_locator **file_loc; static int nfile_loc, mfile_loc; /* Close getl. */ @@ -394,7 +398,7 @@ getl_uninitialize (void) /* Pushes F onto the stack of file locations. */ void -err_push_file_locator (const struct file_locator *f) +msg_push_msg_locator (const struct msg_locator *loc) { if (nfile_loc >= mfile_loc) { @@ -406,28 +410,28 @@ err_push_file_locator (const struct file_locator *f) file_loc = xnrealloc (file_loc, mfile_loc, sizeof *file_loc); } - file_loc[nfile_loc++] = f; + file_loc[nfile_loc++] = loc; } /* Pops F off the stack of file locations. Argument F is only used for verification that that is actually the item on top of the stack. */ void -err_pop_file_locator (const struct file_locator *f) +msg_pop_msg_locator (const struct msg_locator *loc) { - assert (nfile_loc >= 0 && file_loc[nfile_loc - 1] == f); + assert (nfile_loc >= 0 && file_loc[nfile_loc - 1] == loc); nfile_loc--; } /* Puts the current file and line number in F, or NULL and -1 if none. */ void -err_location (struct file_locator *f) +msg_location (struct msg_locator *loc) { if (nfile_loc) - *f = *file_loc[nfile_loc - 1]; + *loc = *file_loc[nfile_loc - 1]; else - getl_location (&f->filename, &f->line_number); + getl_location (&loc->file_name, &loc->line_number); } /* Reads a line from syntax file source S into LINE. @@ -438,7 +442,7 @@ read_syntax_file (struct string *line, struct getl_source *s) /* Open file, if not yet opened. */ if (s->u.syntax_file == NULL) { - msg (VM (1), _("%s: Opening as syntax file."), s->fn); + verbose_msg (1, _("opening \"%s\" as syntax file"), s->fn); s->u.syntax_file = fn_open (s->fn, "r"); if (s->u.syntax_file == NULL) @@ -465,7 +469,7 @@ read_syntax_file (struct string *line, struct getl_source *s) /* Echo to listing file, if configured to do so. */ if (get_echo ()) - tab_output_text (TAB_LEFT | TAT_FIX, ds_c_str (line)); + tab_output_text (TAB_LEFT | TAB_FIX, ds_c_str (line)); return true; }