Esempio n. 1
0
FILE *font::open_file(const char *nm, char **pathp)
{
  char *filename = new char[strlen(nm) + strlen(device) + 5];
  sprintf(filename, "dev%s/%s", device, nm);
  FILE *fp = font_path.open_file(filename, pathp);
  a_delete filename;
  return fp;
}
Esempio n. 2
0
static unsigned int get_resolution(void)
{
  char *pathp;
  FILE *f;
  unsigned int res;
  f = font_path.open_file("devps/DESC", &pathp);
  a_delete pathp;
  if (f == 0)
    fatal("can't open devps/DESC");
  while (get_line(f)) {
    int n = sscanf(linebuf, "res %u", &res);
    if (n >= 1) {
      fclose(f);
      return res;
    }
  }
  fatal("can't find `res' keyword in devps/DESC");
  return 0;
}