69 |
2 xpos neg, |
2 xpos neg, |
70 |
4 ypos neg */ |
4 ypos neg */ |
71 |
extern int g_tcp_port_rdp; |
extern int g_tcp_port_rdp; |
72 |
int g_server_depth = 8; |
int g_server_depth = -1; |
73 |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
int g_win_button_size = 0; /* If zero, disable single app mode */ |
74 |
BOOL g_bitmap_compression = True; |
BOOL g_bitmap_compression = True; |
75 |
BOOL g_sendmotion = True; |
BOOL g_sendmotion = True; |
84 |
BOOL g_grab_keyboard = True; |
BOOL g_grab_keyboard = True; |
85 |
BOOL g_hide_decorations = False; |
BOOL g_hide_decorations = False; |
86 |
BOOL g_use_rdp5 = True; |
BOOL g_use_rdp5 = True; |
87 |
|
BOOL g_rdpclip = True; |
88 |
BOOL g_console_session = False; |
BOOL g_console_session = False; |
89 |
BOOL g_numlock_sync = False; |
BOOL g_numlock_sync = False; |
90 |
BOOL lspci_enabled = False; |
BOOL lspci_enabled = False; |
179 |
fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); |
fprintf(stderr, " '-r printer:mydeskjet': enable printer redirection\n"); |
180 |
fprintf(stderr, |
fprintf(stderr, |
181 |
" or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); |
" or mydeskjet=\"HP LaserJet IIIP\" to enter server driver as well\n"); |
182 |
fprintf(stderr, " '-r sound:[local|off|remote]': enable sound redirection\n"); |
#ifdef WITH_RDPSND |
183 |
|
fprintf(stderr, |
184 |
|
" '-r sound:[local[:driver[:device]]|off|remote]': enable sound redirection\n"); |
185 |
fprintf(stderr, " remote would leave sound on server\n"); |
fprintf(stderr, " remote would leave sound on server\n"); |
186 |
|
fprintf(stderr, " available drivers for 'local':\n"); |
187 |
|
rdpsnd_show_help(); |
188 |
|
#endif |
189 |
|
fprintf(stderr, |
190 |
|
" '-r clipboard:[off|PRIMARYCLIPBOARD|CLIPBOARD]': enable clipboard\n"); |
191 |
|
fprintf(stderr, " redirection.\n"); |
192 |
|
fprintf(stderr, |
193 |
|
" 'PRIMARYCLIPBOARD' looks at both PRIMARY and CLIPBOARD\n"); |
194 |
|
fprintf(stderr, " when sending data to server.\n"); |
195 |
|
fprintf(stderr, " 'CLIPBOARD' looks at only CLIPBOARD.\n"); |
196 |
fprintf(stderr, " -0: attach to console\n"); |
fprintf(stderr, " -0: attach to console\n"); |
197 |
fprintf(stderr, " -4: use RDP version 4\n"); |
fprintf(stderr, " -4: use RDP version 4\n"); |
198 |
fprintf(stderr, " -5: use RDP version 5 (default)\n"); |
fprintf(stderr, " -5: use RDP version 5 (default)\n"); |
408 |
BOOL geometry_option = False; |
BOOL geometry_option = False; |
409 |
int run_count = 0; /* Session Directory support */ |
int run_count = 0; /* Session Directory support */ |
410 |
BOOL continue_connect = True; /* Session Directory support */ |
BOOL continue_connect = True; /* Session Directory support */ |
411 |
|
char *rdpsnd_optarg = NULL; |
412 |
|
|
413 |
#ifdef HAVE_LOCALE_H |
#ifdef HAVE_LOCALE_H |
414 |
/* Set locale according to environment */ |
/* Set locale according to environment */ |
661 |
|
|
662 |
if (*optarg == ':') |
if (*optarg == ':') |
663 |
{ |
{ |
664 |
*optarg++; |
optarg++; |
665 |
while ((p = next_arg(optarg, ','))) |
while ((p = next_arg(optarg, ','))) |
666 |
{ |
{ |
667 |
if (str_startswith(optarg, "remote")) |
if (str_startswith(optarg, "remote")) |
669 |
|
|
670 |
if (str_startswith(optarg, "local")) |
if (str_startswith(optarg, "local")) |
671 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
672 |
|
{ |
673 |
|
rdpsnd_optarg = |
674 |
|
next_arg(optarg, ':'); |
675 |
g_rdpsnd = True; |
g_rdpsnd = True; |
676 |
|
} |
677 |
|
|
678 |
#else |
#else |
679 |
warning("Not compiled with sound support\n"); |
warning("Not compiled with sound support\n"); |
680 |
#endif |
#endif |
724 |
g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); |
g_rdpdr_clientname = xmalloc(strlen(optarg + 11) + 1); |
725 |
strcpy(g_rdpdr_clientname, optarg + 11); |
strcpy(g_rdpdr_clientname, optarg + 11); |
726 |
} |
} |
727 |
|
else if (str_startswith(optarg, "clipboard")) |
728 |
|
{ |
729 |
|
optarg += 9; |
730 |
|
|
731 |
|
if (*optarg == ':') |
732 |
|
{ |
733 |
|
optarg++; |
734 |
|
|
735 |
|
if (str_startswith(optarg, "off")) |
736 |
|
g_rdpclip = False; |
737 |
|
else |
738 |
|
cliprdr_set_mode(optarg); |
739 |
|
} |
740 |
|
else |
741 |
|
g_rdpclip = True; |
742 |
|
} |
743 |
else |
else |
744 |
{ |
{ |
745 |
warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound\n"); |
warning("Unknown -r argument\n\n\tPossible arguments are: comport, disk, lptport, printer, sound, clipboard\n"); |
746 |
} |
} |
747 |
break; |
break; |
748 |
|
|
887 |
|
|
888 |
#ifdef WITH_RDPSND |
#ifdef WITH_RDPSND |
889 |
if (g_rdpsnd) |
if (g_rdpsnd) |
890 |
rdpsnd_init(); |
{ |
891 |
|
if (!rdpsnd_init(rdpsnd_optarg)) |
892 |
|
{ |
893 |
|
warning("Initializing sound-support failed!\n"); |
894 |
|
} |
895 |
|
} |
896 |
#endif |
#endif |
897 |
|
|
898 |
if (lspci_enabled) |
if (lspci_enabled) |
1079 |
return mem; |
return mem; |
1080 |
} |
} |
1081 |
|
|
1082 |
|
/* Exit on NULL pointer. Use to verify result from XGetImage etc */ |
1083 |
|
void |
1084 |
|
exit_if_null(void *ptr) |
1085 |
|
{ |
1086 |
|
if (ptr == NULL) |
1087 |
|
{ |
1088 |
|
error("unexpected null pointer. Out of memory?\n"); |
1089 |
|
exit(1); |
1090 |
|
} |
1091 |
|
} |
1092 |
|
|
1093 |
/* strdup */ |
/* strdup */ |
1094 |
char * |
char * |
1095 |
xstrdup(const char *s) |
xstrdup(const char *s) |
1238 |
while (*(mvp + 1) != (char) 0x00) |
while (*(mvp + 1) != (char) 0x00) |
1239 |
{ |
{ |
1240 |
*mvp = *(mvp + 1); |
*mvp = *(mvp + 1); |
1241 |
*mvp++; |
mvp++; |
1242 |
} |
} |
1243 |
*mvp = (char) 0x00; |
*mvp = (char) 0x00; |
1244 |
p = nextval; |
p = nextval; |