merge from 1.8 branch
[bpt/guile.git] / libguile / read.c
index 53283ad..9d90135 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006 Free Software
+/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006, 2007 Free Software
  * Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
@@ -38,6 +38,8 @@
 #include "libguile/srfi-4.h"
 
 #include "libguile/read.h"
+#include "libguile/private-options.h"
+
 
 \f
 
@@ -52,14 +54,14 @@ scm_t_option scm_read_opts[] = {
   { SCM_OPTION_BOOLEAN, "case-insensitive", 0,
     "Convert symbols to lower case."},
   { SCM_OPTION_SCM, "keywords", SCM_UNPACK (SCM_BOOL_F),
-    "Style of keyword recognition: #f or 'prefix."}
+    "Style of keyword recognition: #f or 'prefix."},
 #if SCM_ENABLE_ELISP
-  ,
   { SCM_OPTION_BOOLEAN, "elisp-vectors", 0,
     "Support Elisp vector syntax, namely `[...]'."},
   { SCM_OPTION_BOOLEAN, "elisp-strings", 0,
-    "Support `\\(' and `\\)' in strings."}
+    "Support `\\(' and `\\)' in strings."},
 #endif
+  { 0, },
 };
 
 /*
@@ -89,7 +91,7 @@ scm_i_input_error (char const *function,
   scm_simple_format (string_port,
                     scm_from_locale_string ("~A:~S:~S: ~A"),
                     scm_list_4 (fn,
-                                scm_from_int (SCM_LINUM (port) + 1),
+                                scm_from_long (SCM_LINUM (port) + 1),
                                 scm_from_int (SCM_COL (port) + 1),
                                 scm_from_locale_string (message)));
     
@@ -112,7 +114,6 @@ SCM_DEFINE (scm_read_options, "read-options-interface", 0, 1, 0,
 {
   SCM ans = scm_options (setting,
                         scm_read_opts,
-                        SCM_N_READ_OPTIONS,
                         FUNC_NAME);
   if (SCM_COPY_SOURCE_P)
     SCM_RECORD_POSITIONS_P = 1;
@@ -406,7 +407,7 @@ scm_lreadr (SCM *tok_buf, SCM port, SCM *copy)
        SCM sharp = scm_get_hash_procedure (c);
        if (scm_is_true (sharp))
          {
-           int line = SCM_LINUM (port);
+           long line = SCM_LINUM (port);
            int column = SCM_COL (port) - 2;
            SCM got;
 
@@ -532,7 +533,7 @@ scm_lreadr (SCM *tok_buf, SCM port, SCM *copy)
 
            if (scm_is_true (sharp))
              {
-               int line = SCM_LINUM (port);
+               long line = SCM_LINUM (port);
                int column = SCM_COL (port) - 2;
                SCM got;
 
@@ -822,7 +823,7 @@ scm_lreadrecparen (SCM *tok_buf, SCM port, char *name, SCM *copy)
   register SCM tl, tl2 = SCM_EOL;
   SCM ans, ans2 = SCM_EOL;
   /* Need to capture line and column numbers here. */
-  int line = SCM_LINUM (port);
+  long line = SCM_LINUM (port);
   int column = SCM_COL (port) - 1;
 
   c = scm_flush_ws (port, name);
@@ -979,7 +980,7 @@ scm_init_read ()
   scm_read_hash_procedures =
     SCM_VARIABLE_LOC (scm_c_define ("read-hash-procedures", SCM_EOL));
 
-  scm_init_opts (scm_read_options, scm_read_opts, SCM_N_READ_OPTIONS);
+  scm_init_opts (scm_read_options, scm_read_opts);
 #include "libguile/read.x"
 }