/[rdesktop]/sourceforge.net/trunk/rdesktop/rdesktop.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdesktop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 685 by stargo, Thu Apr 29 19:40:40 2004 UTC revision 710 by jsorg71, Tue Jun 15 22:17:08 2004 UTC
# Line 43  Line 43 
43    
44  char g_title[64] = "";  char g_title[64] = "";
45  char g_username[64];  char g_username[64];
46  char hostname[16];  char g_hostname[16];
47  char keymapname[16];  char keymapname[16];
48  int keylayout = 0x409;          /* Defaults to US keyboard layout */  int g_keylayout = 0x409;        /* Defaults to US keyboard layout */
49    
50  int g_width = 800;              /* width is special: If 0, the  int g_width = 800;              /* width is special: If 0, the
51                                     geometry will be fetched from                                     geometry will be fetched from
# Line 53  int g_width = 800;             /* width is special: Line 53  int g_width = 800;             /* width is special:
53                                     absolute value specifies the                                     absolute value specifies the
54                                     percent of the whole screen. */                                     percent of the whole screen. */
55  int g_height = 600;  int g_height = 600;
56  int tcp_port_rdp = TCP_PORT_RDP;  extern int g_tcp_port_rdp;
57  int g_server_bpp = 8;  int g_server_bpp = 8;
58  int g_win_button_size = 0;      /* If zero, disable single app mode */  int g_win_button_size = 0;      /* If zero, disable single app mode */
59  BOOL g_bitmap_compression = True;  BOOL g_bitmap_compression = True;
# Line 305  parse_server_and_port(char *server) Line 305  parse_server_and_port(char *server)
305                  if (*server == '[' && p != NULL)                  if (*server == '[' && p != NULL)
306                  {                  {
307                          if (*(p + 1) == ':' && *(p + 2) != '\0')                          if (*(p + 1) == ':' && *(p + 2) != '\0')
308                                  tcp_port_rdp = strtol(p + 2, NULL, 10);                                  g_tcp_port_rdp = strtol(p + 2, NULL, 10);
309                          /* remove the port number and brackets from the address */                          /* remove the port number and brackets from the address */
310                          *p = '\0';                          *p = '\0';
311                          strncpy(server, server + 1, strlen(server));                          strncpy(server, server + 1, strlen(server));
# Line 317  parse_server_and_port(char *server) Line 317  parse_server_and_port(char *server)
317                  p = strchr(server, ':');                  p = strchr(server, ':');
318                  if (p != NULL)                  if (p != NULL)
319                  {                  {
320                          tcp_port_rdp = strtol(p + 1, NULL, 10);                          g_tcp_port_rdp = strtol(p + 1, NULL, 10);
321                          *p = 0;                          *p = 0;
322                  }                  }
323          }          }
# Line 325  parse_server_and_port(char *server) Line 325  parse_server_and_port(char *server)
325          p = strchr(server, ':');          p = strchr(server, ':');
326          if (p != NULL)          if (p != NULL)
327          {          {
328                  tcp_port_rdp = strtol(p + 1, NULL, 10);                  g_tcp_port_rdp = strtol(p + 1, NULL, 10);
329                  *p = 0;                  *p = 0;
330          }          }
331  #endif /* IPv6 */  #endif /* IPv6 */
# Line 416  main(int argc, char *argv[]) Line 416  main(int argc, char *argv[])
416                                  break;                                  break;
417    
418                          case 'n':                          case 'n':
419                                  STRNCPY(hostname, optarg, sizeof(hostname));                                  STRNCPY(g_hostname, optarg, sizeof(g_hostname));
420                                  break;                                  break;
421    
422                          case 'k':                          case 'k':
# Line 656  main(int argc, char *argv[]) Line 656  main(int argc, char *argv[])
656                  STRNCPY(g_username, pw->pw_name, sizeof(g_username));                  STRNCPY(g_username, pw->pw_name, sizeof(g_username));
657          }          }
658    
659          if (hostname[0] == 0)          if (g_hostname[0] == 0)
660          {          {
661                  if (gethostname(fullhostname, sizeof(fullhostname)) == -1)                  if (gethostname(fullhostname, sizeof(fullhostname)) == -1)
662                  {                  {
# Line 668  main(int argc, char *argv[]) Line 668  main(int argc, char *argv[])
668                  if (p != NULL)                  if (p != NULL)
669                          *p = 0;                          *p = 0;
670    
671                  STRNCPY(hostname, fullhostname, sizeof(hostname));                  STRNCPY(g_hostname, fullhostname, sizeof(g_hostname));
672          }          }
673    
674          if (prompt_password && read_password(password, sizeof(password)))          if (prompt_password && read_password(password, sizeof(password)))
# Line 1056  load_licence(unsigned char **data) Line 1056  load_licence(unsigned char **data)
1056          if (home == NULL)          if (home == NULL)
1057                  return -1;                  return -1;
1058    
1059          path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));          path = (char *) xmalloc(strlen(home) + strlen(g_hostname) + sizeof("/.rdesktop/licence."));
1060          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);          sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname);
1061    
1062          fd = open(path, O_RDONLY);          fd = open(path, O_RDONLY);
1063          if (fd == -1)          if (fd == -1)
# Line 1083  save_licence(unsigned char *data, int le Line 1083  save_licence(unsigned char *data, int le
1083          if (home == NULL)          if (home == NULL)
1084                  return;                  return;
1085    
1086          path = (char *) xmalloc(strlen(home) + strlen(hostname) + sizeof("/.rdesktop/licence."));          path = (char *) xmalloc(strlen(home) + strlen(g_hostname) + sizeof("/.rdesktop/licence."));
1087    
1088          sprintf(path, "%s/.rdesktop", home);          sprintf(path, "%s/.rdesktop", home);
1089          if ((mkdir(path, 0700) == -1) && errno != EEXIST)          if ((mkdir(path, 0700) == -1) && errno != EEXIST)
# Line 1094  save_licence(unsigned char *data, int le Line 1094  save_licence(unsigned char *data, int le
1094    
1095          /* write licence to licence.hostname.new, then atomically rename to licence.hostname */          /* write licence to licence.hostname.new, then atomically rename to licence.hostname */
1096    
1097          sprintf(path, "%s/.rdesktop/licence.%s", home, hostname);          sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname);
1098          tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));          tmppath = (char *) xmalloc(strlen(path) + sizeof(".new"));
1099          strcpy(tmppath, path);          strcpy(tmppath, path);
1100          strcat(tmppath, ".new");          strcat(tmppath, ".new");

Legend:
Removed from v.685  
changed lines
  Added in v.710

  ViewVC Help
Powered by ViewVC 1.1.26