/[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 474 by matthewc, Tue Sep 30 09:11:08 2003 UTC revision 520 by matthewc, Tue Oct 28 05:07:00 2003 UTC
# Line 40  Line 40 
40  #include "crypto/md5.h"  #include "crypto/md5.h"
41  #endif  #endif
42    
43  char g_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;
# Line 61  BOOL g_fullscreen = False; Line 65  BOOL g_fullscreen = False;
65  BOOL g_grab_keyboard = True;  BOOL g_grab_keyboard = True;
66  BOOL g_hide_decorations = False;  BOOL g_hide_decorations = False;
67  BOOL g_use_rdp5 = True;  BOOL g_use_rdp5 = True;
68    BOOL g_console_session = False;
69  extern BOOL g_owncolmap;  extern BOOL g_owncolmap;
70    
71    #ifdef WITH_RDPSND
72    BOOL g_rdpsnd = False;
73    #endif
74    
75  #ifdef RDP2VNC  #ifdef RDP2VNC
76  extern int rfb_port;  extern int rfb_port;
77  extern int defer_time;  extern int defer_time;
# Line 86  usage(char *program) Line 95  usage(char *program)
95          fprintf(stderr, "   -u: user name\n");          fprintf(stderr, "   -u: user name\n");
96          fprintf(stderr, "   -d: domain\n");          fprintf(stderr, "   -d: domain\n");
97          fprintf(stderr, "   -s: shell\n");          fprintf(stderr, "   -s: shell\n");
         fprintf(stderr, "   -S: caption button size (single application mode)\n");  
98          fprintf(stderr, "   -c: working directory\n");          fprintf(stderr, "   -c: working directory\n");
99          fprintf(stderr, "   -p: password (- to prompt)\n");          fprintf(stderr, "   -p: password (- to prompt)\n");
100          fprintf(stderr, "   -n: client hostname\n");          fprintf(stderr, "   -n: client hostname\n");
101          fprintf(stderr, "   -k: keyboard layout on terminal server (us,sv,gr,etc.)\n");          fprintf(stderr, "   -k: keyboard layout on server (en-us, de, sv, etc.)\n");
102          fprintf(stderr, "   -g: desktop geometry (WxH)\n");          fprintf(stderr, "   -g: desktop geometry (WxH)\n");
103          fprintf(stderr, "   -f: full-screen mode\n");          fprintf(stderr, "   -f: full-screen mode\n");
104          fprintf(stderr, "   -b: force bitmap updates\n");          fprintf(stderr, "   -b: force bitmap updates\n");
# Line 98  usage(char *program) Line 106  usage(char *program)
106          fprintf(stderr, "   -E: disable encryption from client to server\n");          fprintf(stderr, "   -E: disable encryption from client to server\n");
107          fprintf(stderr, "   -m: do not send motion events\n");          fprintf(stderr, "   -m: do not send motion events\n");
108          fprintf(stderr, "   -C: use private colour map\n");          fprintf(stderr, "   -C: use private colour map\n");
109            fprintf(stderr, "   -D: hide window manager decorations\n");
110          fprintf(stderr, "   -K: keep window manager key bindings\n");          fprintf(stderr, "   -K: keep window manager key bindings\n");
111            fprintf(stderr, "   -S: caption button size (single application mode)\n");
112          fprintf(stderr, "   -T: window title\n");          fprintf(stderr, "   -T: window title\n");
113          fprintf(stderr, "   -D: hide window manager decorations\n");          fprintf(stderr, "   -a: connection colour depth\n");
114          fprintf(stderr, "   -a: server bpp\n");          fprintf(stderr, "   -r: enable specified device redirection (currently: sound)\n");
115          fprintf(stderr, "   -4: Use RDP version 4\n");          fprintf(stderr, "   -0: attach to console\n");
116          fprintf(stderr, "   -5: Use RDP version 5 (default)\n");          fprintf(stderr, "   -4: use RDP version 4\n");
117            fprintf(stderr, "   -5: use RDP version 5 (default)\n");
118  }  }
119    
120  static BOOL  static BOOL
# Line 197  main(int argc, char *argv[]) Line 208  main(int argc, char *argv[])
208          char server[64];          char server[64];
209          char fullhostname[64];          char fullhostname[64];
210          char domain[16];          char domain[16];
211          char password[16];          char password[64];
212          char shell[128];          char shell[128];
213          char directory[32];          char directory[32];
214          BOOL prompt_password, rdp_retval = False;          BOOL prompt_password, rdp_retval = False;
# Line 218  main(int argc, char *argv[]) Line 229  main(int argc, char *argv[])
229  #define VNCOPT  #define VNCOPT
230  #endif  #endif
231    
232          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:c:p:n:k:g:fbeEmCDKS:T:a:r:045h?")) != -1)
233          {          {
234                  switch (c)                  switch (c)
235                  {                  {
# Line 249  main(int argc, char *argv[]) Line 260  main(int argc, char *argv[])
260                                  STRNCPY(shell, optarg, sizeof(shell));                                  STRNCPY(shell, optarg, sizeof(shell));
261                                  break;                                  break;
262    
                         case 'S':  
                                 if (!strcmp(optarg, "standard"))  
                                 {  
                                         g_win_button_size = 18;  
                                         break;  
                                 }  
   
                                 g_win_button_size = strtol(optarg, &p, 10);  
   
                                 if (*p)  
                                 {  
                                         error("invalid button size\n");  
                                         return 1;  
                                 }  
   
                                 break;  
   
263                          case 'c':                          case 'c':
264                                  STRNCPY(directory, optarg, sizeof(directory));                                  STRNCPY(directory, optarg, sizeof(directory));
265                                  break;                                  break;
# Line 302  main(int argc, char *argv[]) Line 296  main(int argc, char *argv[])
296                                  }                                  }
297    
298                                  g_width = strtol(optarg, &p, 10);                                  g_width = strtol(optarg, &p, 10);
299                                    if (g_width <= 0)
300                                    {
301                                            error("invalid geometry\n");
302                                            return 1;
303                                    }
304    
305                                  if (*p == 'x')                                  if (*p == 'x')
306                                          g_height = strtol(p + 1, NULL, 10);                                          g_height = strtol(p + 1, NULL, 10);
307    
308                                  if ((g_width == 0) || (g_height == 0))                                  if (g_height <= 0)
309                                  {                                  {
310                                          error("invalid geometry\n");                                          error("invalid geometry\n");
311                                          return 1;                                          return 1;
312                                  }                                  }
313    
314                                    if (*p == '%')
315                                            g_width = -g_width;
316    
317                                  break;                                  break;
318    
319                          case 'f':                          case 'f':
# Line 334  main(int argc, char *argv[]) Line 338  main(int argc, char *argv[])
338                                  g_owncolmap = True;                                  g_owncolmap = True;
339                                  break;                                  break;
340    
341                            case 'D':
342                                    g_hide_decorations = True;
343                                    break;
344    
345                          case 'K':                          case 'K':
346                                  g_grab_keyboard = False;                                  g_grab_keyboard = False;
347                                  break;                                  break;
348    
349                          case 'T':                          case 'S':
350                                  STRNCPY(g_title, optarg, sizeof(g_title));                                  if (!strcmp(optarg, "standard"))
351                                    {
352                                            g_win_button_size = 18;
353                                            break;
354                                    }
355    
356                                    g_win_button_size = strtol(optarg, &p, 10);
357    
358                                    if (*p)
359                                    {
360                                            error("invalid button size\n");
361                                            return 1;
362                                    }
363    
364                                  break;                                  break;
365    
366                          case 'D':                          case 'T':
367                                  g_hide_decorations = True;                                  STRNCPY(g_title, optarg, sizeof(g_title));
368                                  break;                                  break;
369    
370                          case 'a':                          case 'a':
# Line 356  main(int argc, char *argv[]) Line 377  main(int argc, char *argv[])
377                                  }                                  }
378                                  break;                                  break;
379    
380                            case 'r':
381                                    if (!strcmp(optarg, "sound"))
382    #ifdef WITH_RDPSND
383                                            g_rdpsnd = True;
384    #else
385                                            warning("Not compiled with sound support");
386    #endif
387                                    break;
388    
389                            case '0':
390                                    g_console_session = True;
391                                    break;
392    
393                          case '4':                          case '4':
394                                  g_use_rdp5 = False;                                  g_use_rdp5 = False;
395                                  break;                                  break;
# Line 426  main(int argc, char *argv[]) Line 460  main(int argc, char *argv[])
460                  return 1;                  return 1;
461    
462  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
463          rdpsnd_init();          if (g_rdpsnd)
464                    rdpsnd_init();
465  #endif  #endif
466          /* rdpdr_init(); */          /* rdpdr_init(); */
467    

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

  ViewVC Help
Powered by ViewVC 1.1.26