Beispiel #1
0
void rcfile( Query_Stack *qsp, char* progname )
{
	char *s=NULL;
	int status;

	// Should we make sure that the qsp has already been initialized?
	set_progname(progname); 	/* this is for get_progfile */

//#ifndef BUILD_FOR_OBJC
#ifdef BUILD_FOR_CMD_LINE
	// For unix, the user can put their own startup in:
	// current directory, $STARTUP_DIRNAME, $HOME, and QUIP_DEFAULT_DIR (/usr/local/share/quip/macros/startup/)
	strip_fullpath(&progname);	/* strip leading components */

	s=try_cwd(QSP_ARG  progname);
	if( s == NULL ) s=try_user_spec(QSP_ARG  progname);
	if( s == NULL ) s=try_home(QSP_ARG  progname);
	if( s == NULL ) s=try_default(QSP_ARG  progname);
//#endif /* ! BUILD_FOR_OBJC */
#endif /* BUILD_FOR_CMD_LINE */

	/* Because these functions push the input but do not execute,
	 * this one is interpreted first, because it is pushed last.
	 * It would be better to execute right away, so that settings
	 * such as verbose and QUIPSTARTUPDIR could be put there and
	 * used here, but, when this is executed, no menus have been pushed...
	 * We could push the builtin menu?
	 */
	status = read_global_startup(QSP_ARG  progname);

	if( status < 0 && s == NULL ){
		advise("No startup file found");
	} else if( verbose ){
		/* How would verbose ever be set here? Only by changing compilation default? */
		// We may not want to print this message if we are using the global startup?
		if( s != NULL ){
			sprintf(ERROR_STRING,"Interpreting startup file %s",s);
			advise(ERROR_STRING);
		}
	}
}
Beispiel #2
0
void rcfile( Query_Stack *qsp, char* progname )
{
	char *s=NULL;
	int status;

	// Should we make sure that the qsp has already been initialized?
	set_progname(progname); 	/* this is for get_progfile */

#ifndef BUILD_FOR_OBJC
	strip_fullpath(&progname);	/* strip leading components */

	s=try_cwd(QSP_ARG  progname);
	if( s == NULL ) s=try_user_spec(QSP_ARG  progname);
	if( s == NULL ) s=try_home(QSP_ARG  progname);
	if( s == NULL ) s=try_default(QSP_ARG  progname);
#endif /* ! BUILD_FOR_OBJC */

	// We probably don't want to print this message if we are using the global startup...


	/* Because these functions push the input but do not execute,
	 * this one is interpreted first, because it is pushed last.
	 * It would be better to execute right away, so that settings
	 * such as verbose and QUIPSTARTUPDIR could be put there and
	 * used here, but when this is executed no menus have been pushed...
	 * We could push the builtin menu?
	 */
	status = read_global_startup(SINGLE_QSP_ARG);

	if( status < 0 && s == NULL ){
		advise("No startup file found");
	} else if( verbose ){
		/* How would verbose ever be set here? Only by changing compilation default? */
		if( status == 0 ) advise("Interpreting global startup file $HOME/.coqrc");
		if( s != NULL ){
			sprintf(ERROR_STRING,"Interpreting startup file %s",s);
			advise(ERROR_STRING);
		}
	}
}