static char *try_user_spec(QSP_ARG_DECL char *progname) /* look for dotfile in user-specified directory */ { char *dir; dir=getenv(STARTUP_DIRNAME); if( dir == NULL ) return(NULL); return( try_directory(QSP_ARG dir,progname) ); }
static char *try_home(QSP_ARG_DECL char *progname) /* look for dotfile in user's home directory */ { char *home; home=getenv("HOME"); if( home == NULL ){ WARN("try_home: no HOME in environment"); return(NULL); } return( try_directory(QSP_ARG home,progname) ); }
static char *try_default(QSP_ARG_DECL char *progname) /* look for dotfile in default system directory */ { #ifdef FOOBAR char default_dir_name[MAXPATHLEN]; // This test is conservative because we count the 2 chars in %s if( strlen(progname) + strlen(QUIP_DEFAULT_FMT) >= MAXPATHLEN ){ sprintf(ERROR_STRING,"try_default: Program name '%s' is too long!?",progname); ERROR1(ERROR_STRING); } sprintf(default_dir_name,QUIP_DEFAULT_FMT,progname); #endif // FOOBAR return( try_directory(QSP_ARG /*default_dir_name*/ QUIP_DEFAULT_DIR,progname) ); }
static char *try_cwd(QSP_ARG_DECL char *progname) { return( try_directory(QSP_ARG ".",progname) ); }
static char *try_default(QSP_ARG_DECL char *progname) /* look for dotfile in default system directory */ { return( try_directory(QUIP_DEFAULT_DIR,progname) ); }