예제 #1
0
파일: slibu.c 프로젝트: UlricE/SiagOffice
int assemble_options(LISP l, ...)
{int result = 0,val,noptions,nmask = 0;
 LISP lsym,lp = NIL;
 char *sym;
 va_list syms;
 if NULLP(l) return(0);
 noptions = CONSP(l) ? get_c_long(llength(l)) : -1;
 va_start(syms,l);
 while((sym = va_arg(syms,char *)))
   {val = va_arg(syms,int);
    lsym = cintern(sym);
    if (EQ(l,lsym) || (CONSP(l) && NNULLP(lp = memq(lsym,l))))
      {result |= val;
       if (noptions > 0)
	 nmask = nmask | (1 << (noptions - get_c_long(llength(lp))));
       else
	 noptions = -2;}}
 va_end(syms);
 if ((noptions == -1) ||
     ((noptions > 0) && (nmask != ((1 << noptions) - 1))))
   err("contains undefined options",l);
 return(result);}
예제 #2
0
파일: main.c 프로젝트: UlricE/SiagOffice
void realmain(int argc, char **argv)
{
	char b[256];
	struct stat statbuf;
	/* vars from oldmain */
	buffer *buf = NULL;
	char path[1024];
	int i;

	setlocale(LC_NUMERIC, "C");
	common_init("Egon Animator %s. No Warranty");

	sprintf(b, "%s/%ld", siag_basedir, (long)getpid());
	mkdir(b, 0700);
	sprintf(b, "%s/egon.scm", siag_basedir);
	egonrc = MwStrdup(b);

	init_interpreters();
	siod_interpreter = init_parser(argc, argv);
	init_python_parser();
	init_guile_parser();
	init_ruby_parser();
	waitforchild(0);

	init_position();
	init_cmds();

	buf = new_buffer("noname.egon", "noname.egon");

	sprintf(path, "%s/egon/egon.scm", datadir);
	if (stat(path, &statbuf)) {
		fprintf(stderr, "Can't find the runtime library (egon.scm).\n");
		fprintf(stderr, "Expected it in %s\n", path);
		fprintf(stderr, "SIAGHOME (if set) is '%s'\n", datadir);
		fprintf(stderr, "Please read installation instructions.\n");
		exit(EXIT_FAILURE);
	}

	setvar(cintern("libdir"), strcons(-1, libdir), NIL);
	setvar(cintern("datadir"), strcons(-1, datadir), NIL);
	setvar(cintern("docdir"), strcons(-1, docdir), NIL);

	/* load runtime library */
	sprintf(b, "(load \"%s/egon/egon.scm\")", datadir);
	execute(b);

	init_windows(buf, &argc, argv);
	setlocale(LC_NUMERIC, "C");	/* possibly hosed by X */

	/* load user customizations, if any */
	if (!stat(egonrc, &statbuf)) {
		sprintf(b, "(load \"%s\")", egonrc);
		execute(b);
	}

	execute("(init-windows)");
	execute("(create-menus)");

	fileio_init();
	for (i = 1; i < argc; i++) {
		if (argv[i][0] != '-') {
			strcpy(path, argv[i]);
			free_buffer(w_list->buf);
			buf = new_buffer(buffer_name(argv[i]), path);
			loadmatrix(path, buf, guess_file_format(path));
			buf->change = FALSE;
			w_list->buf = buf;
		}
	}
	pr_scr_flag = TRUE;

	execute("(popup-editor)");
	/* this works, for reasons beyond my comprehension */
	execute("(print-version)");
	execute("(print-version)");
	activate_window(w_list);
#ifdef HAVE_LIBTCL
	Tcl_Main(argc, argv, Tcl_AppInit);
#else
	mainloop();
#endif
}
예제 #3
0
파일: gd.c 프로젝트: suprit/stuff
static void init_gd_version(void)
{   setvar(cintern("*gd-version*"),
           cintern("$Id: gd.c,v 1.6 1996/03/10 02:31:10 gjc Exp $"),
           NIL);
}
예제 #4
0
파일: slibu.c 프로젝트: UlricE/SiagOffice
static void init_slibu_version(void)
{setvar(cintern("*slibu-version*"),
	cintern("$Id: slibu.c,v 1.1.1.1 2003/01/15 23:55:13 ulric Exp $"),
	NIL);}
예제 #5
0
파일: regex.c 프로젝트: UlricE/SiagOffice
static void init_regex_version(void)
{setvar(cintern("*regex-version*"),
	cintern("$Id: regex.c,v 1.1.1.1 2003/01/15 23:55:08 ulric Exp $"),
	NIL);}