From b0ca4f56d5564497d6044c4afd5fd506583707a4 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 18 Nov 1999 05:08:25 +0000 Subject: [PATCH] (KEY_DESCRIPTION_SIZE): New macro. --- src/lisp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lisp.h b/src/lisp.h index a45e30f2d8e..d48ec29461d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1070,6 +1070,16 @@ typedef unsigned char UCHAR; itself. */ #define CHARACTERBITS 19 +/* The maximum byte size consumed by push_key_description. + All callers should assure that at least this size of memory is + allocated at the place pointed by the second argument. + + Thers are 6 modifiers, each consumes 2 chars. + The octal form of a character code consumes + (1 + CHARACTERBITS / 3 + 1) chars (including backslash at the head). + We need one more byte for string terminator `\0'. */ +#define KEY_DESCRIPTION_SIZE ((2 * 6) + 1 + (CHARACTERBITS / 3) + 1 + 1) + #ifdef USE_X_TOOLKIT #ifdef NO_UNION_TYPE /* Use this for turning a (void *) into a Lisp_Object, as when the -- 2.39.5