/* files.h.in -- defines for various file locations etc

   Copyright 2009 Free Software Foundation, Inc.

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* Location of various files
   We pretend this is a shell script for autoconf as it saves too many
  defines with loads of \$s in.
  datarootdir=@datarootdir@ */

#define GNU_BATCH_VERSION               @PACKAGE_VERSION@
#define GNU_BATCH_MAJOR_VERSION         @MAJOR_PACKAGE_VERSION@
#define GNU_BATCH_VERSION_STRING        "@PACKAGE_VERSION@"

#define MASTER_CONFIG   "@sysconfdir@/gnubatch.conf"
#define ENV_SELECT_VAR  "GNUBATCH_ENV"
#define USER_CONFIG     ".gnubatch"
#define HOME_CONFIG_DIR ".gbch"
#define HOME_CONFIG_FILE "gnubatch@MAJOR_PACKAGE_VERSION@"
#define HOME_CONFIG     "~/" HOME_CONFIG_DIR "/" HOME_CONFIG_FILE
#define ENVIR_FILE      "${GNUBATCHENV-@sysconfdir@/gnubatch-env}"
#define HOSTFILE        "${HOSTFILE-@sysconfdir@/gnubatch.hosts}"
#define CONFIGPATH      "${GB_CONFIGPATH-@:~:!:.:-}"
#define HELPPATH        "${GB_HELPPATH-.:!:~:@}"
#define VFILE           "btsched_vfile"
#define JFILE           "btsched_jfile"
#define JMMAP_FILE      "btmm_jobs"
#define VMMAP_FILE      "btmm_vars"
#define XFMMAP_FILE     "btmm_xfer"
#define JLOCK_FILE      "btjob.lock"
#define VLOCK_FILE      "btvar.lock"
#define XLOCK_FILE      "btxfer.lock"
#define REPFILE         "btsched_reps"
#define MISC_UCONFIG    "GBCH_RESTCONF"

#define LUMPSIZE        "${MSGTXSIZE-20}"
#define LUMPWAIT        "${MSGTXDELAY-2}"

#define DEF_CI_NAME     "sh"
#define DEF_CI_PATH     "@shell@"
#define DEF_CI_ARGS     "-s"
#define DEF_BASE_NICE   (-20)
#define DEF_CI_NICE     24

#define SPNAM   "SP"            /* Spool files */
#define SONAM   "SO"            /* Std output */
#define SENAM   "ER"            /* Std error (default) */
#define NTNAM   "NT"            /* Network temporary copy */

#define BATCHUNAME      "@BATCHUSER@"
#define XBDEFNAME       "default"

#define SPDIR_RAW       "@spooldir@"
#define BTUFILE         "${SPOOLDIR-@spooldir@}/btufile@PACKAGE_VERSION@"
#define BTCI            "${SPOOLDIR-@spooldir@}/cifile"
#define HOLFILE         "${SPOOLDIR-@spooldir@}/holfile"
#define SPDIR           "${SPOOLDIR-@spooldir@}"
#define BTSCHED         "${SPROGDIR-@pkgexecdir@}/btsched"
#define XBNETSERV       "${SPROGDIR-@pkgexecdir@}/xbnetserv"
#define XBTQ_ICON       "${SPHELPDIR-@sphelpdir@}/xbtq.xpm"
#define XBTQ_MENU       "${SPHELPDIR-@sphelpdir@}/xbtq.menu"
#define XBTQVIEW_MENU   "${SPHELPDIR-@sphelpdir@}/xbtqview.menu"
#define XBTQSEL_MENU    "${SPHELPDIR-@sphelpdir@}/xbtqsel.menu"
#define XBTUSER_ICON    "${SPHELPDIR-@sphelpdir@}/xbtuser.xpm"
#define XBTUSER_MENU    "${SPHELPDIR-@sphelpdir@}/xbtuser.menu"
#define XBTR_ICON       "${SPHELPDIR-@sphelpdir@}/xbtr.xpm"
#define XBTR_MENU       "${SPHELPDIR-@sphelpdir@}/xbtr.menu"
#define MAILER          "${MAILER-@mailer@}"
#define WRITER          "${SPROGDIR-@pkgexecdir@}/btwrite"
#define DOSWRITER       "${SPROGDIR-@pkgexecdir@}/dosbtwrite"
#define MSGDISPATCH     "${SPROGDIR-@pkgexecdir@}/btmdisp"
#define EXECPROG        "${SPROGDIR-@pkgexecdir@}/btexec"
#define GTKSAVE         "${SPROGDIR-@pkgexecdir@}/bgtksave"
#define GTKLDSAV        "${SPROGDIR-@pkgexecdir@}/bgtkldsv"
#define DUMPJOB         "${SPROGDIR-@pkgexecdir@}/jobdump"
#define XMLDUMPJOB      "${SPROGDIR-@pkgexecdir@}/xmljobdump"
#define CFILEDIR        "${SPHELPDIR-@sphelpdir@}/"

#define INT_CONFIG      "${SPHELPDIR-@sphelpdir@}/btint-config"

#define BTPWPROG        "${SPROGDIR-@pkgexecdir@}/btpwchk"

#define XIHTMLINI       "${SPROGDIR-@pkgdatadir@}/gbhtml.ini"
#define HTML_UFILE      "${SPROGDIR-@pkgdatadir@}/html_ufile"
#define HTML_TMPFILE    "/tmp/gbcgi%ld.%d"
#define WINUSER_MAP     "@sysconfdir@/gbuser.map"
#define XIPWFILE        "${SPROGDIR-@pkgexecdir@}/gbpwfile"

#define BTR_PROGRAM     "gbch-r"
#define XBTR_PROGRAM    "gbch-xr"

#define XMLJOBSUFFIX    ".gbj1"
#define NSID            "http://www.fsf.org/gnubatch/gbj1"

#define XBTIMEOUTS      "${NETTIMEOUT:1000}"

#define HALTSIG         "${HALTALL-9}"

#define BTSCHEDTRACE    "${SCHEDTRACE-0}"
#define BTSCHEDTRFILE   "${SCHEDTRFILE-@spooldir@/schedtrace}"
#define XBNETTRACE      "${NETTRACE-0}"
#define XBNETTRFILE     "${NETTRFILE-@spooldir@/xbnettrace}"

extern  void    versionprint(char **, const char *, const int);
extern  void    init_mcfile();
extern  void    init_xenv();
extern  char    *envprocess(const char *);
extern  char    *mkspdirfile(const char *);
extern  char    *mkspid(const char *, const jobno_t);
extern  char    **squash_envir(char **, char **);

extern  char    *envselect_name;
extern  int     envselect_value;
