CVS: rdesktop licence.c,1.31,1.32 rdesktop.c,1.106,1.107 rdpdr.c,1.33,1.34 secure.c,1.45,1.46 tcp.c,1.23,1.24 xkeymap.c,1.64,1.65

Jay Sorg <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26020

Modified Files:
	licence.c rdesktop.c rdpdr.c secure.c tcp.c xkeymap.c 
Log Message:
proceed more global vars with g_

Index: licence.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/licence.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** licence.c	1 Jun 2004 08:06:02 -0000	1.31
--- licence.c	15 Jun 2004 22:17:08 -0000	1.32
***************
*** 28,32 ****
  
  extern char g_username[16];
! extern char hostname[16];
  
  static uint8 g_licence_key[16];
--- 28,32 ----
  
  extern char g_username[16];
! extern char g_hostname[16];
  
  static uint8 g_licence_key[16];
***************
*** 57,61 ****
  {
  	buf_out_uint32(hwid, 2);
! 	strncpy((char *) (hwid + 4), hostname, LICENCE_HWID_SIZE - 4);
  }
  
--- 57,61 ----
  {
  	buf_out_uint32(hwid, 2);
! 	strncpy((char *) (hwid + 4), g_hostname, LICENCE_HWID_SIZE - 4);
  }
  
***************
*** 175,179 ****
  	}
  
! 	licence_send_request(null_data, null_data, g_username, hostname);
  }
  
--- 175,179 ----
  	}
  
! 	licence_send_request(null_data, null_data, g_username, g_hostname);
  }
  

Index: rdesktop.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdesktop.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** rdesktop.c	29 Apr 2004 19:40:40 -0000	1.106
--- rdesktop.c	15 Jun 2004 22:17:08 -0000	1.107
***************
*** 44,50 ****
  char g_title[64] = "";
  char g_username[64];
! char hostname[16];
  char keymapname[16];
! int keylayout = 0x409;		/* Defaults to US keyboard layout */
  
  int g_width = 800;		/* width is special: If 0, the
--- 44,50 ----
  char g_title[64] = "";
  char g_username[64];
! char g_hostname[16];
  char keymapname[16];
! int g_keylayout = 0x409;	/* Defaults to US keyboard layout */
  
  int g_width = 800;		/* width is special: If 0, the
***************
*** 54,58 ****
  				   percent of the whole screen. */
  int g_height = 600;
! int tcp_port_rdp = TCP_PORT_RDP;
  int g_server_bpp = 8;
  int g_win_button_size = 0;	/* If zero, disable single app mode */
--- 54,58 ----
  				   percent of the whole screen. */
  int g_height = 600;
! extern int g_tcp_port_rdp;
  int g_server_bpp = 8;
  int g_win_button_size = 0;	/* If zero, disable single app mode */
***************
*** 306,310 ****
  		{
  			if (*(p + 1) == ':' && *(p + 2) != '\0')
! 				tcp_port_rdp = strtol(p + 2, NULL, 10);
  			/* remove the port number and brackets from the address */
  			*p = '\0';
--- 306,310 ----
  		{
  			if (*(p + 1) == ':' && *(p + 2) != '\0')
! 				g_tcp_port_rdp = strtol(p + 2, NULL, 10);
  			/* remove the port number and brackets from the address */
  			*p = '\0';
***************
*** 318,322 ****
  		if (p != NULL)
  		{
! 			tcp_port_rdp = strtol(p + 1, NULL, 10);
  			*p = 0;
  		}
--- 318,322 ----
  		if (p != NULL)
  		{
! 			g_tcp_port_rdp = strtol(p + 1, NULL, 10);
  			*p = 0;
  		}
***************
*** 326,330 ****
  	if (p != NULL)
  	{
! 		tcp_port_rdp = strtol(p + 1, NULL, 10);
  		*p = 0;
  	}
--- 326,330 ----
  	if (p != NULL)
  	{
! 		g_tcp_port_rdp = strtol(p + 1, NULL, 10);
  		*p = 0;
  	}
***************
*** 417,421 ****
  
  			case 'n':
! 				STRNCPY(hostname, optarg, sizeof(hostname));
  				break;
  
--- 417,421 ----
  
  			case 'n':
! 				STRNCPY(g_hostname, optarg, sizeof(g_hostname));
  				break;
  
***************
*** 657,661 ****
  	}
  
! 	if (hostname[0] == 0)
  	{
  		if (gethostname(fullhostname, sizeof(fullhostname)) == -1)
--- 657,661 ----
  	}
  
! 	if (g_hostname[0] == 0)
  	{
  		if (gethostname(fullhostname, sizeof(fullhostname)) == -1)
***************
*** 669,673 ****
  			*p = 0;
  
! 		STRNCPY(hostname, fullhostname, sizeof(hostname));
  	}
  
--- 669,673 ----
  			*p = 0;
  
! 		STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
  	}
  
***************
*** 1057,1062 ****
  		return -1;
  
! 	path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
! 	sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
  
  	fd = open(path, O_RDONLY);
--- 1057,1062 ----
  		return -1;
  
! 	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);
***************
*** 1084,1088 ****
  		return;
  
! 	path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));
  
  	sprintf(path, "%s/.rdesktop", home);
--- 1084,1088 ----
  		return;
  
! 	path = (char *) xmalloc(strlen(home) + strlen(g_hostname) + sizeof("/.rdesktop/licence."));
  
  	sprintf(path, "%s/.rdesktop", home);
***************
*** 1095,1099 ****
  	/* write licence to licence.hostname.new, then atomically rename to licence.hostname */
  
! 	sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);
  	tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));
  	strcpy(tmppath, path);
--- 1095,1099 ----
  	/* write licence to licence.hostname.new, then atomically rename to licence.hostname */
  
! 	sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname);
  	tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));
  	strcpy(tmppath, path);

Index: rdpdr.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpdr.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** rdpdr.c	19 Apr 2004 09:21:25 -0000	1.33
--- rdpdr.c	15 Jun 2004 22:17:08 -0000	1.34
***************
*** 56,60 ****
  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02
  
! extern char hostname[16];
  extern DEVICE_FNS serial_fns;
  extern DEVICE_FNS printer_fns;
--- 56,60 ----
  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02
  
! extern char g_hostname[16];
  extern DEVICE_FNS serial_fns;
  extern DEVICE_FNS printer_fns;
***************
*** 206,210 ****
  	if (NULL == g_rdpdr_clientname)
  	{
! 		g_rdpdr_clientname = hostname;
  	}
  	hostlen = (strlen(g_rdpdr_clientname) + 1) * 2;
--- 206,210 ----
  	if (NULL == g_rdpdr_clientname)
  	{
! 		g_rdpdr_clientname = g_hostname;
  	}
  	hostlen = (strlen(g_rdpdr_clientname) + 1) * 2;

Index: secure.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/secure.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** secure.c	1 Jun 2004 08:06:02 -0000	1.45
--- secure.c	15 Jun 2004 22:17:08 -0000	1.46
***************
*** 34,41 ****
  #endif
  
! extern char hostname[16];
  extern int g_width;
  extern int g_height;
! extern int keylayout;
  extern BOOL g_encryption;
  extern BOOL g_licence_issued;
--- 34,41 ----
  #endif
  
! extern char g_hostname[16];
  extern int g_width;
  extern int g_height;
! extern int g_keylayout;
  extern BOOL g_encryption;
  extern BOOL g_licence_issued;
***************
*** 411,415 ****
  sec_out_mcs_data(STREAM s)
  {
! 	int hostlen = 2 * strlen(hostname);
  	int length = 158 + 76 + 12 + 4;
  	unsigned int i;
--- 411,415 ----
  sec_out_mcs_data(STREAM s)
  {
! 	int hostlen = 2 * strlen(g_hostname);
  	int length = 158 + 76 + 12 + 4;
  	unsigned int i;
***************
*** 447,455 ****
  	out_uint16_le(s, 0xca01);
  	out_uint16_le(s, 0xaa03);
! 	out_uint32_le(s, keylayout);
  	out_uint32_le(s, 2600);	/* Client build. We are now 2600 compatible :-) */
  
  	/* Unicode name of client, padded to 32 bytes */
! 	rdp_out_unistr(s, hostname, hostlen);
  	out_uint8s(s, 30 - hostlen);
  
--- 447,455 ----
  	out_uint16_le(s, 0xca01);
  	out_uint16_le(s, 0xaa03);
! 	out_uint32_le(s, g_keylayout);
  	out_uint32_le(s, 2600);	/* Client build. We are now 2600 compatible :-) */
  
  	/* Unicode name of client, padded to 32 bytes */
! 	rdp_out_unistr(s, g_hostname, hostlen);
  	out_uint8s(s, 30 - hostlen);
  

Index: tcp.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/tcp.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** tcp.c	4 Mar 2004 08:14:00 -0000	1.23
--- tcp.c	15 Jun 2004 22:17:08 -0000	1.24
***************
*** 36,40 ****
  static struct stream in;
  static struct stream out;
! extern int tcp_port_rdp;
  
  /* Initialise TCP transport data packet */
--- 36,40 ----
  static struct stream in;
  static struct stream out;
! int g_tcp_port_rdp = TCP_PORT_RDP;
  
  /* Initialise TCP transport data packet */
***************
*** 143,147 ****
  	char tcp_port_rdp_s[10];
  
! 	snprintf(tcp_port_rdp_s, 10, "%d", tcp_port_rdp);
  
  	memset(&hints, 0, sizeof(struct addrinfo));
--- 143,147 ----
  	char tcp_port_rdp_s[10];
  
! 	snprintf(tcp_port_rdp_s, 10, "%d", g_tcp_port_rdp);
  
  	memset(&hints, 0, sizeof(struct addrinfo));
***************
*** 201,205 ****
  
  	servaddr.sin_family = AF_INET;
! 	servaddr.sin_port = htons(tcp_port_rdp);
  
  	if (connect(sock, (struct sockaddr *) &servaddr, sizeof(struct sockaddr)) < 0)
--- 201,205 ----
  
  	servaddr.sin_family = AF_INET;
! 	servaddr.sin_port = htons(g_tcp_port_rdp);
  
  	if (connect(sock, (struct sockaddr *) &servaddr, sizeof(struct sockaddr)) < 0)

Index: xkeymap.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/xkeymap.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** xkeymap.c	1 Jun 2004 08:06:02 -0000	1.64
--- xkeymap.c	15 Jun 2004 22:17:08 -0000	1.65
***************
*** 41,45 ****
  extern Window g_wnd;
  extern char keymapname[16];
! extern int keylayout;
  extern int g_win_button_size;
  extern BOOL g_enable_compose;
--- 41,45 ----
  extern Window g_wnd;
  extern char keymapname[16];
! extern int g_keylayout;
  extern int g_win_button_size;
  extern BOOL g_enable_compose;
***************
*** 138,143 ****
  		if (strncmp(line, "map ", 4) == 0)
  		{
! 			keylayout = strtol(line + 4, NULL, 16);
! 			DEBUG_KBD(("Keylayout 0x%x\n", keylayout));
  			continue;
  		}
--- 138,143 ----
  		if (strncmp(line, "map ", 4) == 0)
  		{
! 			g_keylayout = strtol(line + 4, NULL, 16);
! 			DEBUG_KBD(("Keylayout 0x%x\n", g_keylayout));
  			continue;
  		}



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.