예제 #1
0
static int hb_pp_preprocesfile( PHB_PP_STATE pState, const char * szRuleFile, const char * szPPRuleFuncName )
{
   int iResult = 0;
   HB_SIZE nLen;

   while( hb_pp_nextLine( pState, &nLen ) != NULL && nLen )
      ;

   if( szRuleFile )
   {
      FILE * foutr;

      foutr = hb_fopen( szRuleFile, "w" );
      if( ! foutr )
      {
#if ! defined( HB_OS_WIN_CE )
         perror( szRuleFile );
#endif
         iResult = 1;
      }
      else
      {
         hb_pp_undefCompilerRules( pState );
         hb_pp_generateRules( foutr, pState, szPPRuleFuncName );
         fclose( foutr );
      }
   }

   return iResult;
}
예제 #2
0
파일: ppgen.c 프로젝트: xharbour/core
static int hb_pp_preprocesfile( PHB_PP_STATE pState, char * szRuleFile, char* szWordFile )
{
   int   iResult = 0;
   ULONG ulLen;
   FILE * fWord = NULL;

   while( hb_pp_nextLine( pState, &ulLen ) != NULL && ulLen )
      ;

   if( szWordFile )
   {
      fWord = hb_fopen( szWordFile, "w" );

      if( ! fWord )
      {
         perror( szWordFile );
         iResult = 1;
      }
   }

   if( iResult == 0 && szRuleFile )
   {
      FILE * foutr;

      foutr = hb_fopen( szRuleFile, "w" );
      if( ! foutr )
      {
         perror( szRuleFile );
         iResult = 1;
      }
      else
      {
         hb_pp_undefCompilerRules( pState );
         hb_pp_generateRules( foutr, fWord, pState );
         fclose( foutr );
         fclose( fWord );
      }
   }

   return iResult;
}