}
static CHARMAP *parse_charmap_header(FILE *fp, const char *prefix){  char buffer[1024];  char *t, *u;  CHARMAP *m = charmap_new();    while(fgets(buffer, sizeof(buffer), fp))  {    if((t = strchr(buffer, '\n')))      *t = '\0';    else    {      fprintf(stderr, "%s: Line too long.", prefix);      charmap_free(&m);      return NULL;    }    if(!strncmp(buffer, "CHARMAP", 7))      break;    if(*buffer == m->comment_char)      continue;        if(!(t = strtok(buffer, "\t ")))      continue;        if(!(u = strtok(NULL, "\t ")))    {      fprintf(stderr, "%s: Syntax error.\n", prefix);      charmap_free(&m);      return NULL;    }    if(!strcmp(t, "<code_set_name>"))    {      safe_free((void **) &m->charset);      canonical_charset(u, strlen(u) + 1, u);      m->charset = safe_strdup(u);#ifdef DEBUG      fprintf(stderr, "code_set_name: `%s'\n", m->charset);#endif    }    else if(!strcmp(t, "<comment_char>"))    {      m->comment_char = *u;#ifdef DEBUG      fprintf(stderr, "comment_char: `%c'\n", m->comment_char);#endif    }    else if(!strcmp(t, "<escape_char>"))    {      m->escape_char = *u;#ifdef DEBUG      fprintf(stderr, "escape_char: `%c'\n", m->escape_char);#endif    }  }    return m;}