/[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 447 by jsorg71, Thu Aug 21 23:23:15 2003 UTC revision 500 by astrand, Wed Oct 15 14:32:43 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[64] = "";
44  char g_username[16];  char g_username[64];
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 g_width = 800;              /* If width or height are reset to zero, the geometry will  
49                                     be fetched from _NET_WORKAREA */  int g_width = 800;              /* width is special: If 0, the
50                                       geometry will be fetched from
51                                       _NET_WORKAREA. If negative,
52                                       absolute value specifies the
53                                       percent of the whole screen. */
54  int g_height = 600;  int g_height = 600;
55  int tcp_port_rdp = TCP_PORT_RDP;  int tcp_port_rdp = TCP_PORT_RDP;
56  int g_server_bpp = 8;  int g_server_bpp = 8;
57  int win_button_size = 0;        /* If zero, disable single app mode */  int g_win_button_size = 0;      /* If zero, disable single app mode */
58  BOOL g_bitmap_compression = True;  BOOL g_bitmap_compression = True;
59  BOOL g_sendmotion = True;  BOOL g_sendmotion = True;
60  BOOL g_orders = True;  BOOL g_orders = True;
# Line 58  BOOL g_encryption = True; Line 62  BOOL g_encryption = True;
62  BOOL packet_encryption = True;  BOOL packet_encryption = True;
63  BOOL g_desktop_save = True;  BOOL g_desktop_save = True;
64  BOOL g_fullscreen = False;  BOOL g_fullscreen = False;
65  BOOL grab_keyboard = True;  BOOL g_grab_keyboard = True;
66  BOOL hide_decorations = False;  BOOL g_hide_decorations = False;
67  BOOL g_use_rdp5 = False;  BOOL g_use_rdp5 = True;
68  extern BOOL owncolmap;  BOOL g_console_session = False;
69    extern BOOL g_owncolmap;
70    
71  #ifdef RDP2VNC  #ifdef RDP2VNC
72  extern int rfb_port;  extern int rfb_port;
# Line 81  usage(char *program) Line 86  usage(char *program)
86          fprintf(stderr, "Usage: %s [options] server[:port]\n", program);          fprintf(stderr, "Usage: %s [options] server[:port]\n", program);
87  #ifdef RDP2VNC  #ifdef RDP2VNC
88          fprintf(stderr, "   -V: vnc port\n");          fprintf(stderr, "   -V: vnc port\n");
89          fprintf(stderr, "   -E: defer time (ms)\n");          fprintf(stderr, "   -Q: defer time (ms)\n");
90  #endif  #endif
91          fprintf(stderr, "   -u: user name\n");          fprintf(stderr, "   -u: user name\n");
92          fprintf(stderr, "   -d: domain\n");          fprintf(stderr, "   -d: domain\n");
# Line 95  usage(char *program) Line 100  usage(char *program)
100          fprintf(stderr, "   -f: full-screen mode\n");          fprintf(stderr, "   -f: full-screen mode\n");
101          fprintf(stderr, "   -b: force bitmap updates\n");          fprintf(stderr, "   -b: force bitmap updates\n");
102          fprintf(stderr, "   -e: disable encryption (French TS)\n");          fprintf(stderr, "   -e: disable encryption (French TS)\n");
103          fprintf(stderr, "   -E: disable encryption of everything but the logon packet\n");          fprintf(stderr, "   -E: disable encryption from client to server\n");
104          fprintf(stderr, "   -m: do not send motion events\n");          fprintf(stderr, "   -m: do not send motion events\n");
105          fprintf(stderr, "   -C: use private colour map\n");          fprintf(stderr, "   -C: use private colour map\n");
106          fprintf(stderr, "   -K: keep window manager key bindings\n");          fprintf(stderr, "   -K: keep window manager key bindings\n");
107          fprintf(stderr, "   -T: window title\n");          fprintf(stderr, "   -T: window title\n");
108          fprintf(stderr, "   -D: hide window manager decorations\n");          fprintf(stderr, "   -D: hide window manager decorations\n");
109          fprintf(stderr, "   -a: server bpp\n");          fprintf(stderr, "   -a: server bpp\n");
110          fprintf(stderr, "   -5: Use RDP5 (EXPERIMENTAL!)\n");          fprintf(stderr, "   -0: attach to console\n");
111            fprintf(stderr, "   -4: use RDP version 4\n");
112            fprintf(stderr, "   -5: use RDP version 5 (default)\n");
113  }  }
114    
115  static BOOL  static BOOL
# Line 196  main(int argc, char *argv[]) Line 203  main(int argc, char *argv[])
203          char server[64];          char server[64];
204          char fullhostname[64];          char fullhostname[64];
205          char domain[16];          char domain[16];
206          char password[16];          char password[64];
207          char shell[128];          char shell[128];
208          char directory[32];          char directory[32];
209          BOOL prompt_password, rdp_retval = False;          BOOL prompt_password, rdp_retval = False;
# Line 212  main(int argc, char *argv[]) Line 219  main(int argc, char *argv[])
219          strcpy(keymapname, "en-us");          strcpy(keymapname, "en-us");
220    
221  #ifdef RDP2VNC  #ifdef RDP2VNC
222  #define VNCOPT "V:E:"  #define VNCOPT "V:Q:"
223  #else  #else
224  #define VNCOPT  #define VNCOPT
225  #endif  #endif
226    
227          while ((c = getopt(argc, argv, VNCOPT "u:d:s:S:c:p:n:k:g:a:fbeEmCKT:Dh?54")) != -1)          while ((c = getopt(argc, argv, VNCOPT "u:d:s:S:c:p:n:k:g:a:fbeEmCKT:D045h?")) != -1)
228          {          {
229                  switch (c)                  switch (c)
230                  {                  {
# Line 228  main(int argc, char *argv[]) Line 235  main(int argc, char *argv[])
235                                          rfb_port += 5900;                                          rfb_port += 5900;
236                                  break;                                  break;
237    
238                          case 'E':                          case 'Q':
239                                  defer_time = strtol(optarg, NULL, 10);                                  defer_time = strtol(optarg, NULL, 10);
240                                  if (defer_time < 0)                                  if (defer_time < 0)
241                                          defer_time = 0;                                          defer_time = 0;
# Line 251  main(int argc, char *argv[]) Line 258  main(int argc, char *argv[])
258                          case 'S':                          case 'S':
259                                  if (!strcmp(optarg, "standard"))                                  if (!strcmp(optarg, "standard"))
260                                  {                                  {
261                                          win_button_size = 18;                                          g_win_button_size = 18;
262                                          break;                                          break;
263                                  }                                  }
264    
265                                  win_button_size = strtol(optarg, &p, 10);                                  g_win_button_size = strtol(optarg, &p, 10);
266    
267                                  if (*p)                                  if (*p)
268                                  {                                  {
# Line 301  main(int argc, char *argv[]) Line 308  main(int argc, char *argv[])
308                                  }                                  }
309    
310                                  g_width = strtol(optarg, &p, 10);                                  g_width = strtol(optarg, &p, 10);
311                                    if (g_width <= 0)
312                                    {
313                                            error("invalid geometry\n");
314                                            return 1;
315                                    }
316    
317                                  if (*p == 'x')                                  if (*p == 'x')
318                                          g_height = strtol(p + 1, NULL, 10);                                          g_height = strtol(p + 1, NULL, 10);
319    
320                                  if ((g_width == 0) || (g_height == 0))                                  if (g_height <= 0)
321                                  {                                  {
322                                          error("invalid geometry\n");                                          error("invalid geometry\n");
323                                          return 1;                                          return 1;
324                                  }                                  }
325    
326                                    if (*p == '%')
327                                            g_width = -g_width;
328    
329                                  break;                                  break;
330    
331                          case 'f':                          case 'f':
# Line 330  main(int argc, char *argv[]) Line 347  main(int argc, char *argv[])
347                                  break;                                  break;
348    
349                          case 'C':                          case 'C':
350                                  owncolmap = True;                                  g_owncolmap = True;
351                                  break;                                  break;
352    
353                          case 'K':                          case 'K':
354                                  grab_keyboard = False;                                  g_grab_keyboard = False;
355                                  break;                                  break;
356    
357                          case 'T':                          case 'T':
358                                  STRNCPY(title, optarg, sizeof(title));                                  STRNCPY(g_title, optarg, sizeof(g_title));
359                                  break;                                  break;
360    
361                          case 'D':                          case 'D':
362                                  hide_decorations = True;                                  g_hide_decorations = True;
363                                  break;                                  break;
364    
365                          case 'a':                          case 'a':
# Line 355  main(int argc, char *argv[]) Line 372  main(int argc, char *argv[])
372                                  }                                  }
373                                  break;                                  break;
374    
375                            case '0':
376                                    g_console_session = True;
377                                    break;
378    
379                            case '4':
380                                    g_use_rdp5 = False;
381                                    break;
382    
383                          case '5':                          case '5':
384                                  g_use_rdp5 = True;                                  g_use_rdp5 = True;
385                                  break;                                  break;
386    
387                          case 'h':                          case 'h':
388                          case '?':                          case '?':
389                          default:                          default:
# Line 405  main(int argc, char *argv[]) Line 431  main(int argc, char *argv[])
431          if (prompt_password && read_password(password, sizeof(password)))          if (prompt_password && read_password(password, sizeof(password)))
432                  flags |= RDP_LOGON_AUTO;                  flags |= RDP_LOGON_AUTO;
433    
434          if (title[0] == 0)          if (g_title[0] == 0)
435          {          {
436                  strcpy(title, "rdesktop - ");                  strcpy(g_title, "rdesktop - ");
437                  strncat(title, server, sizeof(title) - sizeof("rdesktop - "));                  strncat(g_title, server, sizeof(g_title) - sizeof("rdesktop - "));
438          }          }
439    
440  #ifdef RDP2VNC  #ifdef RDP2VNC
# Line 419  main(int argc, char *argv[]) Line 445  main(int argc, char *argv[])
445          if (!ui_init())          if (!ui_init())
446                  return 1;                  return 1;
447    
448          /* rdpsnd_init(); */  #ifdef WITH_RDPSND
449            rdpsnd_init();
450    #endif
451          /* rdpdr_init(); */          /* rdpdr_init(); */
452    
453          if (!rdp_connect(server, flags, domain, password, shell, directory))          if (!rdp_connect(server, flags, domain, password, shell, directory))

Legend:
Removed from v.447  
changed lines
  Added in v.500

  ViewVC Help
Powered by ViewVC 1.1.26