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 */ |
#include <ctype.h> /* toupper */ |
|
#include <limits.h> /* PATH_MAX */ |
|
30 |
#include <errno.h> |
#include <errno.h> |
31 |
#include "rdesktop.h" |
#include "rdesktop.h" |
32 |
|
|
605 |
break; |
break; |
606 |
|
|
607 |
case 'x': |
case 'x': |
608 |
if (strncmp("modem", optarg, 1) == 0) |
if (str_startswith(optarg, "m")) /* modem */ |
609 |
{ |
{ |
610 |
g_rdp5_performanceflags = |
g_rdp5_performanceflags = |
611 |
RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | |
RDP5_NO_WALLPAPER | RDP5_NO_FULLWINDOWDRAG | |
612 |
RDP5_NO_MENUANIMATIONS | RDP5_NO_THEMING; |
RDP5_NO_MENUANIMATIONS | RDP5_NO_THEMING; |
613 |
} |
} |
614 |
else if (strncmp("broadband", optarg, 1) == 0) |
else if (str_startswith(optarg, "b")) /* broadband */ |
615 |
{ |
{ |
616 |
g_rdp5_performanceflags = RDP5_NO_WALLPAPER; |
g_rdp5_performanceflags = RDP5_NO_WALLPAPER; |
617 |
} |
} |
618 |
else if (strncmp("lan", optarg, 1) == 0) |
else if (str_startswith(optarg, "l")) /* lan */ |
619 |
{ |
{ |
620 |
g_rdp5_performanceflags = RDP5_DISABLE_NOTHING; |
g_rdp5_performanceflags = RDP5_DISABLE_NOTHING; |
621 |
} |
} |
631 |
|
|
632 |
case 'r': |
case 'r': |
633 |
|
|
634 |
if (strncmp("sound", optarg, 5) == 0) |
if (str_startswith(optarg, "sound")) |
635 |
{ |
{ |
636 |
optarg += 5; |
optarg += 5; |
637 |
|
|
640 |
*optarg++; |
*optarg++; |
641 |
while ((p = next_arg(optarg, ','))) |
while ((p = next_arg(optarg, ','))) |
642 |
{ |
{ |
643 |
if (strncmp("remote", optarg, 6) == 0) |
if (str_startswith(optarg, "remote")) |
644 |
flags |= RDP_LOGON_LEAVE_AUDIO; |
flags |= RDP_LOGON_LEAVE_AUDIO; |
645 |
|
|
646 |
if (strncmp("local", optarg, 5) == 0) |
if (str_startswith(optarg, "local")) |
647 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
648 |
g_rdpsnd = True; |
g_rdpsnd = True; |
649 |
#else |
#else |
650 |
warning("Not compiled with sound support\n"); |
warning("Not compiled with sound support\n"); |
651 |
#endif |
#endif |
652 |
|
|
653 |
if (strncmp("off", optarg, 3) == 0) |
if (str_startswith(optarg, "off")) |
654 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
655 |
g_rdpsnd = False; |
g_rdpsnd = False; |
656 |
#else |
#else |
669 |
#endif |
#endif |
670 |
} |
} |
671 |
} |
} |
672 |
else if (strncmp("disk", optarg, 4) == 0) |
else if (str_startswith(optarg, "disk")) |
673 |
{ |
{ |
674 |
/* -r disk:h:=/mnt/floppy */ |
/* -r disk:h:=/mnt/floppy */ |
675 |
disk_enum_devices(&g_num_devices, optarg + 4); |
disk_enum_devices(&g_num_devices, optarg + 4); |
676 |
} |
} |
677 |
else if (strncmp("comport", optarg, 7) == 0) |
else if (str_startswith(optarg, "comport")) |
678 |
{ |
{ |
679 |
serial_enum_devices(&g_num_devices, optarg + 7); |
serial_enum_devices(&g_num_devices, optarg + 7); |
680 |
} |
} |
681 |
else if (strncmp("lptport", optarg, 7) == 0) |
else if (str_startswith(optarg, "lptport")) |
682 |
{ |
{ |
683 |
parallel_enum_devices(&g_num_devices, optarg + 7); |
parallel_enum_devices(&g_num_devices, optarg + 7); |
684 |
} |
} |
685 |
else if (strncmp("printer", optarg, 7) == 0) |
else if (str_startswith(optarg, "printer")) |
686 |
{ |
{ |
687 |
printer_enum_devices(&g_num_devices, optarg + 7); |
printer_enum_devices(&g_num_devices, optarg + 7); |
688 |
} |
} |
689 |
else if (strncmp("clientname", optarg, 7) == 0) |
else if (str_startswith(optarg, "clientname")) |
690 |
{ |
{ |
691 |
g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); |
g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); |
692 |
strcpy(g_rdpdr_clientname, optarg + 11); |
strcpy(g_rdpdr_clientname, optarg + 11); |
1170 |
} |
} |
1171 |
|
|
1172 |
|
|
1173 |
|
BOOL |
1174 |
|
str_startswith(const char *s, const char *prefix) |
1175 |
|
{ |
1176 |
|
return (strncmp(s, prefix, strlen(prefix)) == 0); |
1177 |
|
} |
1178 |
|
|
1179 |
|
|
1180 |
/* not all clibs got ltoa */ |
/* not all clibs got ltoa */ |
1181 |
#define LTOA_BUFSIZE (sizeof(long) * 8 + 1) |
#define LTOA_BUFSIZE (sizeof(long) * 8 + 1) |
1182 |
|
|