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; |
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"); |
120 |
fprintf(stderr, " -N: enable numlock syncronization\n"); |
fprintf(stderr, " -N: enable numlock syncronization\n"); |
121 |
fprintf(stderr, " -a: connection colour depth\n"); |
fprintf(stderr, " -a: connection colour depth\n"); |
122 |
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"); |
123 |
fprintf(stderr, " '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); |
fprintf(stderr, |
124 |
|
" '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n"); |
125 |
fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n"); |
fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n"); |
126 |
fprintf(stderr, " '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n"); |
fprintf(stderr, |
127 |
|
" '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n"); |
128 |
fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n"); |
fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n"); |
129 |
fprintf(stderr, " '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n"); |
fprintf(stderr, |
130 |
|
" '-r lptport:LPT1=/dev/lp0': enable parallel redirection of /dev/lp0 to LPT1\n"); |
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, " or mydeskjet:\"HP Laserjet IIIP\" to enter server driver as well\n"); |
fprintf(stderr, |
134 |
|
" 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': enable sound redirection\n"); |
136 |
fprintf(stderr, " -0: attach to console\n"); |
fprintf(stderr, " -0: attach to console\n"); |
137 |
fprintf(stderr, " -4: use RDP version 4\n"); |
fprintf(stderr, " -4: use RDP version 4\n"); |
253 |
#define VNCOPT |
#define VNCOPT |
254 |
#endif |
#endif |
255 |
|
|
256 |
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) |
257 |
{ |
{ |
258 |
switch (c) |
switch (c) |
259 |
{ |
{ |
349 |
g_orders = False; |
g_orders = False; |
350 |
break; |
break; |
351 |
|
|
352 |
|
case 'B': |
353 |
|
g_ownbackstore = False; |
354 |
|
break; |
355 |
|
|
356 |
case 'e': |
case 'e': |
357 |
g_encryption = False; |
g_encryption = False; |
358 |
break; |
break; |
463 |
} |
} |
464 |
} |
} |
465 |
|
|
466 |
if (argc - optind < 1) |
if (argc - optind != 1) |
467 |
{ |
{ |
468 |
usage(argv[0]); |
usage(argv[0]); |
469 |
return 1; |
return 1; |
738 |
} |
} |
739 |
|
|
740 |
/* |
/* |
741 |
input: src is the string we look in for needle |
input: src is the string we look in for needle. |
742 |
|
Needle may be escaped by a backslash, in |
743 |
|
that case we ignore that particular needle. |
744 |
return value: returns next src pointer, for |
return value: returns next src pointer, for |
745 |
succesive executions, like in a while loop |
succesive executions, like in a while loop |
746 |
if retval is 0, then there are no more args. |
if retval is 0, then there are no more args. |
770 |
|
|
771 |
p = src; |
p = src; |
772 |
/* skip escaped needles */ |
/* skip escaped needles */ |
773 |
while( (nextval = strchr(p, needle) ) ) |
while ((nextval = strchr(p, needle))) |
774 |
{ |
{ |
775 |
mvp = nextval - 1; |
mvp = nextval - 1; |
776 |
/* found backslashed needle */ |
/* found backslashed needle */ |
777 |
if( *mvp == '\\' && (mvp > src) ) |
if (*mvp == '\\' && (mvp > src)) |
778 |
{ |
{ |
779 |
/* move string one to the left */ |
/* move string one to the left */ |
780 |
while( *(mvp+1) != (char)0x00 ) |
while (*(mvp + 1) != (char) 0x00) |
781 |
{ |
{ |
782 |
*mvp = *(mvp+1); |
*mvp = *(mvp + 1); |
783 |
*mvp++; |
*mvp++; |
784 |
} |
} |
785 |
*mvp = (char)0x00; |
*mvp = (char) 0x00; |
786 |
p = nextval; |
p = nextval; |
787 |
} |
} |
788 |
else |
else |
789 |
{ |
{ |
790 |
p = nextval +1; |
p = nextval + 1; |
791 |
break; |
break; |
792 |
} |
} |
793 |
|
|
807 |
|
|
808 |
|
|
809 |
void |
void |
810 |
toupper_str(char* p) |
toupper_str(char *p) |
811 |
{ |
{ |
812 |
while( *p ){ |
while (*p) |
813 |
if( (*p >= 'a') && (*p <= 'z') ) |
{ |
814 |
|
if ((*p >= 'a') && (*p <= 'z')) |
815 |
*p = toupper((int) *p); |
*p = toupper((int) *p); |
816 |
p++; |
p++; |
817 |
} |
} |
822 |
#define LTOA_BUFSIZE (sizeof(long) * 8 + 1) |
#define LTOA_BUFSIZE (sizeof(long) * 8 + 1) |
823 |
|
|
824 |
char * |
char * |
825 |
ltoa(long N, int base) |
l_to_a(long N, int base) |
826 |
{ |
{ |
827 |
static char ret[LTOA_BUFSIZE]; |
static char ret[LTOA_BUFSIZE]; |
828 |
|
|
829 |
register int i = 2; |
char *head = ret, buf[LTOA_BUFSIZE], *tail = buf + sizeof(buf); |
|
long uarg; |
|
|
char *tail, *head = ret, buf[LTOA_BUFSIZE]; |
|
830 |
|
|
831 |
if (36 < base || 2 > base) |
register int divrem; |
|
base = 10; |
|
832 |
|
|
833 |
tail = &buf[LTOA_BUFSIZE - 1]; |
if (base < 36 || 2 > base) |
834 |
*tail-- = '\0'; |
base = 10; |
835 |
|
|
836 |
if (10 == base && N < 0L) |
if (N < 0) |
837 |
{ |
{ |
838 |
*head++ = '-'; |
*head++ = '-'; |
839 |
uarg = -N; |
N = -N; |
840 |
} |
} |
|
else |
|
|
uarg = N; |
|
841 |
|
|
842 |
if (uarg) |
tail = buf + sizeof(buf); |
843 |
{ |
*--tail = 0; |
|
for (i = 1; uarg; ++i) |
|
|
{ |
|
|
register ldiv_t r; |
|
844 |
|
|
845 |
r = ldiv(uarg, base); |
do |
846 |
*tail-- = (char) (r.rem + ((9L < r.rem) ? ('A' - 10L) : '0')); |
{ |
847 |
uarg = r.quot; |
divrem = N % base; |
848 |
} |
*--tail = (divrem <= 9) ? divrem + '0' : divrem + 'a' - 10; |
849 |
|
N /= base; |
850 |
} |
} |
851 |
else |
while (N); |
|
*tail-- = '0'; |
|
852 |
|
|
853 |
memcpy(head, ++tail, i); |
strcpy(head, tail); |
854 |
return ret; |
return ret; |
855 |
} |
} |
856 |
|
|