rfbLogEnable(1);
void initialize_remap(char *infile) {	FILE *in;	char *p, *q, line[256];	if (keyremaps != NULL) {		/* free last remapping */		keyremap_t *next_remap, *curr_remap = keyremaps;		while (curr_remap != NULL) {			next_remap = curr_remap->next;			free(curr_remap);			curr_remap = next_remap;		}		keyremaps = NULL;	}	if (infile == NULL || *infile == '\0') {		/* just unset remapping */		return;	}	in = fopen(infile, "r"); 	if (in == NULL) {		/* assume cmd line key1-key2,key3-key4 */		if (strstr(infile, "DEAD") == infile) {			;		} else if (!strchr(infile, '-')) {			rfbLog("remap: cannot open: %s\n", infile);			rfbLogPerror("fopen");			clean_up_exit(1);		}		if ((in = tmpfile()) == NULL) {			rfbLog("remap: cannot open tmpfile for %s\n", infile);			rfbLogPerror("tmpfile");			clean_up_exit(1);		}		/* copy in the string to file format */		p = infile;		while (*p) {			if (*p == '-') {				fprintf(in, " ");			} else if (*p == ',' || *p == ' ' ||  *p == '\t') {				fprintf(in, "\n");			} else {				fprintf(in, "%c", *p);			}			p++;		}		fprintf(in, "\n");		fflush(in);			rewind(in);	}	while (fgets(line, 256, in) != NULL) {		p = lblanks(line);		if (*p == '\0') {			continue;		}		if (strchr(line, '#')) {			continue;		}		if (strstr(p, "DEAD") == p)  {			add_dead_keysyms(p);			continue;		}		if ((q = strchr(line, '-')) != NULL) {			/* allow Keysym1-Keysym2 notation */			*q = ' ';			}		add_remap(p);	}	fclose(in);}