--- sourceforge.net/trunk/rdesktop/rdesktop.c 2004/04/20 07:01:21 676 +++ sourceforge.net/trunk/rdesktop/rdesktop.c 2004/06/15 22:17:08 710 @@ -43,9 +43,9 @@ char g_title[64] = ""; char g_username[64]; -char hostname[16]; +char g_hostname[16]; char keymapname[16]; -int keylayout = 0x409; /* Defaults to US keyboard layout */ +int g_keylayout = 0x409; /* Defaults to US keyboard layout */ int g_width = 800; /* width is special: If 0, the geometry will be fetched from @@ -53,12 +53,12 @@ absolute value specifies the percent of the whole screen. */ int g_height = 600; -int tcp_port_rdp = TCP_PORT_RDP; +extern int g_tcp_port_rdp; int g_server_bpp = 8; int g_win_button_size = 0; /* If zero, disable single app mode */ BOOL g_bitmap_compression = True; BOOL g_sendmotion = True; -BOOL g_orders = True; +BOOL g_bitmap_cache = True; BOOL g_encryption = True; BOOL packet_encryption = True; BOOL g_desktop_save = True; @@ -305,7 +305,7 @@ if (*server == '[' && p != NULL) { if (*(p + 1) == ':' && *(p + 2) != '\0') - tcp_port_rdp = strtol(p + 2, NULL, 10); + g_tcp_port_rdp = strtol(p + 2, NULL, 10); /* remove the port number and brackets from the address */ *p = '\0'; strncpy(server, server + 1, strlen(server)); @@ -317,7 +317,7 @@ p = strchr(server, ':'); if (p != NULL) { - tcp_port_rdp = strtol(p + 1, NULL, 10); + g_tcp_port_rdp = strtol(p + 1, NULL, 10); *p = 0; } } @@ -325,7 +325,7 @@ p = strchr(server, ':'); if (p != NULL) { - tcp_port_rdp = strtol(p + 1, NULL, 10); + g_tcp_port_rdp = strtol(p + 1, NULL, 10); *p = 0; } #endif /* IPv6 */ @@ -416,7 +416,7 @@ break; case 'n': - STRNCPY(hostname, optarg, sizeof(hostname)); + STRNCPY(g_hostname, optarg, sizeof(g_hostname)); break; case 'k': @@ -457,7 +457,7 @@ break; case 'b': - g_orders = False; + g_bitmap_cache = False; break; case 'B': @@ -569,7 +569,11 @@ #endif if (strncmp("off", optarg, 3) == 0) +#ifdef WITH_RDPSND g_rdpsnd = False; +#else + warning("Not compiled with sound support"); +#endif optarg = p; } @@ -652,7 +656,7 @@ STRNCPY(g_username, pw->pw_name, sizeof(g_username)); } - if (hostname[0] == 0) + if (g_hostname[0] == 0) { if (gethostname(fullhostname, sizeof(fullhostname)) == -1) { @@ -664,7 +668,7 @@ if (p != NULL) *p = 0; - STRNCPY(hostname, fullhostname, sizeof(hostname)); + STRNCPY(g_hostname, fullhostname, sizeof(g_hostname)); } if (prompt_password && read_password(password, sizeof(password))) @@ -1052,8 +1056,8 @@ if (home == NULL) return -1; - path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence.")); - sprintf(path, "%s/.rdesktop/licence.%s", home, hostname); + path = (char *) xmalloc(strlen(home) + strlen(g_hostname) + sizeof("/.rdesktop/licence.")); + sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname); fd = open(path, O_RDONLY); if (fd == -1) @@ -1079,7 +1083,7 @@ if (home == NULL) return; - path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence.")); + path = (char *) xmalloc(strlen(home) + strlen(g_hostname) + sizeof("/.rdesktop/licence.")); sprintf(path, "%s/.rdesktop", home); if ((mkdir(path, 0700) == -1) && errno != EEXIST) @@ -1090,7 +1094,7 @@ /* write licence to licence.hostname.new, then atomically rename to licence.hostname */ - sprintf(path, "%s/.rdesktop/licence.%s", home, hostname); + sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname); tmppath = (char *) xmalloc(strlen(path) + sizeof(".new")); strcpy(tmppath, path); strcat(tmppath, ".new");