/[rdesktop]/sourceforge.net/trunk/rdesktop/rdesktop.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdesktop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 444 by astrand, Sun Aug 17 07:31:36 2003 UTC revision 474 by matthewc, Tue Sep 30 09:11:08 2003 UTC
# Line 40  Line 40 
40  #include "crypto/md5.h"  #include "crypto/md5.h"
41  #endif  #endif
42    
43  char title[32] = "";  char g_title[32] = "";
44  char g_username[16];  char g_username[16];
45  char hostname[16];  char hostname[16];
46  char keymapname[16];  char keymapname[16];
47  int keylayout = 0x409;          /* Defaults to US keyboard layout */  int keylayout = 0x409;          /* Defaults to US keyboard layout */
48  int width = 800;                /* If width or height are reset to zero, the geometry will  int g_width = 800;              /* If width or height are reset to zero, the geometry will
49                                     be fetched from _NET_WORKAREA */                                     be fetched from _NET_WORKAREA */
50  int height = 600;  int g_height = 600;
51  int tcp_port_rdp = TCP_PORT_RDP;  int tcp_port_rdp = TCP_PORT_RDP;
52  int g_server_bpp = 8;  int g_server_bpp = 8;
53  int win_button_size = 0;        /* If zero, disable single app mode */  int g_win_button_size = 0;      /* If zero, disable single app mode */
54  BOOL g_bitmap_compression = True;  BOOL g_bitmap_compression = True;
55  BOOL sendmotion = True;  BOOL g_sendmotion = True;
56  BOOL g_orders = True;  BOOL g_orders = True;
57  BOOL g_encryption = True;  BOOL g_encryption = True;
58  BOOL packet_encryption = True;  BOOL packet_encryption = True;
59  BOOL g_desktop_save = True;  BOOL g_desktop_save = True;
60  BOOL fullscreen = False;  BOOL g_fullscreen = False;
61  BOOL grab_keyboard = True;  BOOL g_grab_keyboard = True;
62  BOOL hide_decorations = False;  BOOL g_hide_decorations = False;
63  BOOL g_use_rdp5 = False;  BOOL g_use_rdp5 = True;
64  extern BOOL owncolmap;  extern BOOL g_owncolmap;
65    
66  #ifdef RDP2VNC  #ifdef RDP2VNC
67  extern int rfb_port;  extern int rfb_port;
# Line 81  usage(char *program) Line 81  usage(char *program)
81          fprintf(stderr, "Usage: %s [options] server[:port]\n", program);          fprintf(stderr, "Usage: %s [options] server[:port]\n", program);
82  #ifdef RDP2VNC  #ifdef RDP2VNC
83          fprintf(stderr, "   -V: vnc port\n");          fprintf(stderr, "   -V: vnc port\n");
84          fprintf(stderr, "   -E: defer time (ms)\n");          fprintf(stderr, "   -Q: defer time (ms)\n");
85  #endif  #endif
86          fprintf(stderr, "   -u: user name\n");          fprintf(stderr, "   -u: user name\n");
87          fprintf(stderr, "   -d: domain\n");          fprintf(stderr, "   -d: domain\n");
# Line 95  usage(char *program) Line 95  usage(char *program)
95          fprintf(stderr, "   -f: full-screen mode\n");          fprintf(stderr, "   -f: full-screen mode\n");
96          fprintf(stderr, "   -b: force bitmap updates\n");          fprintf(stderr, "   -b: force bitmap updates\n");
97          fprintf(stderr, "   -e: disable encryption (French TS)\n");          fprintf(stderr, "   -e: disable encryption (French TS)\n");
98          fprintf(stderr, "   -E: disable encryption of everything but the logon packet\n");          fprintf(stderr, "   -E: disable encryption from client to server\n");
99          fprintf(stderr, "   -m: do not send motion events\n");          fprintf(stderr, "   -m: do not send motion events\n");
100          fprintf(stderr, "   -C: use private colour map\n");          fprintf(stderr, "   -C: use private colour map\n");
101          fprintf(stderr, "   -K: keep window manager key bindings\n");          fprintf(stderr, "   -K: keep window manager key bindings\n");
102          fprintf(stderr, "   -T: window title\n");          fprintf(stderr, "   -T: window title\n");
103          fprintf(stderr, "   -D: hide window manager decorations\n");          fprintf(stderr, "   -D: hide window manager decorations\n");
104          fprintf(stderr, "   -a: server bpp\n");          fprintf(stderr, "   -a: server bpp\n");
105          fprintf(stderr, "   -5: Use RDP5 (EXPERIMENTAL!)\n");          fprintf(stderr, "   -4: Use RDP version 4\n");
106            fprintf(stderr, "   -5: Use RDP version 5 (default)\n");
107  }  }
108    
109  static BOOL  static BOOL
# Line 212  main(int argc, char *argv[]) Line 213  main(int argc, char *argv[])
213          strcpy(keymapname, "en-us");          strcpy(keymapname, "en-us");
214    
215  #ifdef RDP2VNC  #ifdef RDP2VNC
216  #define VNCOPT "V:E:"  #define VNCOPT "V:Q:"
217  #else  #else
218  #define VNCOPT  #define VNCOPT
219  #endif  #endif
# Line 228  main(int argc, char *argv[]) Line 229  main(int argc, char *argv[])
229                                          rfb_port += 5900;                                          rfb_port += 5900;
230                                  break;                                  break;
231    
232                          case 'E':                          case 'Q':
233                                  defer_time = strtol(optarg, NULL, 10);                                  defer_time = strtol(optarg, NULL, 10);
234                                  if (defer_time < 0)                                  if (defer_time < 0)
235                                          defer_time = 0;                                          defer_time = 0;
# Line 251  main(int argc, char *argv[]) Line 252  main(int argc, char *argv[])
252                          case 'S':                          case 'S':
253                                  if (!strcmp(optarg, "standard"))                                  if (!strcmp(optarg, "standard"))
254                                  {                                  {
255                                          win_button_size = 18;                                          g_win_button_size = 18;
256                                          break;                                          break;
257                                  }                                  }
258    
259                                  win_button_size = strtol(optarg, &p, 10);                                  g_win_button_size = strtol(optarg, &p, 10);
260    
261                                  if (*p)                                  if (*p)
262                                  {                                  {
# Line 296  main(int argc, char *argv[]) Line 297  main(int argc, char *argv[])
297                          case 'g':                          case 'g':
298                                  if (!strcmp(optarg, "workarea"))                                  if (!strcmp(optarg, "workarea"))
299                                  {                                  {
300                                          width = height = 0;                                          g_width = g_height = 0;
301                                          break;                                          break;
302                                  }                                  }
303    
304                                  width = strtol(optarg, &p, 10);                                  g_width = strtol(optarg, &p, 10);
305                                  if (*p == 'x')                                  if (*p == 'x')
306                                          height = strtol(p + 1, NULL, 10);                                          g_height = strtol(p + 1, NULL, 10);
307    
308                                  if ((width == 0) || (height == 0))                                  if ((g_width == 0) || (g_height == 0))
309                                  {                                  {
310                                          error("invalid geometry\n");                                          error("invalid geometry\n");
311                                          return 1;                                          return 1;
# Line 312  main(int argc, char *argv[]) Line 313  main(int argc, char *argv[])
313                                  break;                                  break;
314    
315                          case 'f':                          case 'f':
316                                  fullscreen = True;                                  g_fullscreen = True;
317                                  break;                                  break;
318    
319                          case 'b':                          case 'b':
# Line 326  main(int argc, char *argv[]) Line 327  main(int argc, char *argv[])
327                                  packet_encryption = False;                                  packet_encryption = False;
328                                  break;                                  break;
329                          case 'm':                          case 'm':
330                                  sendmotion = False;                                  g_sendmotion = False;
331                                  break;                                  break;
332    
333                          case 'C':                          case 'C':
334                                  owncolmap = True;                                  g_owncolmap = True;
335                                  break;                                  break;
336    
337                          case 'K':                          case 'K':
338                                  grab_keyboard = False;                                  g_grab_keyboard = False;
339                                  break;                                  break;
340    
341                          case 'T':                          case 'T':
342                                  STRNCPY(title, optarg, sizeof(title));                                  STRNCPY(g_title, optarg, sizeof(g_title));
343                                  break;                                  break;
344    
345                          case 'D':                          case 'D':
346                                  hide_decorations = True;                                  g_hide_decorations = True;
347                                  break;                                  break;
348    
349                          case 'a':                          case 'a':
# Line 355  main(int argc, char *argv[]) Line 356  main(int argc, char *argv[])
356                                  }                                  }
357                                  break;                                  break;
358    
359                            case '4':
360                                    g_use_rdp5 = False;
361                                    break;
362    
363                          case '5':                          case '5':
364                                  g_use_rdp5 = True;                                  g_use_rdp5 = True;
365                                  break;                                  break;
366    
367                          case 'h':                          case 'h':
368                          case '?':                          case '?':
369                          default:                          default:
# Line 405  main(int argc, char *argv[]) Line 411  main(int argc, char *argv[])
411          if (prompt_password && read_password(password, sizeof(password)))          if (prompt_password && read_password(password, sizeof(password)))
412                  flags |= RDP_LOGON_AUTO;                  flags |= RDP_LOGON_AUTO;
413    
414          if (title[0] == 0)          if (g_title[0] == 0)
415          {          {
416                  strcpy(title, "rdesktop - ");                  strcpy(g_title, "rdesktop - ");
417                  strncat(title, server, sizeof(title) - sizeof("rdesktop - "));                  strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - "));
418          }          }
419    
420  #ifdef RDP2VNC  #ifdef RDP2VNC
# Line 419  main(int argc, char *argv[]) Line 425  main(int argc, char *argv[])
425          if (!ui_init())          if (!ui_init())
426                  return 1;                  return 1;
427    
428          /* rdpsnd_init(); */  #ifdef WITH_RDPSND
429            rdpsnd_init();
430    #endif
431          /* rdpdr_init(); */          /* rdpdr_init(); */
432    
433          if (!rdp_connect(server, flags, domain, password, shell, directory))          if (!rdp_connect(server, flags, domain, password, shell, directory))

Legend:
Removed from v.444  
changed lines
  Added in v.474

  ViewVC Help
Powered by ViewVC 1.1.26