home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30g.zip / INCLUDE / hbpp.h < prev    next >
C/C++ Source or Header  |  1999-09-15  |  4KB  |  121 lines

  1. /*
  2.  * $Id: hbpp.h,v 1.15 1999/09/15 14:03:37 vszel Exp $
  3.  */
  4.  
  5. /*
  6.  * Harbour Project source code:
  7.  * Header file for the Preprocesor
  8.  *
  9.  * Copyright 1999 Alexander S.Kresin <alex@belacy.belgorod.su>
  10.  * www - http://www.harbour-project.org
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version, with one exception:
  16.  *
  17.  * The exception is that if you link the Harbour Runtime Library (HRL)
  18.  * and/or the Harbour Virtual Machine (HVM) with other files to produce
  19.  * an executable, this does not by itself cause the resulting executable
  20.  * to be covered by the GNU General Public License. Your use of that
  21.  * executable is in no way restricted on account of linking the HRL
  22.  * and/or HVM code into it.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; if not, write to the Free Software
  31.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
  32.  * their web site at http://www.gnu.org/).
  33.  *
  34.  */
  35.  
  36. /* Definitions shared by harbour.y and preprocessor */
  37.  
  38. #ifndef HB_PP_H_
  39. #define HB_PP_H_
  40.  
  41. #include "hbdefs.h"
  42.  
  43. typedef struct _PATHNAMES { /* the list of pathnames to search with #include */
  44.   char * szPath;
  45.   struct _PATHNAMES *pNext;
  46. } PATHNAMES;
  47.  
  48. struct _DEFINES;
  49. typedef struct _DEFINES
  50. {
  51.   char * name;
  52.   char * pars;
  53.   int npars;
  54.   char * value;
  55.   struct _DEFINES * last;
  56. } DEFINES;
  57.  
  58. struct _COMMANDS;
  59. typedef struct _COMMANDS
  60. {
  61.   int com_or_xcom;
  62.   char * name;
  63.   char * mpatt;
  64.   char * value;
  65.   struct _COMMANDS * last;
  66. } COMMANDS;
  67.  
  68. #define STR_SIZE 8192
  69. #define BUFF_SIZE 2048
  70.  
  71. #define SKIPTABSPACES( sptr ) while( *sptr == ' ' || *sptr == '\t' ) ( sptr )++
  72. #define IS_OPT_SEP( c ) ( strchr( OS_OPT_DELIMITER_LIST, ( c ) ) != NULL )
  73.  
  74. /* HBPP.C exported functions */
  75.  
  76. extern int ParseDirective( char * );
  77. extern int ParseExpression( char *, char * );
  78. extern int pp_RdStr( FILE *, char *, int, int, char *, int *, int * );
  79. extern int pp_WrStr( FILE *, char * );
  80. extern int strolen( char * );
  81. extern int strocpy( char *, char * );
  82. extern char * strodup( char * );
  83. extern DEFINES * AddDefine( char * szDefine, char * szValue ); /* add a new Lex define from the command line */
  84.  
  85. /* HBPP.C exported variables */
  86.  
  87. extern int lInclude;
  88. extern int * aCondCompile, nCondCompile;
  89. extern int nline;
  90.  
  91. extern char * _szPErrors[];
  92. extern char * _szPWarnings[];
  93.  
  94. /* Needed support modules, but not contained in HBPP.C */
  95.  
  96. /* Filename support */
  97. typedef struct
  98. {
  99.   char   szBuffer[ _POSIX_PATH_MAX + 3 ];
  100.   char * szPath;
  101.   char * szName;
  102.   char * szExtension;
  103. } HB_FNAME, * PHB_FNAME, * HB_FNAME_PTR;
  104.  
  105. extern PHB_FNAME hb_fsFNameSplit( char * szFilename ); /* Split given filename into path, name and extension */
  106. extern char *    hb_fsFNameMerge( char * szFileName, PHB_FNAME pFileName ); /* This function joins path, name and extension into a string with a filename */
  107.  
  108. extern void *   hb_xgrab( ULONG lSize );   /* allocates memory, exists on failure */
  109. extern void *   hb_xrealloc( void * pMem, ULONG lSize );   /* reallocates memory */
  110. extern void     hb_xfree( void * pMem );    /* frees memory */
  111.  
  112. /* Needed support variables, but not contained in HBPP.C */
  113.  
  114. extern PATHNAMES * _pIncludePath;
  115. extern PHB_FNAME _pFileName;
  116. extern DEFINES * topDefine;
  117. extern COMMANDS * topCommand;
  118. extern COMMANDS * topTranslate;
  119.  
  120. #endif /* HB_PP_H_ */
  121.