Exemplo n.º 1
0
static void s_listenRet( HB_SOCKET sd, const char * szRootPath, HB_BOOL rpc )
{
   if( sd != HB_NO_SOCKET )
   {
      PHB_LISTENSD lsd, * lsd_ptr;
      int iLen;

      lsd = ( PHB_LISTENSD ) memset( hb_xgrab( sizeof( HB_LISTENSD ) ),
                                            0, sizeof( HB_LISTENSD ) );
      lsd->sd = sd;
      lsd->rpc = rpc;
      if( szRootPath )
         hb_strncpy( lsd->rootPath, szRootPath, sizeof( lsd->rootPath ) - 1 );
      else
         hb_fsBaseDirBuff( lsd->rootPath );
      iLen = ( int ) strlen( lsd->rootPath );
      if( iLen > 0 )
      {
         if( ! s_isDirSep( lsd->rootPath[ iLen - 1 ] ) )
         {
            if( iLen == sizeof( lsd->rootPath ) - 1 )
               --iLen;
            lsd->rootPath[ iLen ] = HB_OS_PATH_DELIM_CHR;
         }
      }
      lsd_ptr = ( PHB_LISTENSD * ) hb_gcAllocate( sizeof( PHB_LISTENSD ),
                                                  &s_gcListensdFuncs );
      *lsd_ptr = lsd;
      hb_retptrGC( lsd_ptr );
   }
   else
      hb_ret();
}
Exemplo n.º 2
0
static void hb_hrbReturn( PHRB_BODY pHrbBody )
{
   PHRB_BODY * pHrbPtr = ( PHRB_BODY * ) hb_gcAllocate( sizeof( PHRB_BODY ),
                                                        &s_gcHrbFuncs );

   *pHrbPtr = pHrbBody;
   hb_retptrGC( pHrbPtr );
}
Exemplo n.º 3
0
static void hb_BIO_ret( BIO * bio, char * pszBuffer )
{
   HB_BIO ** ptr = ( HB_BIO ** ) hb_gcAllocate( sizeof( HB_BIO * ), &s_gcBIOFuncs );

   *ptr = PHB_BIO_create( bio, pszBuffer );

   hb_retptrGC( ( void * ) ptr );
}
Exemplo n.º 4
0
void hb_X509_ret( X509 * x509, HB_BOOL fRelease )
{
   PHB_X509 ph = ( PHB_X509 ) hb_gcAllocate( sizeof( HB_X509 ), &s_gcX509_funcs );

   ph->pX509    = x509;
   ph->fRelease = fRelease;

   hb_retptrGC( ( void * ) ph );
}
Exemplo n.º 5
0
static void s_consrvRet( PHB_CONSRV conn )
{
   if( conn )
   {
      PHB_CONSRV * conn_ptr = ( PHB_CONSRV * ) hb_gcAllocate( sizeof( PHB_CONSRV ),
                                                              &s_gcConSrvFuncs );
      *conn_ptr = conn;
      hb_retptrGC( conn_ptr );
   }
   else
      hb_ret();
}
Exemplo n.º 6
0
static void hb_fileReturn( PHB_FILE pFile )
{
   if( pFile )
   {
      PHB_FILE * fileHolder = ( PHB_FILE * ) hb_gcAllocate( sizeof( PHB_FILE ),
                                                            &s_gcFileFuncs );
      * fileHolder = pFile;
      hb_retptrGC( fileHolder );
   }
   else
      hb_ret();
}
Exemplo n.º 7
0
static void hb_MYSQL_ret( MYSQL * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAllocate( sizeof( MYSQL * ), &s_gcMYSQLFuncs );

      *ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}
Exemplo n.º 8
0
void hb_PGconn_ret( PGconn * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAllocate( sizeof( PGconn * ), &s_gcPGconnFuncs );

      *ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}
Exemplo n.º 9
0
static void hb_FILE_ret( FILE * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAllocate( sizeof( FILE * ), &s_gcFILEFuncs );

      *ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}
Exemplo n.º 10
0
static void hb_PGcancel_ret( PGcancel * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAllocate( sizeof( PGcancel * ), &s_gcPGcancelFuncs );

      *ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}
Exemplo n.º 11
0
void hb_PGresult_ret( PGresult * p )
{
   if( p )
   {
      void ** ph = ( void ** ) hb_gcAllocate( sizeof( PGresult * ), &s_gcPGresultFuncs );

      *ph = p;

      hb_retptrGC( ph );
   }
   else
      hb_retptr( NULL );
}