1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
/*** init.c *******************************************************************
**
** This file is part of BibTool.
** It is distributed under the GNU General Public License.
** See the file COPYING for details.
**
** (c) 1996-2017 Gerd Neugebauer
**
** Net: gene@gerd-neugebauer.de
**
** 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 2, 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, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
**-----------------------------------------------------------------------------
** Description:
** This module contains the global initialization function which
** has to be called before any modules in \BibTool{} are
** activated. This is for convenience, thus nobody has to call
** the various initialization functions for the different modules
** by hand.
******************************************************************************/
#include <bibtool/general.h>
#include <bibtool/rsc.h>
#include <bibtool/key.h>
#include <bibtool/entry.h>
#include <bibtool/symbols.h>
#include <bibtool/macros.h>
#include <bibtool/parse.h>
#include <bibtool/sbuffer.h>
#include "config.h"
#ifdef HAVE_LIBKPATHSEA
#ifdef __STDC__
#define HAVE_PROTOTYPES
#endif
#include <kpathsea/proginit.h>
#include <kpathsea/progname.h>
#endif
/*****************************************************************************/
/* Internal Programs */
/*===========================================================================*/
/*****************************************************************************/
/* External Programs */
/*===========================================================================*/
/*---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
** Function: init_bibtool()
** Purpose: Perform any initializations necessary for \BibTool.
**
**
** Arguments:
** progname Name of the program for |KPATHSEA|.
** Returns: nothing
**___________________________________________________ */
void init_bibtool(progname) /* */
char * progname; /* */
{ /* */
#ifdef EMTEX_LIKE_PATH
static StringBuffer *sb_rsc; /* */
static StringBuffer *sb_bibtex; /* */
/* */
{ char *emtexdir = getenv(EMTEXDIR); /* */
if ( emtexdir == NULL ) emtexdir = EMTEXTDIR_DEFAULT;/* */
sb_rsc = sbopen(); /* */
sbputs(".;",sb_rsc); /* */
sbputs(emtexdir,sb_rsc); /* */
sbputs(EMTEXT_RESOURCE,sb_rsc); /* */
rsc_v_rsc = sbflush(sb_rsc); /* */
sb_bibtex = sbopen(); /* */
sbputs(".;",sb_bibtex); /* */
sbputs(emtexdir,sb_bibtex); /* */
sbputs(EMTEXT_BIBTEX,sb_bibtex); /* */
rsc_v_bibtex = sbflush(sb_bibtex); /* */
} /* */
#endif
/* */
POSSIBLY_UNUSED(progname); /* */
/* */
#ifdef HAVE_LIBKPATHSEA
kpse_set_program_name(progname, "bibtool"); /* */
#endif
/* */
init_type(); /* */
init_symbols(); /* */
init_entries(); /* */
init_read(); /* */
/* */
set_rsc_path(rsc_v_rsc); /* */
/* */
init_macros(); /* */
init_read(); /* */
} /*------------------------*/
|