/* ** @(#) rdesktop.c - NT Terminal Server client for Plan 9 ** @(#) $Id: rdesktop.c,v 1.1.1.1 2003/11/10 10:34:01 lucio Exp $ */ /* ** ================================================================== ** ** $Logfile:$ ** $RCSfile: rdesktop.c,v $ ** $Revision: 1.1.1.1 $ ** $Date: 2003/11/10 10:34:01 $ ** $Author: lucio $ ** ** ================================================================== ** ** $Log: rdesktop.c,v $ ** Revision 1.1.1.1 2003/11/10 10:34:01 lucio ** ASN.1 developments. ** ** ================================================================== */ #include #include #include // we may drop back down here #include #ifndef VERSION #define VERSION "1.2.P9" #endif static char *ident = "@(#) $Id: rdesktop.c,v 1.1.1.1 2003/11/10 10:34:01 lucio Exp $"; static char *use[] = { "usage: %s [options] server[:port]\n", "\n", "opts: -h: this message\n", " -N: show copyright notice\n", "\n", " -u: user name\n", " -d: domain\n", " -s: shell\n", " -c: working directory\n", "?? -p: password (- to prompt)\n", " -n: client hostname\n", " -k: keyboard layout on terminal server (us,sv,gr,etc.)\n", " -g: desktop geometry (WxH)\n", "?? -f: full-screen mode\n", " -b: force bitmap updates\n", " -e: disable encryption (French TS)\n", " -m: do not send motion events\n", " -C: use private colour map\n", "?? -K: keep window manager key bindings\n", " -T: window title\n", "?? -D: hide window manager decorations\n", "\n", NULL }; static void copyright (void) { print ("rdpc: A Remote Desktop Protocol client.\n"); print ("Copyright (C) 1999-2003 Matt Chapman.\n"); print ("Version %s. Copyright (C) 2003 Lucio De Re.\n", VERSION); print ("See http://www.rdesktop.org/ for more information.\n"); } static void usage (char *argv0, char **use) { printf (stderr, *use, argv0); exits ("usage"); } static void help (char *argv0, char **use) { print (*use++, argv0); while (*use) { puts (*use++); } } int main (int argc, char *argv[]) { ARGBEGIN { case 'u': username = EARGF (usage (argv0, use)); break; case 'd': domain = EARGF (usage (argv0, use)); break; case 's': shell = EARGF (usage (argv0, use)); break; case 'c': directory = EARGF (usage (argv0, use)); break; case 'p': password =EARGF (usage (argv0, use)); // flags |= RDP_LOGON_AUTO; break; case 'n': hostname = EARGF (usage (argv0, use)); break; case 'k': keymapname = EARGF (usage (argv0, use)); break; case 'g': w = EARGF (usage (argv0, use)); width = strtol (w, &p, 10); if (*p == 'x') height = strtol (p + 1, NULL, 10); if (width == 0 || height == 0) { printf (stderr, "%s: invalid geometry\n", argv0); exits ("geometry"); } break; case 'f': fullscreen = True; break; case 'b': orders = False; break; case 'e': encryption = False; break; case 'm': sendmotion = False; break; case 'C': owncolmap = True; break; case 'K': grab_keyboard = False; break; case 'T': title = EARGF (usage (argv0, use)); break; case 'D': hide_decorations = True; break; case 'h': case '?': default: usage (argv0); } ARGEND; }