Commit a0e180b08382bb62415f2cd37c61ecfd99b00773

Daniel Stone 2010-06-15T16:42:06

Expose tbGetBuffer to the rest of libxkbcommon This will let us implement XkbAtomGetString on top of XkbAtomText, instead of having the latter get a duplicated string, dump it into a temporary buffer, and subsequently free it (sigh). Signed-off-by: Daniel Stone <daniel@fooishbar.org>

diff --git a/src/XKBcommonint.h b/src/XKBcommonint.h
index 0c026bb..aa702ea 100644
--- a/src/XKBcommonint.h
+++ b/src/XKBcommonint.h
@@ -58,4 +58,6 @@ authorization from the authors.
 #define _XkbDupString(s)        ((s) ? strdup(s) : NULL)
 #define _XkbStrCaseCmp          strcasecmp
 
+extern char *tbGetBuffer(unsigned int len);
+
 #endif /* _XKBCOMMONINT_H_ */
diff --git a/src/text.c b/src/text.c
index 3f8e554..c5804f6 100644
--- a/src/text.c
+++ b/src/text.c
@@ -35,12 +35,12 @@
 #include <string.h>
 #include <ctype.h>
 
-#define BUFFER_SIZE 512
+#define BUFFER_SIZE 1024
 static char textBuffer[BUFFER_SIZE];
 static int tbNext = 0;
 
-static char *
-tbGetBuffer(unsigned size)
+char *
+tbGetBuffer(unsigned int size)
 {
     char *rtrn;