aboutsummaryrefslogtreecommitdiff
path: root/ncurses/trace/lib_tracemse.c
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/trace/lib_tracemse.c')
-rw-r--r--ncurses/trace/lib_tracemse.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ncurses/trace/lib_tracemse.c b/ncurses/trace/lib_tracemse.c
index 51ffa2ef7634..c62b71a0658b 100644
--- a/ncurses/trace/lib_tracemse.c
+++ b/ncurses/trace/lib_tracemse.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -38,19 +38,21 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_tracemse.c,v 1.21 2012/12/15 23:51:19 tom Exp $")
+MODULE_ID("$Id: lib_tracemse.c,v 1.22 2014/10/10 09:06:26 tom Exp $")
#ifdef TRACE
#define my_buffer sp->tracemse_buf
-static char *
-_trace_mmask_t(SCREEN *sp, mmask_t code)
+NCURSES_EXPORT(char *)
+_nc_trace_mmask_t(SCREEN *sp, mmask_t code)
{
#define SHOW(m, s) \
if ((code & m) == m) { \
- _nc_STRCAT(my_buffer, s, sizeof(my_buffer)); \
+ size_t n = strlen(my_buffer); \
+ if (n && (my_buffer[n-1] != '{')) \
_nc_STRCAT(my_buffer, ", ", sizeof(my_buffer)); \
+ _nc_STRCAT(my_buffer, s, sizeof(my_buffer)); \
}
SHOW(BUTTON1_RELEASED, "release-1");
@@ -125,7 +127,7 @@ _nc_tracemouse(SCREEN *sp, MEVENT const *ep)
ep->z,
(unsigned long) ep->bstate);
- (void) _trace_mmask_t(sp, ep->bstate);
+ (void) _nc_trace_mmask_t(sp, ep->bstate);
_nc_STRCAT(my_buffer, "}", sizeof(my_buffer));
result = (my_buffer);
}
@@ -137,7 +139,7 @@ _nc_retrace_mmask_t(SCREEN *sp, mmask_t code)
{
if (sp != 0) {
*my_buffer = '\0';
- T((T_RETURN("{%s}"), _trace_mmask_t(sp, code)));
+ T((T_RETURN("{%s}"), _nc_trace_mmask_t(sp, code)));
} else {
T((T_RETURN("{?}")));
}