--- sourceforge.net/trunk/rdesktop/rdesktop.c 2003/01/28 12:27:28 297 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2003/02/18 13:07:29 329 @@ -1,7 +1,7 @@ /* rdesktop: A Remote Desktop Protocol client. Entrypoint and utility functions - Copyright (C) Matthew Chapman 1999-2002 + Copyright (C) Matthew Chapman 1999-2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,12 +21,12 @@ #include /* va_list va_start va_end */ #include /* read close getuid getgid getpid getppid gethostname */ #include /* open */ -#include /* save licence uses it. */ #include /* getpwuid */ #include /* tcgetattr tcsetattr */ #include /* stat */ #include /* gettimeofday */ #include /* times */ +#include #include "rdesktop.h" #ifdef EGD_SOCKET @@ -45,10 +45,12 @@ char hostname[16]; char keymapname[16]; int keylayout = 0x409; /* Defaults to US keyboard layout */ -int width = 800; /* If width or height are reset to zero, the geometry will +int width = 800; /* If width or height are reset to zero, the geometry will be fetched from _NET_WORKAREA */ int height = 600; int tcp_port_rdp = TCP_PORT_RDP; +int server_bpp = 8; +int win_button_size = 0; /* If zero, disable single app mode */ BOOL bitmap_compression = True; BOOL sendmotion = True; BOOL orders = True; @@ -64,13 +66,14 @@ usage(char *program) { fprintf(stderr, "rdesktop: A Remote Desktop Protocol client.\n"); - fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2002 Matt Chapman.\n"); + fprintf(stderr, "Version " VERSION ". Copyright (C) 1999-2003 Matt Chapman.\n"); fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); fprintf(stderr, "Usage: %s [options] server[:port]\n", program); fprintf(stderr, " -u: user name\n"); fprintf(stderr, " -d: domain\n"); fprintf(stderr, " -s: shell\n"); + fprintf(stderr, " -S: caption button size (single application mode)\n"); fprintf(stderr, " -c: working directory\n"); fprintf(stderr, " -p: password (- to prompt)\n"); fprintf(stderr, " -n: client hostname\n"); @@ -84,6 +87,7 @@ fprintf(stderr, " -K: keep window manager key bindings\n"); fprintf(stderr, " -T: window title\n"); fprintf(stderr, " -D: hide window manager decorations\n"); + fprintf(stderr, " -a: server bpp\n"); } static BOOL @@ -144,7 +148,7 @@ domain[0] = password[0] = shell[0] = directory[0] = 0; strcpy(keymapname, "en-us"); - while ((c = getopt(argc, argv, "u:d:s:c:p:n:k:g:fbemCKT:Dh?")) != -1) + while ((c = getopt(argc, argv, "u:d:s:S:c:p:n:k:g:a:fbemCKT:Dh?")) != -1) { switch (c) { @@ -161,6 +165,23 @@ STRNCPY(shell, optarg, sizeof(shell)); break; + case 'S': + if (!strcmp(optarg, "standard")) + { + win_button_size = 18; + break; + } + + win_button_size = strtol(optarg, &p, 10); + + if (*p) + { + error("invalid button size\n"); + return 1; + } + + break; + case 'c': STRNCPY(directory, optarg, sizeof(directory)); break; @@ -239,6 +260,16 @@ hide_decorations = True; break; + case 'a': + server_bpp = strtol(optarg, NULL, 10); + if (server_bpp != 8 && server_bpp != 16 && server_bpp != 15 + && server_bpp != 24) + { + error("invalid server bpp\n"); + return 1; + } + break; + case 'h': case '?': default: @@ -503,7 +534,7 @@ } } -#ifdef SAVE_LICENCE + int load_licence(unsigned char **data) { @@ -561,8 +592,8 @@ if ((s_ptr->p) + 4 > data + length) { printf("Error in parsing licence key.\n"); - printf("Strings %d end value %x > supplied length (%x)\n", - i, s_ptr->p, data + length); + printf("Strings %d end value %x > supplied length (%x)\n", i, + (unsigned int) s_ptr->p, (unsigned int) data + length); return; } } @@ -570,7 +601,8 @@ if (s_ptr->p + len > data + length) { printf("Error in parsing licence key.\n"); - printf("End of licence %x > supplied length (%x)\n", s_ptr->p + len, data + length); + printf("End of licence %x > supplied length (%x)\n", + (unsigned int) s_ptr->p + len, (unsigned int) data + length); return; } @@ -606,7 +638,7 @@ fnamewrk = xmalloc(strlen(fname) + 12); for (y = 0;; y++) { - sprintf(fnamewrk, "%s.%lu", fname, y); + sprintf(fnamewrk, "%s.%lu", fname, (long unsigned int) y); fnwrkfd = open(fnamewrk, O_WRONLY | O_CREAT | O_EXCL, 0600); if (fnwrkfd == -1) { @@ -659,4 +691,3 @@ } } -#endif