Difference for x11/xutil.c from version 1.12 to 1.13


version 1.12 version 1.13
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_xutil_c =   * static char *rcsid_xutil_c =
  *   "$Id: xutil.c,v 1.12 2004/01/26 16:54:34 tchize Exp $";   *   "$Id: xutil.c,v 1.13 2004/01/30 13:30:58 tchize Exp $";
  */   */
 /*  /*
     Crossfire client, a client program for the crossfire program.      Crossfire client, a client program for the crossfire program.
Line 247
 
Line 247
     int i, direction=-1;      int i, direction=-1;
   
     if (keycode>MAX_KEYCODE) {      if (keycode>MAX_KEYCODE) {
  fprintf(stderr,"Warning insert_key:keycode that is passed is greater than 255.\n");   LOG(LOG_WARNING,"x11::insert_key", "keycode that is passed is greater than 255.");
  keycode=0; /* hopefully the rest of the data is OK */   keycode=0; /* hopefully the rest of the data is OK */
     }      }
     if (keys[keycode]==NULL) {      if (keys[keycode]==NULL) {
Line 302
 
Line 302
   
     if (buf[0]=='#' || buf[0]=='\n') return;      if (buf[0]=='#' || buf[0]=='\n') return;
     if ((cpnext = strchr(buf,' '))==NULL) {      if ((cpnext = strchr(buf,' '))==NULL) {
  fprintf(stderr,"Line %d (%s) corrupted in keybinding file.\n", line,buf);   LOG(LOG_WARNING,"x11::parse_keybind_line","Line %d (%s) corrupted.", line,buf);
  return;   return;
     }      }
     /* Special keybinding line */      /* Special keybinding line */
Line 311
 
Line 311
  while (*cpnext == ' ') ++cpnext;   while (*cpnext == ' ') ++cpnext;
  cp = strchr(cpnext, ' ');   cp = strchr(cpnext, ' ');
  if (!cp) {   if (!cp) {
      fprintf(stderr,"Line %d (%s) corrupted in keybinding file.\n", line,buf);       LOG(LOG_WARNING,"x11::parse_keybind_line","Line %d (%s) corrupted in keybinding file.", line,buf);
      return;       return;
  }   }
  *cp++ = 0;  /* Null terminate it */   *cp++ = 0;  /* Null terminate it */
  cp1 = strchr(cp, ' ');   cp1 = strchr(cp, ' ');
  if (!cp1) {   if (!cp1) {
      fprintf(stderr,"Line %d (%s) corrupted in keybinding file.\n", line,buf);       LOG(LOG_WARNING,"x11::parse_keybind_line","Line %d (%s) corrupted in keybinding file.", line,buf);
      return;       return;
  }   }
  *cp1 ++ = 0;/* Null terminate it */   *cp1 ++ = 0;/* Null terminate it */
Line 325
 
Line 325
  keysym = XStringToKeysym(cp);   keysym = XStringToKeysym(cp);
  /* As of now, all these keys must have keysyms */   /* As of now, all these keys must have keysyms */
  if (keysym == NoSymbol) {   if (keysym == NoSymbol) {
      fprintf(stderr,"Could not convert %s into keysym\n", cp);       LOG(LOG_WARNING,"x11::parse_keybind_line","Could not convert %s into keysym", cp);
      return;       return;
  }   }
  if (!strcmp(cpnext,"commandkey")) {   if (!strcmp(cpnext,"commandkey")) {
Line 376
 
Line 376
     keysym = XStringToKeysym(buf);      keysym = XStringToKeysym(buf);
     cp = cpnext;      cp = cpnext;
     if ((cpnext = strchr(cp,' '))==NULL) {      if ((cpnext = strchr(cp,' '))==NULL) {
  fprintf(stderr,"Line %d (%s) corrupted in keybinding file.\n", line, cp);   LOG(LOG_WARNING,"x11::parse_keybind_line","Line %d (%s) corrupted in keybinding file.", line, cp);
  return;   return;
     }      }
     *cpnext++ = '\0';      *cpnext++ = '\0';
Line 385
 
Line 385
     keycode = atoi(cp);      keycode = atoi(cp);
     cp = cpnext;      cp = cpnext;
     if ((cpnext = strchr(cp,' '))==NULL) {      if ((cpnext = strchr(cp,' '))==NULL) {
  fprintf(stderr,"Line %d (%s) corrupted in keybinding file.\n", line, cp);   LOG(LOG_WARNING,"x11::parse_keybind_line","Line %d (%s) corrupted in keybinding file.", line, cp);
  return;   return;
     }      }
     *cpnext++ = '\0';      *cpnext++ = '\0';
Line 411
 
Line 411
  flags |= KEYF_STANDARD;   flags |= KEYF_STANDARD;
  break;   break;
  default:   default:
      fprintf(stderr,"Warning:  Unknown flag (%c) line %d in key binding file\n",       LOG(LOG_WARNING,"x11::parse_keybind_line","Unknown flag (%c) line %d in key binding file",
  *cp, line);   *cp, line);
         }          }
         cp++;          cp++;
Line 434
 
Line 434
          * it away, but at least print a warning message.           * it away, but at least print a warning message.
          */           */
         if (keycode==0) {          if (keycode==0) {
      fprintf(stderr,"Warning: could not convert keysym %s into keycode, ignoring\n",       LOG(LOG_WARNING,"x11::parse_keybind_line","could not convert keysym %s into keycode, ignoring",
  buf);   buf);
  }   }
     }      }
Line 516
 
Line 516
   
     sprintf(buf,"%s/.crossfire/keys", getenv("HOME"));      sprintf(buf,"%s/.crossfire/keys", getenv("HOME"));
     if ((fp=fopen(buf,"r"))==NULL) {      if ((fp=fopen(buf,"r"))==NULL) {
  fprintf(stderr,"Could not open ~/.crossfire/keys, trying to load global bindings\n");   LOG(LOG_INFO,"x11::init_keys","Could not open ~/.crossfire/keys, trying to load global bindings");
  if (client_libdir==NULL) {   if (client_libdir==NULL) {
      init_default_keybindings();       init_default_keybindings();
      return;       return;
Line 951
 
Line 951
   
     sprintf(buf,"%s/.crossfire/keys", getenv("HOME"));      sprintf(buf,"%s/.crossfire/keys", getenv("HOME"));
     if (make_path_to_file(buf)==-1) {      if (make_path_to_file(buf)==-1) {
  fprintf(stderr,"Could not create %s\n", buf);   LOG(LOG_WARNING,"x11::save_keys","Could not create %s", buf);
  return;   return;
     }      }
     if ((fp=fopen(buf,"w"))==NULL) {      if ((fp=fopen(buf,"w"))==NULL) {
Line 1110
 
Line 1110
  goto unbinded;   goto unbinded;
      }       }
  }   }
  fprintf(stderr,"unbind_key - found number entry, but could not find actual key\n");   LOG(LOG_ERROR,"x11::unbind_key","found number entry, but could not find actual key");
      }       }
  }   }
     }      }


Legend:
line(s) removed in v.1.12 
line(s) changed
 line(s) added in v.1.13

File made using version 1.96 of cvs2html by leaf at 2006-02-16 21:08