/[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 569 by n-ki, Wed Jan 21 14:40:40 2004 UTC revision 582 by n-ki, Fri Jan 23 14:37:51 2004 UTC
# Line 26  Line 26 
26  #include <sys/stat.h>           /* stat */  #include <sys/stat.h>           /* stat */
27  #include <sys/time.h>           /* gettimeofday */  #include <sys/time.h>           /* gettimeofday */
28  #include <sys/times.h>          /* times */  #include <sys/times.h>          /* times */
29    #include <ctype.h>              /* toupper */
30  #include <errno.h>  #include <errno.h>
31  #include "rdesktop.h"  #include "rdesktop.h"
32    
# Line 117  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, "         '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");          fprintf(stderr,
122          fprintf(stderr, "             or    :COM1=/dev/ttyS0:9600,0|1|2,0|2,5|6|7|8:dtr \n");                  "         '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");
123          fprintf(stderr, "         '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n");          fprintf(stderr, "             or      COM1=/dev/ttyS0,COM2=/dev/ttyS1\n");
124            fprintf(stderr,
125                    "         '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n");
126          fprintf(stderr, "             or   A=/mnt/floppy,D=/mnt/cdrom'\n");          fprintf(stderr, "             or   A=/mnt/floppy,D=/mnt/cdrom'\n");
127          fprintf(stderr, "         '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n");          fprintf(stderr,
128          fprintf(stderr, "             or       LPT1=/dev/lp0,LPT2=/dev/lp1\n");                  "         '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n");
129            fprintf(stderr, "             or      LPT1=/dev/lp0,LPT2=/dev/lp1\n");
130          fprintf(stderr, "         '-r printer:mydeskjet': enable printer redirection\n");          fprintf(stderr, "         '-r printer:mydeskjet': enable printer redirection\n");
131          fprintf(stderr, "             or       mydeskjet:\"HP Laserjet IIIP\" to enter server driver as well\n");          fprintf(stderr,
132                    "             or       mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n");
133          fprintf(stderr, "         '-r sound': enable sound redirection\n");          fprintf(stderr, "         '-r sound': enable sound redirection\n");
134          fprintf(stderr, "   -0: attach to console\n");          fprintf(stderr, "   -0: attach to console\n");
135          fprintf(stderr, "   -4: use RDP version 4\n");          fprintf(stderr, "   -4: use RDP version 4\n");
# Line 748  char * Line 753  char *
753  next_arg(char *src, char needle)  next_arg(char *src, char needle)
754  {  {
755          char *nextval;          char *nextval;
756            char *p;
757            char *mvp = 0;
758    
759          // EOS          /* EOS */
760          if (*src == (char) 0x00)          if (*src == (char) 0x00)
761                  return 0;                  return 0;
762    
763          // more args available.          p = src;
764          nextval = strchr(src, needle);          /*  skip escaped needles */
765            while ((nextval = strchr(p, needle)))
766            {
767                    mvp = nextval - 1;
768                    /* found backslashed needle */
769                    if (*mvp == '\\' && (mvp > src))
770                    {
771                            /* move string one to the left */
772                            while (*(mvp + 1) != (char) 0x00)
773                            {
774                                    *mvp = *(mvp + 1);
775                                    *mvp++;
776                            }
777                            *mvp = (char) 0x00;
778                            p = nextval;
779                    }
780                    else
781                    {
782                            p = nextval + 1;
783                            break;
784                    }
785    
786            }
787    
788            /* more args available */
789          if (nextval)          if (nextval)
790          {          {
791                  *nextval = (char) 0x00;                  *nextval = (char) 0x00;
792                  return ++nextval;                  return ++nextval;
793          }          }
794    
795          // no more args after this, jump to EOS          /* no more args after this, jump to EOS */
796          nextval = src + strlen(src);          nextval = src + strlen(src);
797          return nextval;          return nextval;
798  }  }
799    
800    
801  char *  void
802  toupper(char* p)  toupper_str(char *p)
803  {  {
804          while( *p ){          while (*p)
805                  if( (*p >= 'a') && (*p <= 'z') )          {
806                          *p = *p - 32;                  if ((*p >= 'a') && (*p <= 'z'))
807                            *p = toupper((int) *p);
808                  p++;                  p++;
809          }          }
810  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26