| 1 |
/*- |
| 2 |
****************************************************************************** |
| 3 |
****************************************************************************** |
| 4 |
** |
| 5 |
** MODULE |
| 6 |
** |
| 7 |
** file: utils.h |
| 8 |
** |
| 9 |
** DESCRIPTION |
| 10 |
** |
| 11 |
** A 32-bit implementation of BibTeX v0.99c for MS-DOS, OS/2 2.x, |
| 12 |
** Unix and VMS. This C language implementation is based on the |
| 13 |
** original WEB source but it has been enhanced to support 8-bit input |
| 14 |
** characters and a very large processing capacity. |
| 15 |
** |
| 16 |
** For documentation describing how to use and build this program, |
| 17 |
** see the 00README.TXT file that accompanies this distribution. |
| 18 |
** |
| 19 |
** MODULE CONTENTS |
| 20 |
** |
| 21 |
** This module declares (using ANSI function prototypes) all of the |
| 22 |
** new utility functions that will be used in the program. The |
| 23 |
** functions are declared in alphabetical order. |
| 24 |
** |
| 25 |
** AUTHORS |
| 26 |
** |
| 27 |
** Original WEB translation to C, conversion to "big" (32-bit) capacity, |
| 28 |
** addition of run-time selectable capacity and 8-bit support extensions |
| 29 |
** by: |
| 30 |
** |
| 31 |
** Niel Kempson |
| 32 |
** Snowy Owl Systems Limited, Cheltenham, England |
| 33 |
** E-mail: [email protected] |
| 34 |
** |
| 35 |
** 8-bit support extensions also by: |
| 36 |
** |
| 37 |
** Alejandro Aguilar-Sierra |
| 38 |
** Centro de Ciencias de la Atm\'osfera, |
| 39 |
** Universidad Nacional Aut\'onoma de M\'exico, M\'exico |
| 40 |
** E-mail: [email protected] |
| 41 |
** |
| 42 |
** COPYRIGHT |
| 43 |
** |
| 44 |
** This implementation copyright (c) 1991-1995 by Niel Kempson |
| 45 |
** and copyright (c) 1995 by Alejandro Aguilar-Sierra. |
| 46 |
** |
| 47 |
** This program is free software; you can redistribute it and/or |
| 48 |
** modify it under the terms of the GNU General Public License as |
| 49 |
** published by the Free Software Foundation; either version 1, or |
| 50 |
** (at your option) any later version. |
| 51 |
** |
| 52 |
** This program is distributed in the hope that it will be useful, |
| 53 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 54 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 55 |
** General Public License for more details. |
| 56 |
** |
| 57 |
** You should have received a copy of the GNU General Public License |
| 58 |
** along with this program; if not, write to the Free Software |
| 59 |
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 60 |
** |
| 61 |
** In other words, you are welcome to use, share and improve this |
| 62 |
** program. You are forbidden to forbid anyone else to use, share |
| 63 |
** and improve what you give them. Help stamp out software-hoarding! |
| 64 |
** |
| 65 |
** ACKNOWLEDGEMENT |
| 66 |
** |
| 67 |
** The original BibTeX was written by Oren Patashnik using Donald |
| 68 |
** Knuth's WEB system. This format produces a PASCAL program for |
| 69 |
** execution and a TeX documented version of the source code. This |
| 70 |
** program started as a (manual) translation of the WEB source into C. |
| 71 |
** |
| 72 |
** CHANGE LOG |
| 73 |
** |
| 74 |
** $Log: utils.h,v $ |
| 75 |
** Revision 3.71 1996/08/18 20:37:06 kempson |
| 76 |
** Official release 3.71 (see HISTORY file for details). |
| 77 |
** |
| 78 |
** Revision 3.70 1996/04/08 10:08:40 kempson |
| 79 |
** Final documentation & cosmetic changes for official release 3.70. |
| 80 |
** |
| 81 |
** Revision 3.5 1995/09/24 20:44:37 kempson |
| 82 |
** Many changes for final beta test version. |
| 83 |
** |
| 84 |
** Revision 3.4 1995/04/09 22:15:46 kempson |
| 85 |
** Placed under RCS control |
| 86 |
** |
| 87 |
****************************************************************************** |
| 88 |
****************************************************************************** |
| 89 |
*/ |
| 90 |
#ifndef __UTILS_H__ |
| 91 |
#define __UTILS_H__ 1 |
| 92 |
|
| 93 |
|
| 94 |
#ifdef WIN32 |
| 95 |
# undef CDECL |
| 96 |
# define CDECL __cdecl |
| 97 |
#else |
| 98 |
# define CDECL |
| 99 |
#endif /* WIN32 */ |
| 100 |
|
| 101 |
|
| 102 |
/* |
| 103 |
** Declaration of public functions defined in utils.c |
| 104 |
*/ |
| 105 |
void close_file (const AlphaFile_T file_pointer); |
| 106 |
void CDECL debug_msg (const int status, const char *printf_fmt, ...); |
| 107 |
#ifndef KPATHSEA |
| 108 |
int find_file (const char *envvar, |
| 109 |
const char *fallback_path, |
| 110 |
const char *filename, char *full_file_spec); |
| 111 |
#endif |
| 112 |
FILE *open_ip_file (Integer_T search_path); |
| 113 |
FILE *open_op_file (void); |
| 114 |
void *mymalloc (const unsigned long bytes_required, |
| 115 |
const char *var_name); |
| 116 |
void *myrealloc (void *old_ptr, const unsigned long bytes_required, |
| 117 |
const char *var_name); |
| 118 |
void parse_cmd_line (int argc, char **argv); |
| 119 |
void report_bibtex_capacity (void); |
| 120 |
void report_search_paths (void); |
| 121 |
void set_array_sizes (void); |
| 122 |
void CDECL usage (const char *printf_fmt, ...); |
| 123 |
|
| 124 |
|
| 125 |
#ifdef SUPPORT_8BIT |
| 126 |
void c8initialise (void); |
| 127 |
#endif /* SUPPORT_8BIT */ |
| 128 |
|
| 129 |
|
| 130 |
/* |
| 131 |
** Debugging categories. |
| 132 |
*/ |
| 133 |
#define DBG_ALL 255 |
| 134 |
#define DBG_CSF 1 |
| 135 |
#define DBG_IO 2 |
| 136 |
#define DBG_MEM 4 |
| 137 |
#define DBG_MISC 8 |
| 138 |
#define DBG_SRCH 16 |
| 139 |
|
| 140 |
#endif /* __UTILS_H__ */ |