Exemplo n.º 1
0
Arquivo: adsx.c Projeto: SBCamus/core
static HB_ERRCODE adsxClose( ADSXAREAP pArea )
{
   PMIXTAG pTag;

   pArea->pTagCurrent = NULL;
   while( pArea->pTagList )
   {
      pTag = pArea->pTagList;
      pArea->pTagList = pArea->pTagList->pNext;
      mixTagDestroy( pTag );
   }
   return SUPER_CLOSE( ( AREAP ) pArea );
}
Exemplo n.º 2
0
/*
 * Close the table in the WorkArea.
 */
static HB_ERRCODE hb_sdfClose( SDFAREAP pArea )
{
   HB_TRACE( HB_TR_DEBUG, ( "hb_sdfClose(%p)", pArea ) );

   /* Update record and unlock records */
   if( pArea->pFile )
   {
      SELF_GOCOLD( &pArea->area );

      if( ! pArea->fReadonly && hb_setGetEOF() )
      {
         hb_fileWrite( pArea->pFile, "\032", 1, -1 );
         pArea->fFlush = HB_TRUE;
      }
      SELF_FLUSH( &pArea->area );
      hb_fileClose( pArea->pFile );
      pArea->pFile = NULL;
   }

   SUPER_CLOSE( &pArea->area );

   if( pArea->pFieldOffset )
   {
      hb_xfree( pArea->pFieldOffset );
      pArea->pFieldOffset = NULL;
   }
   if( pArea->pRecord )
   {
      hb_xfree( pArea->pRecord - 1 );
      pArea->pRecord = NULL;
   }
   if( pArea->pBuffer )
   {
      hb_xfree( pArea->pBuffer );
      pArea->pBuffer = NULL;
   }
   if( pArea->szEol )
   {
      hb_xfree( pArea->szEol );
      pArea->szEol = NULL;
   }
   if( pArea->szFileName )
   {
      hb_xfree( pArea->szFileName );
      pArea->szFileName = NULL;
   }

   return HB_SUCCESS;
}
Exemplo n.º 3
0
static HB_ERRCODE sqlbaseClose( SQLBASEAREAP pArea )
{
   if ( SELF_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
      return HB_FAILURE;

   if ( SUPER_CLOSE( ( AREAP ) pArea ) == HB_FAILURE )
      return HB_FAILURE;

   if ( pArea->pSDD )
      pArea->pSDD->Close( pArea );

   if ( pArea->pRow )
   {
      ULONG ulIndex;

      for ( ulIndex = 0; ulIndex <= pArea->ulRecCount; ulIndex++ )
      {
         if ( pArea->pRowFlags[ ulIndex ] & SQLDD_FLAG_CACHED )
         {
            hb_itemRelease( (PHB_ITEM) pArea->pRow[ ulIndex ] );
         }
      }
      hb_xfree( pArea->pRow );
      hb_xfree( pArea->pRowFlags );
      pArea->pRow = NULL;
      pArea->pRowFlags = NULL;
   }

   if ( pArea->szQuery )
   {
      hb_xfree( pArea->szQuery );
      pArea->szQuery = NULL;
   }
   if( pArea->pConnection )
   {
      /* It is possible to have areas without connection and SDD driver. Ex., arrayrdd. [Mindaugas] */
      pArea->pConnection->uiAreaCount--;
      pArea->pConnection = NULL;
   }
   return HB_SUCCESS;
}
Exemplo n.º 4
0
/*
 * Close the table in the WorkArea.
 */
static HB_ERRCODE hb_sdfClose( SDFAREAP pArea )
{
   HB_TRACE( HB_TR_DEBUG, ( "hb_sdfClose(%p)", pArea ) );

   SUPER_CLOSE( &pArea->area );

   /* Update record and unlock records */
   if( pArea->pFile )
   {
      SELF_FLUSH( &pArea->area );
      hb_fileClose( pArea->pFile );
      pArea->pFile = NULL;
   }

   if( pArea->pFieldOffset )
   {
      hb_xfree( pArea->pFieldOffset );
      pArea->pFieldOffset = NULL;
   }
   if( pArea->pRecord )
   {
      hb_xfree( pArea->pRecord - 1 );
      pArea->pRecord = NULL;
   }
   if( pArea->szEol )
   {
      hb_xfree( pArea->szEol );
      pArea->szEol = NULL;
   }
   if( pArea->szFileName )
   {
      hb_xfree( pArea->szFileName );
      pArea->szFileName = NULL;
   }

   return HB_SUCCESS;
}