示例#1
0
文件: odbc.c 项目: Andygon/core
static void hb_SQLHSTMT_stor( PHB_ITEM pHDbcItm, SQLHSTMT hStmt, int iParam )
{
   PHB_SQLHSTMT pHStmt = ( PHB_SQLHSTMT ) hb_gcAllocate( sizeof( HB_SQLHSTMT ), &s_gcSQLHSTMTFuncs );

   pHStmt->hStmt = hStmt;
   pHStmt->conn_counter = 0;
   /* initialize pointer scanned by mark function before allocating new
    * new GC block - such allocation may activate GC and uninitalized
    * pointer will be accessed from our mark function
    */
   pHStmt->pHDbcItm = NULL;

   if( pHDbcItm )
   {
      PHB_SQLHDBC pHDbc = hb_SQLHDBC_get( pHDbcItm );

      if( pHDbc )
      {
         pHStmt->conn_counter = pHDbc->conn_counter;
         pHStmt->pHDbcItm = hb_itemNew( pHDbcItm );
         hb_gcUnlock( pHStmt->pHDbcItm );
      }
   }

   hb_storptrGC( ( void * ) pHStmt, iParam );
}
示例#2
0
文件: odbc.c 项目: Andygon/core
static void hb_SQLHENV_stor( SQLHENV hEnv, int iParam )
{
   PHB_SQLHENV pHEnv = ( PHB_SQLHENV ) hb_gcAllocate( sizeof( HB_SQLHENV ), &s_gcSQLHENVFuncs );

   pHEnv->hEnv = hEnv;

   hb_storptrGC( ( void * ) pHEnv, iParam );
}
示例#3
0
static void hb_SQLHDBC_stor( PHB_ITEM pHEnvItm, SQLHDBC hDbc, int iParam )
{
   PHB_SQLHDBC pHDbc = ( PHB_SQLHDBC ) hb_gcAllocate( sizeof( HB_SQLHDBC ), &s_gcSQLHDBCFuncs );

   pHDbc->hDbc = hDbc;
   pHDbc->conn_counter = 1;
   /* initialize pointer scanned by mark function before allocating new
      new GC block - such allocation may activate GC and uninitalized
      pointer will be accessed from our mark function */
   pHDbc->pHEnvItm = NULL;
   if( pHEnvItm )
   {
      pHDbc->pHEnvItm = hb_itemNew( pHEnvItm );
      hb_gcUnlock( pHDbc->pHEnvItm );
   }

   hb_storptrGC( ( void * ) pHDbc, iParam );
}