aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/buffer.h b/src/buffer.h
index cf571e06b53..b13aab8443e 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -21,6 +21,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#include <sys/types.h> /* for off_t, time_t */ 21#include <sys/types.h> /* for off_t, time_t */
22#include "systime.h" /* for EMACS_TIME */ 22#include "systime.h" /* for EMACS_TIME */
23 23
24INLINE_HEADER_BEGIN
25#ifndef BUFFER_INLINE
26# define BUFFER_INLINE INLINE
27#endif
28
24/* Accessing the parameters of the current buffer. */ 29/* Accessing the parameters of the current buffer. */
25 30
26/* These macros come in pairs, one for the char position 31/* These macros come in pairs, one for the char position
@@ -961,7 +966,7 @@ extern Lisp_Object Qfirst_change_hook;
961 the buffer to the next character after fetching this one. Instead, 966 the buffer to the next character after fetching this one. Instead,
962 use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */ 967 use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */
963 968
964static inline int 969BUFFER_INLINE int
965FETCH_MULTIBYTE_CHAR (ptrdiff_t pos) 970FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
966{ 971{
967 unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0) 972 unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0)
@@ -973,7 +978,7 @@ FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
973 If POS doesn't point the head of valid multi-byte form, only the byte at 978 If POS doesn't point the head of valid multi-byte form, only the byte at
974 POS is returned. No range checking. */ 979 POS is returned. No range checking. */
975 980
976static inline int 981BUFFER_INLINE int
977BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos) 982BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
978{ 983{
979 unsigned char *p 984 unsigned char *p
@@ -1090,7 +1095,7 @@ extern int last_per_buffer_idx;
1090 (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER))) 1095 (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
1091 1096
1092/* Downcase a character C, or make no change if that cannot be done. */ 1097/* Downcase a character C, or make no change if that cannot be done. */
1093static inline int 1098BUFFER_INLINE int
1094downcase (int c) 1099downcase (int c)
1095{ 1100{
1096 Lisp_Object downcase_table = BVAR (current_buffer, downcase_table); 1101 Lisp_Object downcase_table = BVAR (current_buffer, downcase_table);
@@ -1099,10 +1104,10 @@ downcase (int c)
1099} 1104}
1100 1105
1101/* 1 if C is upper case. */ 1106/* 1 if C is upper case. */
1102static inline int uppercasep (int c) { return downcase (c) != c; } 1107BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; }
1103 1108
1104/* Upcase a character C known to be not upper case. */ 1109/* Upcase a character C known to be not upper case. */
1105static inline int 1110BUFFER_INLINE int
1106upcase1 (int c) 1111upcase1 (int c)
1107{ 1112{
1108 Lisp_Object upcase_table = BVAR (current_buffer, upcase_table); 1113 Lisp_Object upcase_table = BVAR (current_buffer, upcase_table);
@@ -1111,8 +1116,10 @@ upcase1 (int c)
1111} 1116}
1112 1117
1113/* 1 if C is lower case. */ 1118/* 1 if C is lower case. */
1114static inline int lowercasep (int c) 1119BUFFER_INLINE int lowercasep (int c)
1115{ return !uppercasep (c) && upcase1 (c) != c; } 1120{ return !uppercasep (c) && upcase1 (c) != c; }
1116 1121
1117/* Upcase a character C, or make no change if that cannot be done. */ 1122/* Upcase a character C, or make no change if that cannot be done. */
1118static inline int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); } 1123BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
1124
1125INLINE_HEADER_END