• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CL_FUNC_EXIT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CL_FUNC_EXIT函数的典型用法代码示例。如果您正苦于以下问题:C++ CL_FUNC_EXIT函数的具体用法?C++ CL_FUNC_EXIT怎么用?C++ CL_FUNC_EXIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CL_FUNC_EXIT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: dmClassDelete

/*Currently we are having another API clCorClassDelete for same purpose. However,
  it takes class handle as input. If we plan to remove it. This will be useful.*/
ClRcT
dmClassDelete(ClCorClassTypeT id)
{
    ClRcT ret = CL_OK;
    CORClass_h tmp = 0;
    
    CL_FUNC_ENTER();

    if((!dmGlobal))
      {
        CL_FUNC_EXIT();  
        return(CL_COR_SET_RC(CL_COR_ERR_NULL_PTR));
      }
    
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ( "ClassDelete (Class:%04x)", id));
    
    /* check if class already present 
     */
    HASH_GET(dmGlobal->classTable, id, tmp);
    if(tmp) 
      {
        ret = dmClassByHandleDelete(tmp);
      } 
    else 
      {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ( "ClassDelete (Class:%04x) [Unknown class]", 
                              id));
        
        ret = CL_COR_SET_RC(CL_COR_ERR_CLASS_NOT_PRESENT);
      }
    
    CL_FUNC_EXIT();
    return (ret);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:36,代码来源:clCorDmClass.c


示例2: cosSysvShmAttach

ClRcT
cosSysvShmAttach(ClOsalShmIdT shmId,void* pInMem, void** ppOutMem)
{
    ClRcT retCode = 0;
    void* pShared = NULL;

    CL_FUNC_ENTER();
    if(NULL == ppOutMem)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("\nShared Memory Attach: FAILED"));
        retCode = CL_OSAL_RC(CL_ERR_NULL_POINTER);
        CL_FUNC_EXIT();
        return(retCode);
    }

    pShared = shmat ((int)shmId, pInMem, 0);

    if((void*)-1 == pShared)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("\nShared Memory Attach: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_ATTACH);
        CL_FUNC_EXIT();
        return(retCode);
    }
    else
    {
        *ppOutMem = pShared;
    }

    CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory Attach: DONE"));
    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:33,代码来源:clSysV.c


示例3: halDevObjCreate

ClRcT halDevObjCreate (ClUint32T deviceID, 
                        void *pdevCapability,
                        ClUint32T devCapLen ,
                        ClUint32T maxRspTime, 
                        ClUint32T bootUpPriority, 
                        ClHalDeviceObjectH *const phalDevObj)

{
    ClUint32T index=0 ;
    ClUint32T i=0 ;
    CL_FUNC_ENTER();
    
    if(deviceID<=0)
    {
        clLogCritical(CL_LOG_AREA_UNSPECIFIED,CL_LOG_CONTEXT_UNSPECIFIED,"\nhalDevObjCreate Error Invalid DeviceId\n");
        CL_FUNC_EXIT();
        return(CL_HAL_SET_RC( CL_ERR_INVALID_PARAMETER)) ;
    }

    if(NULL ==phalDevObj) 
    { 
        clLogCritical(CL_LOG_AREA_UNSPECIFIED,CL_LOG_CONTEXT_UNSPECIFIED,"\n halDevObjCreate Error NULL for Device \
                      Object Handle\n") ;
        CL_FUNC_EXIT();
        return(CL_HAL_SET_RC(CL_ERR_NULL_POINTER));
    }
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:26,代码来源:clHalDevObject.c


示例4: cosSysvShmSizeGet

ClRcT
cosSysvShmSizeGet(ClOsalShmIdT shmId,ClUint32T* pSize)
{
    struct shmid_ds shmSize ;
    ClInt32T retCode = CL_OK;

    CL_FUNC_ENTER();
    if(NULL == pSize)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeGet: FAILED"));
        retCode = CL_OSAL_RC(CL_ERR_NULL_POINTER);
        CL_FUNC_EXIT();
        return(retCode);
    }

    /* Get the current values set and modifiy it */
    retCode = shmctl ((int)shmId, IPC_STAT, &shmSize);

    if(0 != retCode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeGet: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_SIZE);
        CL_FUNC_EXIT();
        return(retCode);
    }

    *pSize = (ClUint32T)shmSize.shm_segsz;

    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:31,代码来源:clSysV.c


示例5: clTimerTypeGet

ClRcT
clTimerTypeGet (ClTimerHandleT timerHandle,
                ClUint32T* pTimerType)
{
    /* make sure the timer actually exists */
    TsTimer_t* pUserTimer = NULL;
    ClRcT returnCode;

    CL_FUNC_ENTER();
    pUserTimer = (TsTimer_t*) timerHandle;
    if (pUserTimer == NULL) {
        /* debug message */
        returnCode = CL_TIMER_RC(CL_ERR_INVALID_HANDLE);
        clDbgCodeError(returnCode, ("Bad timer handle"));
        CL_FUNC_EXIT();
        return (returnCode);
    }

    if (pTimerType == NULL) {
        CL_FUNC_EXIT();
        return (CL_ERR_UNSPECIFIED);
    }

    /* extract the timer-type from the timer */
    *pTimerType = pUserTimer->type;

    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:29,代码来源:clTimerOld.c


示例6: cdbGDBMRecordReplace

static ClRcT
cdbGDBMRecordReplace(ClDBHandleT      dbHandle, /* Handle to the database */
                     ClDBKeyT         dbKey,    /* Handle to the key being added */
                     ClUint32T       keySize,  /* Size of the key being added */
                     ClDBRecordT      dbRec,    /* Handle to the record being added */
                     ClUint32T       recSize)  /* Size of the record being added */
{
  ClRcT errorCode = CL_OK;
  GDBMHandle_t* pGDBMHandle = (GDBMHandle_t*)dbHandle;
  ClUint32T returnCode = 0;
  datum key = {NULL, 0};
  datum data = {NULL, 0};
  
  CL_FUNC_ENTER();
  key.dsize = keySize;
  key.dptr = (ClCharT *)dbKey;

  data.dsize = recSize;
  data.dptr = (ClCharT *)dbRec;

  /* Replace the record in the database */
  returnCode = gdbm_store(pGDBMHandle->gdbmInstance, key, data, GDBM_REPLACE);

  if(0 != returnCode) {
    /* Some GDBM error occured. return DB error */
    errorCode = CL_DBAL_RC(CL_DBAL_ERR_DB_ERROR);
    CL_DEBUG_PRINT ( CL_DEBUG_TRACE,("\nGDBM replace failed"));
    CL_FUNC_EXIT();
    return(errorCode);
  }

  CL_FUNC_EXIT();
  return(CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:34,代码来源:clovisGDBM.c


示例7: clEsmInstanceContinue

/**
 *  Continue the extended state machine instance.
 *
 *  This API to be called if the state machine is paused
 *  and events are just being queued and not being 
 *  processed.  This API puts the state machine instance
 *  back in regular processing mode.
 *
 *  @param smThis State Machine Object
 *
 *  @returns 
 *    CL_OK on CL_OK (successful start) <br/>
 *    CL_SM_RC(CL_ERR_NULL_POINTER) on invalid/null instance handle <br/>
 *
 *  @see #clEsmInstancePause
 */
ClRcT
clEsmInstanceContinue(ClExSmInstancePtrT smThis
                    )
{
  ClRcT ret = CL_OK;
  CL_FUNC_ENTER();

  CL_ASSERT(smThis);

  if(smThis && smThis->fsm)
    {
      if(!(ESM_IS_PAUSED(smThis)))
      {
        ret = SM_ERR_NOT_PAUSED;
        CL_FUNC_EXIT();
        return ret;
      }
#ifdef DEBUG
      clLogTrace(ESM_LOG_AREA,CL_LOG_CONTEXT_UNSPECIFIED,"Continue [%s]", smThis->fsm->name);
#endif
      ESM_CONTINUE(smThis);
    } else 
      {
        ret = CL_SM_RC(CL_ERR_NULL_POINTER);
      }
  
  CL_FUNC_EXIT();
  return ret;

}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:46,代码来源:clSmExtended.c


示例8: cosSysvShmSecurityModeGet

ClRcT
cosSysvShmSecurityModeGet(ClOsalShmIdT shmId,ClUint32T* pMode)
{
    struct shmid_ds shmPerm ;
    ClInt32T retCode = CL_OK;

    CL_FUNC_ENTER();
    if(NULL == pMode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeGet: FAILED"));
        retCode = CL_OSAL_RC(CL_ERR_NULL_POINTER);
        CL_FUNC_EXIT();
        return(retCode);
    }

    /* Get the current values set and modify it */
    retCode = shmctl ((int)shmId, IPC_STAT, &shmPerm);

    if(0 != retCode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeGet: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_MODE_GET);
        CL_FUNC_EXIT();
        return(retCode);
    }

    *pMode = shmPerm.shm_perm.mode;

    CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeGet: DONE"));
    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:32,代码来源:clSysV.c


示例9: cosSysvShmDetach

ClRcT
cosSysvShmDetach(void* pMem)
{
    ClInt32T retCode =  CL_OK;

    CL_FUNC_ENTER();
    if(NULL == pMem)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory Detach: FAILED"));
        retCode = CL_OSAL_RC(CL_ERR_NULL_POINTER);
        CL_FUNC_EXIT();
        return(retCode);
    }

    retCode = shmdt (pMem);

    if(0 != retCode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory Detach: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_DETACH);
        CL_FUNC_EXIT();
        return(retCode);
    }

    CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory Detach: DONE"));
    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:28,代码来源:clSysV.c


示例10: omClassEntryReload

/*
 * Insert the class tab entry into the class id table.
 */
static ClRcT 
omClassEntryReload (ClCharT *pClassName, ClOmClassTypeT classId)
{
	ClRcT		rc = CL_OK;
    ClOmClassControlBlockT *pClassTab = NULL;
    ClCntNodeHandleT nodeHandle = 0;

    CL_FUNC_ENTER();

    if(!pClassName)
    {
        rc = CL_OM_SET_RC(CL_OM_ERR_NULL_PTR);
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL PTR PASSED"));
        CL_FUNC_EXIT();
        return rc;
    }

	CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("OM entry reload for class = %s, class type %d", pClassName, classId));

    /*
     * First check if the class id entry is already present in the om class id table.
     */
    if(clCntNodeFind(ghOmClassHashTbl, (ClCntKeyHandleT)(ClWordT)classId, &nodeHandle) == CL_OK)
        return CL_OK;

	/* Add this class entry into the OM class lookup table */
	rc = clCntNodeFind(ghOmClassNameHashTbl, (ClCntKeyHandleT)pClassName, &nodeHandle);
	if (rc != CL_OK)
    {
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Unable to find OM Class name [%s] entry in om class table",
                                        pClassName));
		return (rc);
    }
    
    rc = clCntNodeUserDataGet(ghOmClassNameHashTbl, nodeHandle, (ClCntDataHandleT*)&pClassTab);
    if(rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Unable to get data for OM Class [%s] from om class name table",
                                        pClassName));
        return rc;
    }

    /*
     * Insert this entry into the class id table.
     */
    pClassTab->eMyClassType = classId;

    rc = clCntNodeAdd(ghOmClassHashTbl, (ClCntKeyHandleT)(ClWordT)pClassTab->eMyClassType,
                      (ClCntDataHandleT)pClassTab, NULL);
    if(rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Unable to add entry [%#x] for class [%s] to OM class id table",
                                        classId, pClassName));
        return rc;
    }

   	CL_FUNC_EXIT();
	return (rc);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:62,代码来源:omMain.c


示例11: clEvtFinalize

/*
 * This function clean up the information which is it has 
 * 1. Deregister with CPM. 
 * 2. Deregister with debug. 
 * 3. Deregister with CKPT
 * 4. Release the resources like Handle Databases, etc.
 */
ClRcT clEvtFinalize()
{
    ClRcT rc = CL_OK;


    CL_FUNC_ENTER();

    CL_EVT_INIT_DONE_VALIDATION();

    rc = clEoClientUninstallTables(gEvtHead.evtEOId, CL_EO_SERVER_SYM_MOD(gAspFuncTable, EVT));  
    if (rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("Event: EO Client Uninstall failed [0x%X]\n\r", rc));
        CL_FUNC_EXIT();
        return rc;
    }

    rc = clEventDebugDeregister(gEvtHead.evtEOId);
    if (rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("Event: Debug Deregister failed [0x%X]\n\r", rc));
        CL_FUNC_EXIT();
        return rc;
    }

    /*
     ** Handle Database Cleanup.
     */
    rc = clEvtHandleDatabaseExit();
    if (rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("Event: Handle Database Cleanup failed [0x%X]\n\r",
                        rc));
        CL_FUNC_EXIT();
        return rc;
    }

#ifdef CKPT_ENABLED
    /*
     ** Check Pointing Related Cleanup.
     */
    clEvtCkptExit();
    if (rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("Event Ckpt Exit failed [0x%X]\n\r", rc));
        CL_FUNC_EXIT();
        return rc;
    }
#endif

    CL_FUNC_EXIT();
    return CL_OK;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:64,代码来源:clEventMain.c


示例12: cdbGDBMNextRecordGet

static ClRcT
cdbGDBMNextRecordGet(ClDBHandleT      dbHandle,         /* Handle to the database */
                     ClDBKeyT         currentKey,       /* Handle to the current key */
                     ClUint32T       currentKeySize,   /* Size of the current key */
                     ClDBKeyT*        pDBNextKey,       /* pointer to handle in which the next key is returned */
                     ClUint32T*      pNextKeySize,     /* pointer to size in which the next key's size is returned */
                     ClDBRecordT*     pDBNextRec,       /* pointer to handle in which the next record is returned */
                     ClUint32T*      pNextRecSize)     /* pointer to size in which the next record's size is returned */
{
  ClRcT errorCode = CL_OK;
  GDBMHandle_t* pGDBMHandle = (GDBMHandle_t*)dbHandle;
  datum key = {NULL, 0};
  datum nextKey = {NULL, 0};
  datum data = {NULL, 0};

  CL_FUNC_ENTER();
  NULL_CHECK(pDBNextKey);
  NULL_CHECK(pNextKeySize);

  NULL_CHECK(pDBNextRec);
  NULL_CHECK(pNextRecSize);

  key.dsize = currentKeySize;
  key.dptr = (ClCharT *)currentKey;

  /* Retrieve the next key */
  nextKey = gdbm_nextkey(pGDBMHandle->gdbmInstance, key);

  if(NULL == nextKey.dptr) {
    /* The next key does not exist. So return error */
    errorCode = CL_DBAL_RC(CL_ERR_NOT_EXIST);
    CL_DEBUG_PRINT ( CL_DEBUG_TRACE,("\nGDBM get next key failed"));
    CL_FUNC_EXIT();
    return(errorCode);
  }

  *pDBNextKey = (ClDBKeyT)nextKey.dptr;
  *pNextKeySize = nextKey.dsize;

  /* retrieve the associated record */
  data = gdbm_fetch(pGDBMHandle->gdbmInstance, nextKey);

  if(NULL == data.dptr) {
    errorCode = CL_DBAL_RC(CL_ERR_NOT_EXIST);
    CL_DEBUG_PRINT ( CL_DEBUG_TRACE,("\nGDBM fetch record failed"));
    CL_FUNC_EXIT();
    return(errorCode);
  }
  
  *pDBNextRec = (ClDBRecordT)data.dptr;
  *pNextRecSize = data.dsize;

  CL_FUNC_EXIT();
  return(CL_OK);  

}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:56,代码来源:clovisGDBM.c


示例13: cosSysvSemCreate

ClRcT
cosSysvSemCreate (ClUint8T* pName, ClUint32T count, ClOsalSemIdT* pSemId)
{
    ClInt32T retCode = CL_OK;
    CosSemCtl_t semArg = {0};
    ClUint32T len = 0;
    ClUint32T key = 0;
    ClInt32T semId = -1;

    nullChkRet(pSemId);
    nullChkRet(pName);

    CL_FUNC_ENTER();
    if ((count == 0) || count > CL_SEM_MAX_VALUE)
    {
        retCode = CL_OSAL_RC(CL_ERR_INVALID_PARAMETER);
        clDbgCodeError(retCode, ("Number of semaphores to create (count) [%d] must be between [1] and [%d]", count,  CL_SEM_MAX_VALUE));
        CL_FUNC_EXIT();
        return(retCode);
    }

    len = (ClUint32T)strlen ((ClCharT*)pName);

#if 0 /* Stone: why this limitation? */
    if(len > 20)
        if(len > 256)
        {
            CL_DEBUG_PRINT (CL_DEBUG_INFO,("Sanity check, semaphore name length is suspiciously long"));
            retCode = CL_OSAL_RC(CL_OSAL_ERR_NAME_TOO_LONG);
            CL_FUNC_EXIT();
            return(retCode);
        }
#endif

    if(len > 256)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("Sanity check, semaphore name [%s] is suspiciously long",pName));
    }

    retCode = (ClInt32T)clCrc32bitCompute (pName, len, &key, NULL);
    CL_ASSERT(retCode == CL_OK); /* There is no possible error except for pName == NULL, which I've already checked, so don't check the retCode */


    sysErrnoChkRet(semId = semget ((key_t)key, (int)count, IPC_CREAT|0666));

    semArg.val = (int)count;

    /* Initialize all the semaphores to 0.  This should never fail, because I just created the semaphores */
    sysErrnoChkRet(semctl (semId, 0, SETVAL, semArg));

    *pSemId = (ClOsalSemIdT)semId;

    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:55,代码来源:clSysV.c


示例14: cosSysvShmIdGet

ClRcT
cosSysvShmIdGet(ClUint8T* pName, ClOsalShmIdT* pShmId)
{
    ClUint32T key = 0;
    ClUint32T len = 0;
    ClUint32T size = 0;
    ClInt32T shmId = 0;
    ClRcT retCode = CL_OK;

    CL_FUNC_ENTER();
    if(NULL == pShmId)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("\nShared Memory ID Get: FAILED"));
        retCode = CL_OSAL_RC(CL_ERR_NULL_POINTER);
        CL_FUNC_EXIT();
        return(retCode);
    }

    if(NULL == pName)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("\nShared Memory ID Get: FAILED"));
        retCode = CL_OSAL_RC(CL_ERR_NULL_POINTER);
        CL_FUNC_EXIT();
        return(retCode);
    }

    len = (ClUint32T)strlen ((ClCharT*)pName);

    retCode = clCrc32bitCompute (pName, len, &key, NULL);

    if(CL_OK != retCode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("\nShared Memory ID Get: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_ID_GET);
        CL_FUNC_EXIT();
        return(retCode);
    }

    shmId = shmget ((key_t)key, size, (0666 | IPC_CREAT));

    if(shmId < 0)
    {
        CL_DEBUG_PRINT (CL_DEBUG_INFO,("\nShared Memory ID Get: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_ID_GET);
        CL_FUNC_EXIT();
        return(retCode);
    }

    *pShmId = (ClOsalShmIdT)shmId;

    CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory ID Get: DONE"));
    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:54,代码来源:clSysV.c


示例15: clEsmInstanceEventAdd

/**
 *  Add event to the event q.
 *
 *  API to add event to the state machine instance queue.  The
 *  event properties are copied (a new event is created and 
 *  the contents of the event passed a re copied to the new 
 *  event), but the payload is just referenced and not copied.
 *  
 *  @param smThis Extended State machine Instance handle
 *  @param msg  Event information
 *
 *  @returns 
 *    CL_OK on CL_OK <br/>
 *    CL_SM_RC(CL_ERR_NO_MEMORY) on memory allocation FAILURE <br/>
 *    CL_SM_RC(CL_ERR_NULL_POINTER) on invalid/null instance handle <br/>
 *
 *  @see #clEsmInstanceProcessEvent
 *  @see #clEsmInstanceProcessEvents
 *
 */
ClRcT
clEsmInstanceEventAdd(ClExSmInstancePtrT smThis, 
                    ClSmEventPtrT msg
                    )
{
  ClRcT ret = CL_OK;

  CL_FUNC_ENTER();

  CL_ASSERT(smThis);
  CL_ASSERT(msg);

  if(smThis && msg)
    {
      ClSmQueueItemPtrT item;

      item = (ClSmQueueItemPtrT) mALLOC(sizeof(ClSmQueueItemT)); 
      if(!item)
        {
          ret = CL_SM_RC(CL_ERR_NO_MEMORY);
        }
      else 
        {
          if(ESM_LOCK(smThis)!=CL_OK)
            {
              ret = SM_ERR_LOCKED;
              mFREE(item);
              CL_FUNC_EXIT();
              return ret;
            }
          item->event = *msg;
          if (ESM_IS_PAUSED(smThis) && ESM_IS_DROP_ON_PAUSE(smThis))
          {
              ret = CL_OK;
              mFREE(item);
              ESM_UNLOCK(smThis);
              CL_FUNC_EXIT();
              return ret;
          }
          ret = SMQ_ENQUEUE(smThis->q, item);
          clLogTrace(ESM_LOG_AREA,ESM_LOG_CTX_EVENT,"Event %d added => ret [%d]",
                                item->event.eventId,
                                ret);
          ESM_UNLOCK(smThis);
        }
    } else 
      {
        ret = CL_SM_RC(CL_ERR_NULL_POINTER);
      }

  CL_FUNC_EXIT();
  return ret;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:73,代码来源:clSmExtended.c


示例16: clTimerDelete

ClRcT
clTimerDelete (ClTimerHandleT*  pTimerHandle)
{
    TsTimer_t* pUserTimer = NULL;
    ClRcT returnCode = CL_ERR_INVALID_HANDLE;

    CL_FUNC_ENTER();
    if (NULL == pTimerHandle) {
        returnCode = CL_TIMER_RC(CL_ERR_NULL_POINTER);
        clDbgCodeError(returnCode, ("Bad timer handle storage"));
        CL_FUNC_EXIT();
        return (returnCode);
    }

    pUserTimer = (TsTimer_t*) *pTimerHandle;
    if (pUserTimer == NULL) {
        returnCode = CL_TIMER_RC(CL_ERR_INVALID_HANDLE);
        clDbgCodeError(returnCode, ("Bad timer handle"));
        CL_FUNC_EXIT();
        return (returnCode);
    }
    if (pUserTimer->state == TIMER_FREE) {
        returnCode = CL_TIMER_RC(CL_TIMER_ERR_INVALID_TIMER);
        clDbgCodeError(returnCode, ("Double delete of a timer"));
        CL_FUNC_EXIT();
        return (returnCode);
    }

    /* if timer is active, remove it from the active-timers queue */
    returnCode = clTimerStop (*pTimerHandle);

    if (returnCode != CL_OK) {
        CL_DEBUG_PRINT (CL_DEBUG_WARN, ("\nTimer delete failed"));
        CL_FUNC_EXIT();
        return (returnCode);
    }

    /* null out all the values */
    pUserTimer->fpTimeOutAction = NULL;
    pUserTimer->pActionArgument = NULL;
    pUserTimer->state = TIMER_FREE;
    pUserTimer->pNextActiveTimer = NULL; /* valid only for active timers */
    pUserTimer->pPreviousActiveTimer = NULL; /* valid only for active timers */

    /* return timer to the free pool */
    tsFreeTimerReturn (pUserTimer);

    *pTimerHandle = NULL;

    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:52,代码来源:clTimerOld.c


示例17: cdbGDBMFirstRecordGet

static ClRcT
cdbGDBMFirstRecordGet(ClDBHandleT      dbHandle,    /* Handle to the database */
                      ClDBKeyT*        pDBKey,      /* Pointer to handle in which the key handle is returned */
                      ClUint32T*      pKeySize,    /* Pointer to size, in which the size of the key is returned */
                      ClDBRecordT*     pDBRec,      /* Pointer to handle in which the record handle is returned */
                      ClUint32T*      pRecSize)    /* Pointer to size, in which the size of the record is returned */
{
  ClRcT errorCode = CL_OK;
  GDBMHandle_t* pGDBMHandle = (GDBMHandle_t*)dbHandle;
  datum key = {NULL, 0};
  datum data = {NULL, 0};

  CL_FUNC_ENTER();
  NULL_CHECK(pDBKey);
  NULL_CHECK(pKeySize);

  NULL_CHECK(pDBRec);
  NULL_CHECK(pRecSize);

  /* Retrieve the first key in the database */  
  key = gdbm_firstkey(pGDBMHandle->gdbmInstance);

  if(NULL == key.dptr) {
    /* The first key does exist. So return error */
    errorCode = CL_DBAL_RC(CL_ERR_NOT_EXIST);
    CL_DEBUG_PRINT ( CL_DEBUG_TRACE,("\nGDBM record get failed"));
    CL_FUNC_EXIT();
    return(errorCode);
  }

  *pDBKey = (ClDBKeyT)key.dptr;
  *pKeySize = key.dsize;

  /* Retrieve the associated record in the database */
  data = gdbm_fetch(pGDBMHandle->gdbmInstance, key);

  if(NULL == data.dptr) {
    errorCode = CL_DBAL_RC(CL_ERR_NOT_EXIST);
    CL_DEBUG_PRINT ( CL_DEBUG_TRACE,("\nGDBM record fetch failed"));
    CL_FUNC_EXIT();
    return(errorCode);
  }
  
  *pDBRec = (ClDBRecordT)data.dptr;
  *pRecSize = data.dsize;

  CL_FUNC_EXIT();
  return(CL_OK);  

}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:50,代码来源:clovisGDBM.c


示例18: initSocket

static ClRcT
initSocket()
{
    char               *ipaddr;
    in_addr_t           addr_val;
    char               *port;
    uint16_t            port_num;

    CL_FUNC_ENTER();

    //
    // We'll want to get the address where we'll send instrumentation
    // information out of the environment.  Initialize the sockaddr
    // so after we create the socket we can connect it to the address.
    if ((ipaddr = getenv("CL_LOGGING_ADDR")) == 0)
    {
        clOsalPrintf("No value for CL_LOGGING_ADDR\n");
        CL_FUNC_EXIT();
        return CL_RC(0, CL_ERR_INVALID_PARAMETER);
    }
    if ((port = getenv("CL_LOGGING_PORT")) == 0)
    {
        clOsalPrintf("No value for CL_LOGGING_PORT\n");
        CL_FUNC_EXIT();
        return CL_RC(0, CL_ERR_INVALID_PARAMETER);
    }
    addr_val = inet_addr(ipaddr);
    port_num = atoi(port);
    memset(&instaddr, 0, sizeof instaddr);
    instaddr.sin_port = htons(port_num);
    instaddr.sin_addr.s_addr = addr_val;

    sock = socket(PF_INET, SOCK_DGRAM, 0);
    if (sock == -1)
    {
        clOsalPrintf("Failed to open socket");
        return CL_OSAL_ERR_OS_ERROR;
    }
//    if (connect(sock, &instaddr, sizeof addr) != 0)
//    {
//        clOsalPrintf("Failed to connect socket to %s/%s\n", ipaddr, port);
//        close(sock);
//        sock = -1;
//        CL_FUNC_EXIT();
//        return CL_OSAL_ERR_OS_ERROR;
//    }
    CL_FUNC_EXIT();
    return CL_OK;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:49,代码来源:clInst.c


示例19: clCorDataFrequentSave

ClRcT 
clCorDataFrequentSave(char *pFileName, ClTimerTimeOutT  frequency)
{
    ClRcT  rc = CL_OK;
    corPersisInfo_t corData;

	memset(&corData, 0, sizeof(corData));
    CL_FUNC_ENTER();
    CL_DEBUG_PRINT(CL_DEBUG_TRACE,("\n Inside clCorDataFrequentSave \n"));

    /* Validate input parameters */
    if (pFileName == NULL)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ( "clCorDataFrequentSave: NULL argument"));
        CL_FUNC_EXIT();
        return(CL_COR_SET_RC(CL_COR_ERR_NULL_PTR));
    }
    if (strlen(pFileName) >= COR_MAX_FILENAME_LEN)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ( "clCorDataFrequentSave: File name is too large"));
        CL_FUNC_EXIT();
        return(CL_COR_SET_RC(CL_COR_ERR_INVALID_PARAM));
    }


    /*memcpy(corData.fileName, (pFileName), sizeof(corData.fileName));*/
    memcpy(corData.fileName, (pFileName), strlen(pFileName)+1);
    /* corData.version   = CL_COR_VERSION_NO; */
	CL_COR_VERSION_SET(corData.version);
    corData.operation = COR_DATA_FREQ_SAVE;
    corData.frequency = frequency;
    
    COR_CALL_RMD(COR_EO_PERSISTENCY_OP,
                 VDECL_VER(clXdrMarshallcorPersisInfo_t, 4, 0, 0),
                 &corData,
                 sizeof(corData), 
                 VDECL_VER(clXdrUnmarshallcorPersisInfo_t, 4, 0, 0),
                 NULL,
                 NULL,
                 rc);
    if(rc != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ( "clCorDataFrequentSave returns error,rc=%x",rc));
    }

    
    CL_FUNC_EXIT();
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:49,代码来源:clCorProvDataClient.c


示例20: cosSysvShmSecurityModeSet

ClRcT
cosSysvShmSecurityModeSet(ClOsalShmIdT shmId,ClUint32T mode)
{
    struct shmid_ds shmPerm ;
    ClInt32T retCode = CL_OK;

    CL_FUNC_ENTER();

    /* Basically we dont want to allow RWX on User,Group and others (Nothing
     * greater than 111 111 111 (0777). Eight is for calculating the number of
     * bytes.9 is the number of bits that will used for RWX RWX RWX for
     * User Group Others.
     */

    if(mode & (((~(1 << ((sizeof(int) *8)- 1))))<< 9))
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeSet: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_MODE_SET);
        CL_FUNC_EXIT();
        return(retCode);
    }

    /* Get the current values set and modify it */
    retCode = shmctl ((int)shmId, IPC_STAT, &shmPerm);

    if(0 != retCode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeSet: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_MODE_SET);
        CL_FUNC_EXIT();
        return(retCode);
    }

    shmPerm.shm_perm.mode = (unsigned short int)mode;

    retCode = shmctl ((int)shmId, IPC_SET, &shmPerm);

    if(0 != retCode)
    {
        CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeSet: FAILED"));
        retCode = CL_OSAL_RC(CL_OSAL_ERR_SHM_MODE_SET);
        CL_FUNC_EXIT();
        return(retCode);
    }

    CL_DEBUG_PRINT (CL_DEBUG_TRACE,("\nShared Memory SecurityModeSet: DONE"));
    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:49,代码来源:clSysV.c



注:本文中的CL_FUNC_EXIT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CL_GetGlconfig函数代码示例发布时间:2022-05-30
下一篇:
C++ CL_Exception函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap