summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2004-05-17 22:46:34 +0000
committerKim F. Storm <storm@cua.dk>2004-05-17 22:46:34 +0000
commit002571ddc7980f54ec0cd5a8c42adff41f3b5f76 (patch)
tree4bb10a110e22004430367e5eaf730939165b2bc4 /src/buffer.h
parentff999ce63e64526f244a54b8016dd68d5f748dc7 (diff)
downloademacs-002571ddc7980f54ec0cd5a8c42adff41f3b5f76.tar.gz
(GET_OVERLAYS_AT): New macro.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index e2205a916e6..b5227cb9981 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -823,6 +823,25 @@ extern void buffer_slot_type_mismatch P_ ((int));
extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT));
extern void mmap_set_vars P_ ((int));
+/* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements.
+ If NEXTP is non-NULL, return next overlay there.
+ See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */
+
+#define GET_OVERLAYS_AT(posn, overlays, noverlays, nextp, chrq) \
+ do { \
+ int maxlen = 40; \
+ overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \
+ noverlays = overlays_at (posn, 0, &overlays, &maxlen, \
+ nextp, NULL, chrq); \
+ if (noverlays > maxlen) \
+ { \
+ maxlen = noverlays; \
+ overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \
+ noverlays = overlays_at (posn, 0, &overlays, &maxlen, \
+ nextp, NULL, chrq); \
+ } \
+ } while (0)
+
EXFUN (Fbuffer_name, 1);
EXFUN (Fget_file_buffer, 1);
EXFUN (Fnext_overlay_change, 1);