* buffer.c (struct sortstr.size, record_overlay_string): Don't truncate size to int.
[bpt/emacs.git] / src / syntax.h
index ec8fab0..42d689c 100644 (file)
@@ -1,6 +1,7 @@
 /* Declarations having to do with GNU Emacs syntax tables.
-   Copyright (C) 1985, 1993, 1994, 1997, 1998, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1993-1994, 1997-1998, 2001-2011
+  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -18,12 +19,11 @@ You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-extern Lisp_Object Qsyntax_table_p;
-extern void update_syntax_table P_ ((int, int, int, Lisp_Object));
+extern void update_syntax_table (EMACS_INT, EMACS_INT, int, Lisp_Object);
 
 /* The standard syntax table is stored where it will automatically
    be used in all new buffers.  */
-#define Vstandard_syntax_table buffer_defaults.syntax_table
+#define Vstandard_syntax_table BVAR (&buffer_defaults, syntax_table)
 
 /* A syntax table is a chartable whose elements are cons cells
    (CODE+FLAGS . MATCHING-CHAR).  MATCHING-CHAR can be nil if the char
@@ -78,7 +78,7 @@ enum syntaxcode
 #  define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table
 #else
 #  define SYNTAX_ENTRY SYNTAX_ENTRY_INT
-#  define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
+#  define CURRENT_SYNTAX_TABLE BVAR (current_buffer, syntax_table)
 #endif
 
 #define SYNTAX_ENTRY_INT(c) CHAR_TABLE_REF (CURRENT_SYNTAX_TABLE, (c))
@@ -128,56 +128,9 @@ extern Lisp_Object syntax_temp;
     : Qnil))
 #endif
 
-/* Then there are seven single-bit flags that have the following meanings:
-  1. This character is the first of a two-character comment-start sequence.
-  2. This character is the second of a two-character comment-start sequence.
-  3. This character is the first of a two-character comment-end sequence.
-  4. This character is the second of a two-character comment-end sequence.
-  5. This character is a prefix, for backward-prefix-chars.
-  6. see below
-  7. This character is part of a nestable comment sequence.
-  Note that any two-character sequence whose first character has flag 1
-  and whose second character has flag 2 will be interpreted as a comment start.
-
-  bit 6 is used to discriminate between two different comment styles.
-  Languages such as C++ allow two orthogonal syntax start/end pairs
-  and bit 6 is used to determine whether a comment-end or Scommentend
-  ends style a or b.  Comment start sequences can start style a or b.
-  Style a is always the default.
-  */
-
-/* These macros extract a particular flag for a given character.  */
-
-#define SYNTAX_COMSTART_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 16) & 1)
-
-#define SYNTAX_COMSTART_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 17) & 1)
-
-#define SYNTAX_COMEND_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 18) & 1)
-
-#define SYNTAX_COMEND_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 19) & 1)
-
-#define SYNTAX_PREFIX(c) ((SYNTAX_WITH_FLAGS (c) >> 20) & 1)
-
-#define SYNTAX_COMMENT_STYLE(c) ((SYNTAX_WITH_FLAGS (c) >> 21) & 1)
-
-#define SYNTAX_COMMENT_NESTED(c) ((SYNTAX_WITH_FLAGS (c) >> 22) & 1)
 
-/* These macros extract specific flags from an integer
-   that holds the syntax code and the flags.  */
-
-#define SYNTAX_FLAGS_COMSTART_FIRST(flags) (((flags) >> 16) & 1)
-
-#define SYNTAX_FLAGS_COMSTART_SECOND(flags) (((flags) >> 17) & 1)
-
-#define SYNTAX_FLAGS_COMEND_FIRST(flags) (((flags) >> 18) & 1)
-
-#define SYNTAX_FLAGS_COMEND_SECOND(flags) (((flags) >> 19) & 1)
-
-#define SYNTAX_FLAGS_PREFIX(flags) (((flags) >> 20) & 1)
-
-#define SYNTAX_FLAGS_COMMENT_STYLE(flags) (((flags) >> 21) & 1)
-
-#define SYNTAX_FLAGS_COMMENT_NESTED(flags) (((flags) >> 22) & 1)
+/* Whether the syntax of the character C has the prefix flag set.  */
+extern int syntax_prefix_flag_p (int c);
 
 /* This array, indexed by a character, contains the syntax code which that
  character signifies (as a char).  For example,
@@ -250,7 +203,7 @@ extern char syntax_code_spec[16];
 do                                                                     \
   {                                                                    \
     gl_state.use_global = 0;                                           \
-    gl_state.current_syntax_table = current_buffer->syntax_table;      \
+    gl_state.current_syntax_table = BVAR (current_buffer, syntax_table);\
   } while (0)
 
 /* This macro should be called with FROM at the start of forward
@@ -277,7 +230,8 @@ do                                                                  \
 while (0)
 
 /* Same as above, but in OBJECT.  If OBJECT is nil, use current buffer.
-   If it is t, ignore properties altogether.
+   If it is t (which is only used in fast_c_string_match_ignore_case),
+   ignore properties altogether.
 
    This is meant for regex.c to use.  For buffers, regex.c passes arguments
    to the UPDATE_SYNTAX_TABLE macros which are relative to BEGV.
@@ -304,7 +258,7 @@ do                                                                  \
     else if (EQ (gl_state.object, Qt))                                 \
       {                                                                        \
        gl_state.b_property = 0;                                        \
-       gl_state.e_property = 1500000000;                               \
+       gl_state.e_property = MOST_POSITIVE_FIXNUM;                     \
        gl_state.offset = 0;                                            \
       }                                                                        \
     else                                                               \
@@ -323,15 +277,15 @@ while (0)
 struct gl_state_s
 {
   Lisp_Object object;                  /* The object we are scanning. */
-  int start;                           /* Where to stop. */
-  int stop;                            /* Where to stop. */
+  EMACS_INT start;                     /* Where to stop. */
+  EMACS_INT stop;                      /* Where to stop. */
   int use_global;                      /* Whether to use global_code
                                           or c_s_t. */
   Lisp_Object global_code;             /* Syntax code of current char. */
   Lisp_Object current_syntax_table;    /* Syntax table for current pos. */
   Lisp_Object old_prop;                        /* Syntax-table prop at prev pos. */
-  int b_property;                      /* First index where c_s_t is valid. */
-  int e_property;                      /* First index where c_s_t is
+  EMACS_INT b_property;                        /* First index where c_s_t is valid. */
+  EMACS_INT e_property;                        /* First index where c_s_t is
                                           not valid. */
   INTERVAL forward_i;                  /* Where to start lookup on forward */
   INTERVAL backward_i;                 /* or backward movement.  The
@@ -341,14 +295,8 @@ struct gl_state_s
                                           intervals too, depending
                                           on: */
   /* Offset for positions specified to UPDATE_SYNTAX_TABLE.  */
-  int offset;
+  EMACS_INT offset;
 };
 
 extern struct gl_state_s gl_state;
-extern int parse_sexp_lookup_properties;
-extern INTERVAL interval_of P_ ((int, Lisp_Object));
-
-extern int scan_words P_ ((int, int));
-
-/* arch-tag: 28833cca-cd73-4741-8c85-a3111166a0e0
-   (do not change this comment) */
+extern EMACS_INT scan_words (EMACS_INT, EMACS_INT);