61 |
BOOL hide_decorations = False; |
BOOL hide_decorations = False; |
62 |
extern BOOL owncolmap; |
extern BOOL owncolmap; |
63 |
|
|
64 |
|
#ifdef RDP2VNC |
65 |
|
extern int rfb_port; |
66 |
|
extern int defer_time; |
67 |
|
void |
68 |
|
rdp2vnc_connect(char *server, uint32 flags, char *domain, char *password, |
69 |
|
char *shell, char *directory); |
70 |
|
#endif |
71 |
/* Display usage information */ |
/* Display usage information */ |
72 |
static void |
static void |
73 |
usage(char *program) |
usage(char *program) |
77 |
fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); |
fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n"); |
78 |
|
|
79 |
fprintf(stderr, "Usage: %s [options] server[:port]\n", program); |
fprintf(stderr, "Usage: %s [options] server[:port]\n", program); |
80 |
|
#ifdef RDP2VNC |
81 |
|
fprintf(stderr, " -V: vnc port\n"); |
82 |
|
fprintf(stderr, " -E: defer time (ms)\n"); |
83 |
|
#endif |
84 |
fprintf(stderr, " -u: user name\n"); |
fprintf(stderr, " -u: user name\n"); |
85 |
fprintf(stderr, " -d: domain\n"); |
fprintf(stderr, " -d: domain\n"); |
86 |
fprintf(stderr, " -s: shell\n"); |
fprintf(stderr, " -s: shell\n"); |
159 |
domain[0] = password[0] = shell[0] = directory[0] = 0; |
domain[0] = password[0] = shell[0] = directory[0] = 0; |
160 |
strcpy(keymapname, "en-us"); |
strcpy(keymapname, "en-us"); |
161 |
|
|
162 |
while ((c = getopt(argc, argv, "u:d:s:S:c:p:n:k:g:a:fbemCKT:Dh?")) != -1) |
#ifdef RDP2VNC |
163 |
|
#define VNCOPT "V:E:" |
164 |
|
#else |
165 |
|
#define VNCOPT |
166 |
|
#endif |
167 |
|
|
168 |
|
while ((c = getopt(argc, argv, VNCOPT "u:d:s:S:c:p:n:k:g:a:fbemCKT:Dh?")) != -1) |
169 |
{ |
{ |
170 |
switch (c) |
switch (c) |
171 |
{ |
{ |
172 |
|
#ifdef RDP2VNC |
173 |
|
case 'V': |
174 |
|
rfb_port = strtol(optarg, NULL, 10); |
175 |
|
if (rfb_port < 100) |
176 |
|
rfb_port += 5900; |
177 |
|
break; |
178 |
|
|
179 |
|
case 'E': |
180 |
|
defer_time = strtol(optarg, NULL, 10); |
181 |
|
if (defer_time < 0) |
182 |
|
defer_time = 0; |
183 |
|
break; |
184 |
|
#endif |
185 |
|
|
186 |
case 'u': |
case 'u': |
187 |
STRNCPY(username, optarg, sizeof(username)); |
STRNCPY(username, optarg, sizeof(username)); |
188 |
username_option = 1; |
username_option = 1; |
359 |
strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); |
strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); |
360 |
} |
} |
361 |
|
|
362 |
|
#ifdef RDP2VNC |
363 |
|
rdp2vnc_connect(server, flags, domain, password, shell, directory); |
364 |
|
#else |
365 |
|
|
366 |
if (!ui_init()) |
if (!ui_init()) |
367 |
return 1; |
return 1; |
368 |
|
|
381 |
DEBUG(("Disconnecting...\n")); |
DEBUG(("Disconnecting...\n")); |
382 |
rdp_disconnect(); |
rdp_disconnect(); |
383 |
ui_deinit(); |
ui_deinit(); |
384 |
|
|
385 |
|
#endif |
386 |
|
|
387 |
return 0; |
return 0; |
388 |
} |
} |
389 |
|
|