/[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 582 by n-ki, Fri Jan 23 14:37:51 2004 UTC revision 583 by n-ki, Tue Jan 27 10:36:49 2004 UTC
# Line 118  usage(char *program) Line 118  usage(char *program)
118          fprintf(stderr, "   -N: enable numlock syncronization\n");          fprintf(stderr, "   -N: enable numlock syncronization\n");
119          fprintf(stderr, "   -a: connection colour depth\n");          fprintf(stderr, "   -a: connection colour depth\n");
120          fprintf(stderr, "   -r: enable specified device redirection (this flag can be repeated)\n");          fprintf(stderr, "   -r: enable specified device redirection (this flag can be repeated)\n");
121          fprintf(stderr,          fprintf(stderr, "         '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");
                 "         '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");  
122          fprintf(stderr, "             or      COM1=/dev/ttyS0,COM2=/dev/ttyS1\n");          fprintf(stderr, "             or      COM1=/dev/ttyS0,COM2=/dev/ttyS1\n");
123          fprintf(stderr,          fprintf(stderr, "         '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n");
                 "         '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n");  
124          fprintf(stderr, "             or   A=/mnt/floppy,D=/mnt/cdrom'\n");          fprintf(stderr, "             or   A=/mnt/floppy,D=/mnt/cdrom'\n");
125          fprintf(stderr,          fprintf(stderr, "         '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n");
                 "         '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n");  
126          fprintf(stderr, "             or      LPT1=/dev/lp0,LPT2=/dev/lp1\n");          fprintf(stderr, "             or      LPT1=/dev/lp0,LPT2=/dev/lp1\n");
127          fprintf(stderr, "         '-r printer:mydeskjet': enable printer redirection\n");          fprintf(stderr, "         '-r printer:mydeskjet': enable printer redirection\n");
128          fprintf(stderr,          fprintf(stderr, "             or       mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n");
                 "             or       mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n");  
129          fprintf(stderr, "         '-r sound': enable sound redirection\n");          fprintf(stderr, "         '-r sound': enable sound redirection\n");
130          fprintf(stderr, "   -0: attach to console\n");          fprintf(stderr, "   -0: attach to console\n");
131          fprintf(stderr, "   -4: use RDP version 4\n");          fprintf(stderr, "   -4: use RDP version 4\n");
# Line 732  hexdump(unsigned char *p, unsigned int l Line 728  hexdump(unsigned char *p, unsigned int l
728  }  }
729    
730  /*  /*
731    input: src is the string we look in for needle    input: src is the string we look in for needle.
732             Needle may be escaped by a backslash, in
733             that case we ignore that particular needle.
734    return value: returns next src pointer, for    return value: returns next src pointer, for
735          succesive executions, like in a while loop          succesive executions, like in a while loop
736          if retval is 0, then there are no more args.          if retval is 0, then there are no more args.
# Line 818  ltoa(long N, int base) Line 816  ltoa(long N, int base)
816  {  {
817          static char ret[LTOA_BUFSIZE];          static char ret[LTOA_BUFSIZE];
818    
819          register int i = 2;          char *head = ret, buf[LTOA_BUFSIZE], *tail = buf + sizeof(buf);
         long uarg;  
         char *tail, *head = ret, buf[LTOA_BUFSIZE];  
820    
821          if (36 < base || 2 > base)          register int divrem;
                 base = 10;  
822    
823          tail = &buf[LTOA_BUFSIZE - 1];          if (base < 36 || 2 > base)
824          *tail-- = '\0';                  base = 10;
825    
826          if (10 == base && N < 0L)          if (N < 0)
827          {          {
828                  *head++ = '-';                  *head++ = '-';
829                  uarg = -N;                  N = -N;
830          }          }
         else  
                 uarg = N;  
831    
832          if (uarg)          tail = buf + sizeof(buf);
833          {          *--tail = 0;
                 for (i = 1; uarg; ++i)  
                 {  
                         register ldiv_t r;  
834    
835                          r = ldiv(uarg, base);          do
836                          *tail-- = (char) (r.rem + ((9L < r.rem) ? ('A' - 10L) : '0'));          {
837                          uarg = r.quot;                  divrem = N % base;
838                  }                  *--tail = (divrem <= 9) ? divrem + '0' : divrem + 'a' - 10;
839                    N /= base;
840          }          }
841          else          while (N);
                 *tail-- = '0';  
842    
843          memcpy(head, ++tail, i);          strcpy(head, tail);
844          return ret;          return ret;
845  }  }
846    

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

  ViewVC Help
Powered by ViewVC 1.1.26