예제 #1
0
파일: cdt_database.c 프로젝트: oracc/oracc
static void
record_writer(struct cdt_record *rp)
{
  fputs("<oracc:record>",wfile);
  list_exec(rp->fields,(list_exec_func*)field_writer);
  fputs("</oracc:record>",wfile);
}
예제 #2
0
static void
debug_each_composite_column()
{
  List *vlist;

  do_indent ();
  fprintf (ipf->output_fp, 
	   "<comp_col %d text=\"%s\" delim=\"%s\" viswidth=%d maxwidth=%d zero=%s space=%s\n", 
	   iterate_composite_column->index,
	   iterate_composite_column->text,
	   print_escaped(iterate_composite_column->delim),
	   iterate_composite_column->visible_width,
	   iterate_composite_column->maxwidth,
	   t_or_f(iterate_composite_column->zero_flag),
	   t_or_f(iterate_composite_column->space_flag));
  do_indent ();
  fprintf (ipf->output_fp, 
	   "\tcomplex_index=%d complex_columns=%d complex_has_variant=%s s_l_d=%s phant=%s>\n",
	   iterate_composite_column->complex_index,
	   iterate_composite_column->complex_columns,
	   t_or_f(iterate_composite_column->complex->complex_has_variant),
	   t_or_f(iterate_composite_column->short_line_divider),
	   t_or_f(iterate_composite_column->needs_phantom));
  do_indent ();
  fprintf (ipf->output_fp, "\tcomplex = %p\n", iterate_composite_column);
  vlist = vars_lookup2(iterate_line->name, iterate_composite_column->index);
  if (list_len(vlist))
    {
      indent += 2;
      vars_normalize_length(vlist);
      list_exec (vlist, debug_print_variant);
      indent -= 2;
    }
}
예제 #3
0
static Scheme_Object *
list_star_immutable_prim (int argc, Scheme_Object *argv[])
{
  Scheme_Object *l;
  l = list_exec(argc, argv, 1);
  scheme_make_list_immutable(l);
  return l;
}
예제 #4
0
파일: cdt_database.c 프로젝트: oracc/oracc
static void
db_writer(FILE *fp, struct cdt_node *np)
{
  struct cdt_database *db = list_first(np->children);
  wfile = fp;
  fprintf(wfile,"<oracc:data oracc:type=\"%s\">",db->type);
  list_exec(db->records,(list_exec_func *)record_writer);
  fputs("</oracc:data>",wfile);
}
예제 #5
0
int
main (int argc, char **argv)
{
  char *fn = NULL;
  List *files = list_create(LIST_SINGLE);
  while (NULL != (fn = fgets(fnbuf,_MAX_PATH,stdin)))
    {
      fn[strlen(fn)-1] = '\0';
      list_add(files,strdup(fn));
    }
  fnlist = malloc((1+files->count) * sizeof(const char *));
  findex = 0;
  list_exec(files,fn_expand);
  fnlist[findex] = NULL;

  kwic_fp = xfopen(kwic_fn,"b");
  unit_fp = xfopen(unit_f,"b");

  runexpatNS(i_list, fnlist, start_wm, end_wm, "|");

  xfclose(kwic_fn,kwic_fp;
  xfclose(unit_fn_kwic_fp);
}
예제 #6
0
파일: x2_serialize.c 프로젝트: oracc/oracc
static void
serialize_psu_list(char *key,List *lp)
{
  psu_list_lang = key;
  list_exec(lp,(list_exec_func*)serialize_one_psu);
}
예제 #7
0
int
main(int argc, char * const*argv)
{
  List *files = list_create(LIST_SINGLE);
  char *fn;
  unsigned char *key;
  FILE*keysf;
  const char *keysname, *fldsname;
  int i,top;

  f_log = stderr;

  options(argc,argv,"2c:p:s");

  if (!curr_project)
    usage();

  setlocale(LC_ALL,LOCALE);

  if (l2)
    vidp = vid_load_data(se_file(curr_project,"cat","vid.dat"));

  estp = est_init(curr_project, "cat");

  dp = dbi_create("cat",
		  se_dir(curr_project,"cat"),
		  500000,
		  sizeof(struct location8),DBI_ACCRETE);
  dbi_set_cache(dp,cache_size);
  dbi_set_user(dp,d_cat);

  progress("secatx: creating index %s\n",dp->dir);
  pqidsf = xfopen(se_file(curr_project,"cat","pqids.lst"),"w");
  fldsname = strdup(se_file(curr_project,"cat","fieldnames.tab"));
  fldsf = xfopen(fldsname,"w");
  
  for (i = 0,top=(sizeof(static_names)/sizeof(const char *))-3; 
       i < top; 
       ++i)
    {
      struct sn_tab *s = statnames(static_names[i],strlen(static_names[i]));
      fprintf(fldsf,"%s\t%d\n",static_names[i],s->uid);
    }

  if (one_big_stdin)
    {
      runexpat(i_stdin, NULL, startElement, endElement);
    }
  else
    {
      while (NULL != (fn = fgets(fnbuf,_MAX_PATH,stdin)))
	{
	  fn[strlen(fn)-1] = '\0';
	  list_add(files,strdup(fn));
	}
      fnlist = malloc(1+files->count * sizeof(const char *));
      findex = 0;
      list_exec(files,fn_expand);
      runexpat(i_list, fnlist, startElement, endElement);
    }

  dbi_flush(dp);
  dbi_free(dp);

  est_dump(estp);
  est_term(estp);

  if (l2)
    {
      vid_free(vidp);
      vidp = NULL;
    }

  progress("secatx: completed db creation\n");
  dp = dbi_open("cat",se_dir(curr_project,"cat"));
  if (dp && dp->h.entry_count > 0)
    {
      keysname = strdup(se_file(curr_project,"cat","key.lst"));
      keysf = xfopen(keysname,"w");
      while (NULL != (key = dbi_each (dp)))
#if 1
	fprintf(keysf,"%s\n",key);
#else
      fprintf(keysf,"%lu\t%s\n",(unsigned long)dp->nfound,key);
#endif
      xfclose(keysname,keysf);
    }
  else
    {
      fprintf(stderr,"secatx: no keys in input\n");
    }
  dbi_close(dp);
  xfclose(fldsname,fldsf);

  ce_cfg(curr_project, "cat", "catalog", "xmd", ce_xmd, NULL);

  return 0;
}
예제 #8
0
static Scheme_Object *
list_star_prim (int argc, Scheme_Object *argv[])
{
  return list_exec(argc, argv, 1);
}
예제 #9
0
static int
asm_exec(const char *infile, const char *outfile)
{
	list_t *l;
	const char *file;
	int rv;

	if (opt.prog_asm == NULL)
		error("No assembler is defined");

	l = list_alloc();

	list_add_file(l, opt.prog_asm, &progdirs, X_OK);

	Wflag_add(l, W_ASM);

	list_add_list(l, opt.Wa);

	{
		-p gnu
		-f <type>
#if defined(USE_YASM)
		av[na++] = "-p";
		av[na++] = "gnu";

		av[na++] = "-f";
#if defined(os_win32)
		av[na++] = "win32";
#elif defined(os_darwin)
		av[na++] = "macho";
#else
		av[na++] = "elf";
#endif
#endif

#if defined(os_sunos) && defined(mach_sparc64)
		av[na++] = "-m64";
#endif

#if defined(os_darwin)
		if (Bstatic)
			av[na++] = "-static";
#endif

#if !defined(USE_YASM)
		if (vflag)
			av[na++] = "-v";
#endif
		if (kflag)
			av[na++] = "-k";

#ifdef os_darwin
		av[na++] = "-arch";
#if mach_amd64
		av[na++] = amd64_i386 ? "i386" : "x86_64";
#else
		av[na++] = "i386";
#endif
#else
#ifdef mach_amd64
		if (amd64_i386)
			av[na++] = "--32";
#endif
#endif

		av[na++] = "-o";
		if (outfile && cflag)
			ermfile = av[na++] = outfile;
		else if (cflag)
			ermfile = av[na++] = olist[i] = setsuf(clist[i], 'o');
		else
			ermfile = av[na++] = olist[i] = gettmp();
		av[na++] = assource;
		av[na++] = 0;

		if (callsys(as, av)) {
			cflag++;
			eflag++;
			cunlink(tmp4);
			continue;
		}
	}

	if (infile != NULL)
		list_add(l, infile);
	else if (outfile != NULL)
		list_add(l, "-");

	if (outfile != NULL) {
		list_add(l, "-o");
		list_add(l, outfile);
	}

	rv = list_exec(l);
	list_free(l);
	return rv;
}