]> code.delx.au - gnu-emacs/blobdiff - src/syntax.h
Cleanup namespace of dos-w32.el.
[gnu-emacs] / src / syntax.h
index 1b96284af42f78e53861b14d13107594cb545117..73fbb15333859e147e9bcc9335d6cc8f6f5d2aab 100644 (file)
@@ -19,9 +19,6 @@ You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 INLINE_HEADER_BEGIN
-#ifndef SYNTAX_INLINE
-# define SYNTAX_INLINE INLINE
-#endif
 
 extern void update_syntax_table (ptrdiff_t, EMACS_INT, bool, Lisp_Object);
 
@@ -86,35 +83,49 @@ struct gl_state_s
 extern struct gl_state_s gl_state;
 
 /* Fetch the information from the entry for character C
-   in syntax table TABLE, or from globally kept data (gl_state).
+   in the current buffer's syntax table,
+   or (if VIA_PROPERTY) from globally kept data (gl_state).
    Does inheritance.  */
 
-SYNTAX_INLINE Lisp_Object
-SYNTAX_ENTRY (int c)
+INLINE Lisp_Object
+syntax_property_entry (int c, bool via_property)
 {
-#ifdef SYNTAX_ENTRY_VIA_PROPERTY
-  return (gl_state.use_global
-         ? gl_state.global_code
-         : CHAR_TABLE_REF (gl_state.current_syntax_table, c));
-#else
+  if (via_property)
+    return (gl_state.use_global
+           ? gl_state.global_code
+           : CHAR_TABLE_REF (gl_state.current_syntax_table, c));
   return CHAR_TABLE_REF (BVAR (current_buffer, syntax_table), c);
-#endif
+}
+INLINE Lisp_Object
+SYNTAX_ENTRY (int c)
+{
+  return syntax_property_entry (c, 0);
 }
 
 /* Extract the information from the entry for character C
    in the current syntax table.  */
 
-SYNTAX_INLINE int
-SYNTAX_WITH_FLAGS (int c)
+INLINE int
+syntax_property_with_flags (int c, bool via_property)
 {
-  Lisp_Object ent = SYNTAX_ENTRY (c);
+  Lisp_Object ent = syntax_property_entry (c, via_property);
   return CONSP (ent) ? XINT (XCAR (ent)) : Swhitespace;
 }
+INLINE int
+SYNTAX_WITH_FLAGS (int c)
+{
+  return syntax_property_with_flags (c, 0);
+}
 
-SYNTAX_INLINE enum syntaxcode
+INLINE enum syntaxcode
+syntax_property (int c, bool via_property)
+{
+  return syntax_property_with_flags (c, via_property) & 0xff;
+}
+INLINE enum syntaxcode
 SYNTAX (int c)
 {
-  return SYNTAX_WITH_FLAGS (c) & 0xff;
+  return syntax_property (c, 0);
 }
 
 
@@ -137,7 +148,7 @@ extern char const syntax_code_spec[16];
    The value is meant for use in code that does nothing when
    parse_sexp_lookup_properties is 0, so return 0 in that case, for speed.  */
 
-SYNTAX_INLINE ptrdiff_t
+INLINE ptrdiff_t
 SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos)
 {
   return (! parse_sexp_lookup_properties
@@ -157,7 +168,7 @@ SYNTAX_TABLE_BYTE_TO_CHAR (ptrdiff_t bytepos)
 /* Make syntax table state (gl_state) good for CHARPOS, assuming it is
    currently good for a position before CHARPOS.  */
 
-SYNTAX_INLINE void
+INLINE void
 UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos)
 {
   if (parse_sexp_lookup_properties && charpos >= gl_state.e_property)
@@ -167,7 +178,7 @@ UPDATE_SYNTAX_TABLE_FORWARD (ptrdiff_t charpos)
 /* Make syntax table state (gl_state) good for CHARPOS, assuming it is
    currently good for a position after CHARPOS.  */
 
-SYNTAX_INLINE void
+INLINE void
 UPDATE_SYNTAX_TABLE_BACKWARD (ptrdiff_t charpos)
 {
   if (parse_sexp_lookup_properties && charpos < gl_state.b_property)
@@ -176,7 +187,7 @@ UPDATE_SYNTAX_TABLE_BACKWARD (ptrdiff_t charpos)
 
 /* Make syntax table good for CHARPOS.  */
 
-SYNTAX_INLINE void
+INLINE void
 UPDATE_SYNTAX_TABLE (ptrdiff_t charpos)
 {
   UPDATE_SYNTAX_TABLE_BACKWARD (charpos);
@@ -185,7 +196,7 @@ UPDATE_SYNTAX_TABLE (ptrdiff_t charpos)
 
 /* Set up the buffer-global syntax table.  */
 
-SYNTAX_INLINE void
+INLINE void
 SETUP_BUFFER_SYNTAX_TABLE (void)
 {
   gl_state.use_global = 0;