From 95c2deec1ab7f98291c24443b1f1ceb1a2233f96 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sun, 10 Mar 2013 17:19:07 +0100 Subject: econproxy: Move update request into own function To be reusable.. --- econproxy.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/econproxy.c b/econproxy.c index 84281f1..38f86a2 100644 --- a/econproxy.c +++ b/econproxy.c @@ -404,6 +404,24 @@ create_beamer_sockets(struct ep *ep, const char *beamer) return 0; } +static int +rfb_framebuffer_update_request(struct ep *ep, int incremental) +{ + struct { + uint8_t cmd; + uint8_t incremental; + uint16_t x, y, w, h; + } framebuffer_update_request = { + 3, 0, + htons(0), htons(0), htons(1024), htons(768) + }; + + framebuffer_update_request.incremental = incremental; + + return write(ep->vnc_fd, &framebuffer_update_request, + sizeof framebuffer_update_request); +} + int main(int argc, char *argv[]) { @@ -506,16 +524,7 @@ main(int argc, char *argv[]) write(ep.vnc_fd, &cmd_set_encodings, sizeof cmd_set_encodings); - struct { - uint8_t cmd; - uint8_t incremental; - uint16_t x, y, w, h; - } framebuffer_update_request = { - 3, 0, - htons(0), htons(0), htons(1024), htons(768) - }; - write(ep.vnc_fd, &framebuffer_update_request, - sizeof framebuffer_update_request); + rfb_framebuffer_update_request(&ep, 0); struct rect { uint16_t x, y, w, h; -- cgit