Exemplo n.º 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;
}
Exemplo n.º 2
0
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;
}