aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/ScreenSet.h
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-01-27 13:24:29 +0100
committerPierre Ossman <ossman@cendio.se>2015-01-27 13:24:29 +0100
commit7e4da45422ecfb0746c5c79593a642a275142643 (patch)
treedbd4860596318af73f2cc85d1f1cd7b82444c46e /common/rfb/ScreenSet.h
parent50a0427925d50804ec66d0d11a0ee10dcb572c83 (diff)
parent9018af44dadebb5ed50ba9336007fc9da653a9a0 (diff)
downloadtigervnc-7e4da45422ecfb0746c5c79593a642a275142643.tar.gz
tigervnc-7e4da45422ecfb0746c5c79593a642a275142643.zip
Merge branch 'xorgheaders' of https://github.com/CendioOssman/tigervnc
Diffstat (limited to 'common/rfb/ScreenSet.h')
-rw-r--r--common/rfb/ScreenSet.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/common/rfb/ScreenSet.h b/common/rfb/ScreenSet.h
index 8997aa64..ad340c2b 100644
--- a/common/rfb/ScreenSet.h
+++ b/common/rfb/ScreenSet.h
@@ -22,6 +22,7 @@
#define __RFB_SCREENSET_INCLUDED__
#include <stdio.h>
+#include <string.h>
#include <rdr/types.h>
#include <rfb/Rect.h>
@@ -108,15 +109,20 @@ namespace rfb {
return true;
};
- inline void debug_print(void) const {
+ inline void print(char* str, size_t len) const {
+ char buffer[128];
std::list<Screen>::const_iterator iter;
- fprintf(stderr, "%d screens\n", num_screens());
+ snprintf(buffer, sizeof(buffer), "%d screen(s)\n", num_screens());
+ str[0] = '\0';
+ strncat(str, buffer, len - 1 - strlen(str));
for (iter = screens.begin();iter != screens.end();++iter) {
- fprintf(stderr, " %10d (0x%08x): %dx%d+%d+%d (flags 0x%08x)\n",
- (int)iter->id, (unsigned)iter->id,
- iter->dimensions.width(), iter->dimensions.height(),
- iter->dimensions.tl.x, iter->dimensions.tl.y,
- (unsigned)iter->flags);
+ snprintf(buffer, sizeof(buffer),
+ " %10d (0x%08x): %dx%d+%d+%d (flags 0x%08x)\n",
+ (int)iter->id, (unsigned)iter->id,
+ iter->dimensions.width(), iter->dimensions.height(),
+ iter->dimensions.tl.x, iter->dimensions.tl.y,
+ (unsigned)iter->flags);
+ strncat(str, buffer, len - 1 - strlen(str));
}
};