/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/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/branches/seamlessrdp-branch/rdesktop/rdesktop.c

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

revision 582 by n-ki, Fri Jan 23 14:37:51 2004 UTC revision 629 by n-ki, Thu Mar 4 13:23:23 2004 UTC
# Line 69  BOOL g_use_rdp5 = True; Line 69  BOOL g_use_rdp5 = True;
69  BOOL g_console_session = False;  BOOL g_console_session = False;
70  BOOL g_numlock_sync = False;  BOOL g_numlock_sync = False;
71  extern BOOL g_owncolmap;  extern BOOL g_owncolmap;
72    extern BOOL g_ownbackstore;
73    
74  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
75  BOOL g_rdpsnd = False;  BOOL g_rdpsnd = False;
# Line 107  usage(char *program) Line 108  usage(char *program)
108          fprintf(stderr, "   -g: desktop geometry (WxH)\n");          fprintf(stderr, "   -g: desktop geometry (WxH)\n");
109          fprintf(stderr, "   -f: full-screen mode\n");          fprintf(stderr, "   -f: full-screen mode\n");
110          fprintf(stderr, "   -b: force bitmap updates\n");          fprintf(stderr, "   -b: force bitmap updates\n");
111            fprintf(stderr, "   -B: use BackingStore of X-server (if available)\n");
112          fprintf(stderr, "   -e: disable encryption (French TS)\n");          fprintf(stderr, "   -e: disable encryption (French TS)\n");
113          fprintf(stderr, "   -E: disable encryption from client to server\n");          fprintf(stderr, "   -E: disable encryption from client to server\n");
114          fprintf(stderr, "   -m: do not send motion events\n");          fprintf(stderr, "   -m: do not send motion events\n");
# Line 129  usage(char *program) Line 131  usage(char *program)
131          fprintf(stderr, "             or      LPT1=/dev/lp0,LPT2=/dev/lp1\n");          fprintf(stderr, "             or      LPT1=/dev/lp0,LPT2=/dev/lp1\n");
132          fprintf(stderr, "         '-r printer:mydeskjet': enable printer redirection\n");          fprintf(stderr, "         '-r printer:mydeskjet': enable printer redirection\n");
133          fprintf(stderr,          fprintf(stderr,
134                  "             or       mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n");                  "             or      mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n");
135          fprintf(stderr, "         '-r sound': enable sound redirection\n");          fprintf(stderr, "         '-r sound:[on|off|remote]': enable sound redirection\n");
136            fprintf(stderr, "                     remote would leave sound on server\n");
137          fprintf(stderr, "   -0: attach to console\n");          fprintf(stderr, "   -0: attach to console\n");
138          fprintf(stderr, "   -4: use RDP version 4\n");          fprintf(stderr, "   -4: use RDP version 4\n");
139          fprintf(stderr, "   -5: use RDP version 5 (default)\n");          fprintf(stderr, "   -5: use RDP version 5 (default)\n");
# Line 251  main(int argc, char *argv[]) Line 254  main(int argc, char *argv[])
254  #define VNCOPT  #define VNCOPT
255  #endif  #endif
256    
257          while ((c = getopt(argc, argv, VNCOPT "u:d:s:c:p:n:k:g:fbeEmCDKS:T:Na:r:045h?")) != -1)          while ((c = getopt(argc, argv, VNCOPT "u:d:s:c:p:n:k:g:fbBeEmCDKS:T:Na:r:045h?")) != -1)
258          {          {
259                  switch (c)                  switch (c)
260                  {                  {
# Line 347  main(int argc, char *argv[]) Line 350  main(int argc, char *argv[])
350                                  g_orders = False;                                  g_orders = False;
351                                  break;                                  break;
352    
353                            case 'B':
354                                    g_ownbackstore = False;
355                                    break;
356    
357                          case 'e':                          case 'e':
358                                  g_encryption = False;                                  g_encryption = False;
359                                  break;                                  break;
# Line 408  main(int argc, char *argv[]) Line 415  main(int argc, char *argv[])
415    
416                                  if (strncmp("sound", optarg, 5) == 0)                                  if (strncmp("sound", optarg, 5) == 0)
417                                  {                                  {
418                                            optarg += 5;
419    
420                                            if (*optarg == ':')
421                                            {
422                                                    *optarg++;
423                                                    while ((p = next_arg(optarg, ',')))
424                                                    {
425                                                            if (strncmp("remote", optarg, 6) == 0)
426                                                                    flags |= RDP_LOGON_LEAVE_AUDIO;
427    
428                                                            if (strncmp("on", optarg, 2) == 0)
429    #ifdef WITH_RDPSND
430                                                                    g_rdpsnd = True;
431    #else
432                                                                    warning("Not compiled with sound support");
433    #endif
434    
435                                                            if (strncmp("off", optarg, 3) == 0)
436                                                                    g_rdpsnd = False;
437    
438                                                            optarg = p;
439                                                    }
440                                            }
441                                            else
442                                            {
443  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
444                                          g_rdpsnd = True;                                                  g_rdpsnd = True;
445  #else  #else
446                                          warning("Not compiled with sound support");                                                  warning("Not compiled with sound support");
447  #endif  #endif
448                                            }
449                                  }                                  }
450                                  else if (strncmp("disk", optarg, 4) == 0)                                  else if (strncmp("disk", optarg, 4) == 0)
451                                  {                                  {
# Line 457  main(int argc, char *argv[]) Line 490  main(int argc, char *argv[])
490                  }                  }
491          }          }
492    
493          if (argc - optind < 1)          if (argc - optind != 1)
494          {          {
495                  usage(argv[0]);                  usage(argv[0]);
496                  return 1;                  return 1;
# Line 732  hexdump(unsigned char *p, unsigned int l Line 765  hexdump(unsigned char *p, unsigned int l
765  }  }
766    
767  /*  /*
768    input: src is the string we look in for needle    input: src is the string we look in for needle.
769             Needle may be escaped by a backslash, in
770             that case we ignore that particular needle.
771    return value: returns next src pointer, for    return value: returns next src pointer, for
772          succesive executions, like in a while loop          succesive executions, like in a while loop
773          if retval is 0, then there are no more args.          if retval is 0, then there are no more args.
# Line 814  toupper_str(char *p) Line 849  toupper_str(char *p)
849  #define LTOA_BUFSIZE (sizeof(long) * 8 + 1)  #define LTOA_BUFSIZE (sizeof(long) * 8 + 1)
850    
851  char *  char *
852  ltoa(long N, int base)  l_to_a(long N, int base)
853  {  {
854          static char ret[LTOA_BUFSIZE];          static char ret[LTOA_BUFSIZE];
855    
856          register int i = 2;          char *head = ret, buf[LTOA_BUFSIZE], *tail = buf + sizeof(buf);
         long uarg;  
         char *tail, *head = ret, buf[LTOA_BUFSIZE];  
857    
858          if (36 < base || 2 > base)          register int divrem;
                 base = 10;  
859    
860          tail = &buf[LTOA_BUFSIZE - 1];          if (base < 36 || 2 > base)
861          *tail-- = '\0';                  base = 10;
862    
863          if (10 == base && N < 0L)          if (N < 0)
864          {          {
865                  *head++ = '-';                  *head++ = '-';
866                  uarg = -N;                  N = -N;
867          }          }
         else  
                 uarg = N;  
868    
869          if (uarg)          tail = buf + sizeof(buf);
870          {          *--tail = 0;
                 for (i = 1; uarg; ++i)  
                 {  
                         register ldiv_t r;  
871    
872                          r = ldiv(uarg, base);          do
873                          *tail-- = (char) (r.rem + ((9L < r.rem) ? ('A' - 10L) : '0'));          {
874                          uarg = r.quot;                  divrem = N % base;
875                  }                  *--tail = (divrem <= 9) ? divrem + '0' : divrem + 'a' - 10;
876                    N /= base;
877          }          }
878          else          while (N);
                 *tail-- = '0';  
879    
880          memcpy(head, ++tail, i);          strcpy(head, tail);
881          return ret;          return ret;
882  }  }
883    

Legend:
Removed from v.582  
changed lines
  Added in v.629

  ViewVC Help
Powered by ViewVC 1.1.26