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

C++ CL_DEBUG_PRINT函数代码示例

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

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



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

示例1: clBitmapRealloc

static ClRcT
clBitmapRealloc(ClBitmapInfoT  *pBitmapInfo, 
                ClUint32T      bitNum)
{
    ClRcT      rc     = CL_OK;
    ClUint32T  nBytes = 0;
    ClUint32T  nInit  = 0;

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Enter: %u", bitNum));

    nBytes = bitNum / CL_BM_BITS_IN_BYTE;
    ++nBytes; /* bitNum is 0-based */
    pBitmapInfo->pBitmap = clHeapRealloc(pBitmapInfo->pBitmap, nBytes); 
    if( NULL == pBitmapInfo->pBitmap )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clHeapRealloc() failed"));
        return CL_BITMAP_RC(CL_ERR_NO_MEMORY); 
    }
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Reallocated: %u from %u", nBytes, 
                   pBitmapInfo->nBytes));

    nInit = nBytes - pBitmapInfo->nBytes;
    memset(&(pBitmapInfo->pBitmap[pBitmapInfo->nBytes]), 0, nInit);
    pBitmapInfo->nBytes = nBytes;

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:28,代码来源:clBitmap.c


示例2: 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


示例3: clMemPartRealloc

ClPtrT clMemPartRealloc(ClMemPartHandleT handle, ClPtrT memBase, ClUint32T size)
{
    MEM_PART_STATS memPartStats;
    ClPtrT mem = NULL;
    ClMemPartT *pMemPart = NULL;
    ClRcT rc = CL_OK;

    if(!(pMemPart = (ClMemPartT*)handle) )
        return NULL;

    if(!size) size = 16;

    clOsalMutexLock(&pMemPart->mutex);
    if(memPartInfoGet(pMemPart->partId, &memPartStats) == ERROR)
    {
        clOsalMutexUnlock(&pMemPart->mutex);
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("memPartInfoGet for size [%d] failed with [%s]\n", size, strerror(errno)));
        return mem;
    }
    if(size >= memPartStats.numBytesFree)
    {
        if( (rc = clMemPartExpand(pMemPart, CL_MEM_PART_EXPANSION_SIZE) ) != CL_OK)
        {
            /* do nothing now and fall back to realloc.*/
        }
    }
    mem = memPartRealloc(pMemPart->partId, memBase, size);
    clOsalMutexUnlock(&pMemPart->mutex);
    if(!mem)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Mem part realloc failure for size [%d]\n", size));
        CL_ASSERT(0);
    }
    return mem;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:35,代码来源:clMemPart.c


示例4: omValidateHandle

/**
 *NOT AN EXTERNAL API. PLEASE DO NOT DOCUMENT.
 *                                                                       
 * Validates the object handle that is provided as an input argument to
 * this routine.
 */
ClRcT
omValidateHandle(ClHandleT handle)
{
	ClOmClassControlBlockT * pTab;
	ClOmClassTypeT   classId = CL_OM_HANDLE_TO_CLASSID(handle);
	ClUint32T instId  = CL_OM_HANDLE_TO_INSTANCEID(handle);

    CL_FUNC_ENTER();

    /* validate the input argument class Id field */
	if (omClassTypeValidate(classId) != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR,
                ("Invalid classID field within handle argument"));
	return (CL_OM_SET_RC(CL_OM_ERR_INVALID_CLASS));
    }
    pTab = clOmClassEntryGet(classId);
	CL_ASSERT(pTab);

    if (instId > pTab->maxObjInst)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR,
                ("Invalid instance ID field within handle argument"));
	return (CL_OM_SET_RC(CL_OM_ERR_INVALID_OBJ_INSTANCE));
    }

    if (!mGET_REAL_ADDR(pTab->pInstTab[instId]))
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR,
                ("The Instance Table for this class is not initialized"));
	return (CL_OM_SET_RC(CL_OM_ERR_INSTANCE_TAB_NOINIT));
    }
    CL_FUNC_EXIT();
    return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:41,代码来源:omObjUtils.c


示例5: 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


示例6: clOmNumberOfOmClassInstancesGet

/**
 * Get number of instances for given OM.
 *
 * This routine returns the total number of instances that are managed
 * by Object Manager for given class.
 *
 * @param handle - OM Handle
 * @param numInstances - [OUT]number of instances the class has
 *
 * @returns CL_OK if number of instances could be obtained successfully
 * @returns  CL_OM_ERR_INVALID_CLASS if the class passed by means of handle is
 *								is not valid
 */
ClRcT
clOmNumberOfOmClassInstancesGet(ClHandleT handle, ClUint32T *numInstances)
{
	ClOmClassTypeT classId = CL_OM_HANDLE_TO_CLASSID(handle);
	ClOmClassControlBlockT * pTab = NULL;

	CL_FUNC_ENTER();
	CL_ASSERT(numInstances);

        /* sanity check for input parameters */
        if(numInstances == NULL)
        {
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL input argument"));
		return (CL_OM_SET_RC(CL_OM_ERR_NULL_PTR));
	}

	if (omClassTypeValidate(classId) != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR,
                ("Invalid classID field within handle argument"));
	return (CL_OM_SET_RC(CL_OM_ERR_INVALID_CLASS));
    }
    pTab = clOmClassEntryGet(classId);
	CL_ASSERT(pTab);
	*numInstances = pTab->curObjCount;

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


示例7: clOmObjectReferenceByOmHandleGet

/**
 * Get OM object reference given handle
 *
 * This routine returns the reference to the OM object, from the input
 * OM object handle
 *
 * @param pThis - OM Object Handle
 * @param objRef - [OUT]Object reference
 *
 * @returns CL_OK if number of instances could be obtained successfully
 * @returns  CL_OM_ERR_INVALID_OBJ_HANDLE if the object handle passed
 *								is not valid
 */
ClRcT 
clOmObjectReferenceByOmHandleGet(ClHandleT pThis, void **objRef)
{
	ClOmClassControlBlockT * 	pTab = NULL;
	ClOmClassTypeT     classId;
	ClUint32T    	instId;

	CL_FUNC_ENTER();

	CL_ASSERT(pThis);
	CL_ASSERT(objRef);

	if (!objRef)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL pointer passed"));
		return (CL_OM_SET_RC(CL_OM_ERR_INVALID_OBJ_REF));
	}

	if (omValidateHandle(pThis) != CL_OK)
	{
             CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid input handle argument"));
	     return (CL_OM_SET_RC(CL_OM_ERR_INVALID_OBJ_HANDLE));
	}

	classId = CL_OM_HANDLE_TO_CLASSID(pThis);
	instId  = CL_OM_HANDLE_TO_INSTANCEID(pThis);
        pTab = clOmClassEntryGet(classId);
	CL_ASSERT(pTab);
	*objRef = (char *)mGET_REAL_ADDR(pTab->pInstTab[instId]);
	return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:44,代码来源:omObjUtils.c


示例8: timeStamp

void timeStamp(ClCharT timeStr [], ClUint32T    len)
{
    time_t  timer ;
    struct  tm *t = NULL;
    ClCharT * pBuff =NULL;

   struct tm *localtimebuf = clHeapAllocate(sizeof(struct tm));;
   if(localtimebuf == NULL)
   {
      CL_DEBUG_PRINT(CL_DEBUG_ERROR,( "\nMemory Allocation failed\n"));
      return ;
   }
   ClCharT *asctimebuf   = clHeapAllocate(BUFFER_LENGTH*sizeof(ClCharT));
   if(asctimebuf == NULL)
   {
      CL_DEBUG_PRINT(CL_DEBUG_ERROR,( "\nMemory Allocation failed\n"));
      return ;
   }

   memset(&timer,0,sizeof(time_t));
    time(&timer);
    t = localtime_r(&timer,localtimebuf);
    pBuff=asctime_r(t,asctimebuf);
    strncpy(timeStr,pBuff,len-1);
    timeStr[strlen(timeStr) - 1] ='\0';
	clHeapFree(localtimebuf);
	clHeapFree(asctimebuf);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:28,代码来源:clFaultHistory.c


示例9: clOmObjectByReferenceDelete

/**
 * Delete OM object given reference.
 *
 * This routine deletes the object given an input reference to the object
 *
 * @param pThis - Object reference of the object to be deleted.
 *
 * @returns CL_OK if the delete operation is successful
 *
 */
ClRcT
clOmObjectByReferenceDelete(void *pThis)
{
    ClHandleT handle;
    int rc;

    CL_FUNC_ENTER();

    CL_ASSERT(pThis);

    if (!pThis)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL pointer passed"));
        return (CL_OM_SET_RC(CL_OM_ERR_INVALID_OBJ_REF));
    }
    handle = ((struct CL_OM_BASE_CLASS *)pThis)->__objType;
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("The Handle is %#llX, Obj reference = %p",
                                    handle, pThis));

    if ((rc = omCommonDeleteObj(handle, 1, CL_OM_DELETE_FLAG, NULL, 0)) !=
            CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Failed to delete OM object"));
        return (CL_OM_SET_RC(CL_OM_ERR_INVALID_OBJ_REF));
    }

    return (CL_OK);
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:38,代码来源:omObjManage.c


示例10: dbalGetLibName

ClRcT dbalGetLibName(ClCharT  *pLibName)
{
    ClParserPtrT   parent     = NULL ;   /*parent*/
    ClParserPtrT   engineType = NULL ;   /*parser ptr to Component*/
    ClParserPtrT   libName    = NULL ;   /*parser ptr to ckptName*/
    ClParserPtrT   fileName    = NULL ;   /*parser ptr to ckptName*/
    ClRcT          rc         = CL_OK;
    ClCharT       *configPath = NULL;

    configPath = getenv("ASP_CONFIG");
    if (configPath != NULL)
    {
        parent    = clParserOpenFile(configPath, "clDbalConfig.xml");
        if (parent == NULL)
        {
          CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Xml file for config is not proper rc [0x %x]\n",rc));
          return CL_ERR_NULL_POINTER;
        }
    }
    else
    {
        rc = CL_ERR_NULL_POINTER;
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("ASP_CONFIG path is not set in the environment irc[0x %x] \n",rc));
    }
    if(parent != NULL)
    {
       engineType = clParserChild(parent,"Dbal");
       libName    = clParserChild(engineType,"Engine");
       fileName   = clParserChild(libName,"FileName");
    }
    if(fileName != NULL && pLibName != NULL)
      strcpy(pLibName, fileName->txt); 
    if (parent != NULL) clParserFree(parent);
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:35,代码来源:clDbalParse.c


示例11: heapAllocateDebug

/* The debug versions of the heap routines */
static
ClPtrT
heapAllocateDebug(
        ClUint32T size)
{
    ClPtrT          pAddress    = NULL;
    ClPoolConfigT*  pPoolConfig = NULL;
    ClPoolConfigT   poolKey     = { 0 };
    ClPoolT         poolHandle;
    ClPtrT           pCookie     = NULL;
    ClRcT           rc;
    ClUint32T       overhead    = 0;

    /* Add the overhead over here for debug allocation.  */
    CL_HEAP_OVERHEAD_DEBUG (overhead);

    size += overhead;

    poolKey.chunkSize = size;

    /*
     * Do a binary search to get an index into the chunk config and hence
     * pool handle to allocate from.
     */
    rc = clBinarySearch ((ClPtrT)&poolKey, gHeapList.heapConfig.pPoolConfig,
            gHeapList.heapConfig.numPools, sizeof (ClPoolConfigT),
            clPoolCmp, (ClPtrT*)&pPoolConfig);
    if (rc != CL_OK)
    {
        CL_HEAP_MEM_TRACKER_TRACE(NULL,size);
        CL_DEBUG_PRINT (CL_DEBUG_ERROR,
                ("Error in getting pool handle for size:%d\n", size));
        goto out;
    }

    poolHandle = gHeapList.pPoolHandles [
        pPoolConfig - gHeapList.heapConfig.pPoolConfig ];

    rc = clPoolAllocate (poolHandle, (ClUint8T**) &pAddress, &pCookie);
    if (rc != CL_OK)
    {
        CL_HEAP_MEM_TRACKER_TRACE(NULL,size);
        CL_DEBUG_PRINT (CL_DEBUG_ERROR,
                ("Error allocating memory from pool size:%d for input "
                 "size:%d\n", pPoolConfig->chunkSize, size));
        goto out;
    }

    CL_HEAP_MEM_TRACKER_ADD (pAddress, pPoolConfig->chunkSize, pCookie);

    size -= overhead;

    CL_HEAP_SET_DEBUG_COOKIE (pAddress, pPoolConfig->chunkSize, size, pCookie);

    /*Zero off the contents till ASP gets cured*/
    memset (pAddress, 0, size);

    out:
    return (ClPtrT)pAddress;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:61,代码来源:clHeapDebug.c


示例12: clBitmapCreate

/*
 * clBitmapCreate()
 */
ClRcT
clBitmapCreate(ClBitmapHandleT  *phBitmap, 
               ClUint32T        bitNum)
{
    ClRcT          rc           = CL_OK;

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Enter"));

    if ( NULL == phBitmap)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Null Pointer"));
        return CL_BITMAP_RC(CL_ERR_NULL_POINTER);
    }

    *phBitmap = clHeapRealloc(NULL, sizeof(ClBitmapInfoT)); 
    if( NULL == *phBitmap)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clHeapRealloc() failed"));
        return CL_BITMAP_RC(CL_ERR_NO_MEMORY); 
    }
    
    rc = clBitmapInfoInitialize(*phBitmap, bitNum);
    if (rc != CL_OK)
    {
        clHeapFree(phBitmap);
        return rc;
    }
    
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc; 
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:34,代码来源:clBitmap.c


示例13: clBitmapInfoInitialize

static ClRcT 
clBitmapInfoInitialize(ClBitmapInfoT  *pBitmapInfo, 
                       ClUint32T      bitNum)
{
    ClRcT          rc           = CL_OK;    

    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Enter"));

    rc = clOsalMutexCreate(&(pBitmapInfo->bitmapLock));
    if( CL_OK != rc )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clOsalMutexCreate() rc: %x", rc));
        return rc;
    }

    pBitmapInfo->pBitmap  = NULL;
    pBitmapInfo->nBytes   = 0;
    pBitmapInfo->nBits    = 0;
    pBitmapInfo->nBitsSet = 0;
    rc = clBitmapRealloc(pBitmapInfo, bitNum);    
    if( CL_OK != rc )
    {
        clOsalMutexDelete(pBitmapInfo->bitmapLock);
        return rc;
    }
    pBitmapInfo->nBits = bitNum + 1; /* bitNum is 0-based FIXME i felt this is
                                      wrong*/
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:30,代码来源:clBitmap.c


示例14: clBitmap2BufferGet

ClRcT
clBitmap2BufferGet(ClBitmapHandleT  hBitmap,
                   ClUint32T        *pListLen,
                   ClUint8T         **ppPositionList)
{
    ClBitmapInfoT  *pBitmapInfo = hBitmap;
    ClRcT          rc           = CL_OK;

    if( CL_BM_INVALID_BITMAP_HANDLE == hBitmap )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid Handle"));
        return CL_BITMAP_RC(CL_ERR_INVALID_HANDLE);
    }

    rc = clOsalMutexLock(pBitmapInfo->bitmapLock);
    if( CL_OK != rc )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clOsalMutexLock() rc: %x", rc)); 
        return rc;
    }
    *ppPositionList = clHeapCalloc(pBitmapInfo->nBytes, sizeof(ClUint8T));
    if( NULL == *ppPositionList )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("clHeapCalloc()"));
        clOsalMutexUnlock(pBitmapInfo->bitmapLock);
        return rc;
    }
    memcpy(*ppPositionList, pBitmapInfo->pBitmap, pBitmapInfo->nBytes);
    *pListLen = pBitmapInfo->nBytes;

    clOsalMutexUnlock(pBitmapInfo->bitmapLock);
    CL_DEBUG_PRINT(CL_DEBUG_TRACE, ("Exit"));
    return rc;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:34,代码来源:clBitmap.c


示例15: clOmClassNameGet

/**
 * Get class name
 * 
 * Gives class name given the OM Handle.
 *
 * @param handle - OM Handle
 * @param nameBuf - [OUT]Buffer where class name is copied
 *
 * @returns CL_OK if the handle is valid and class name is obtained
 *					successfully
 *@returns CL_OM_ERR_INVALID_OBJ_HANDLE if the passed object handle 
 *					 is invalid
 */
ClRcT
clOmClassNameGet(ClHandleT handle, char *nameBuf)
{
	ClOmClassControlBlockT * pTab = NULL;

	CL_FUNC_ENTER();
	CL_ASSERT(nameBuf);

	if (omValidateHandle(handle) != CL_OK)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Invalid input handle argument"));
		return (CL_OM_SET_RC(CL_OM_ERR_INVALID_OBJ_HANDLE));
	}

	if (!nameBuf)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL name buffer passed"));
		return (CL_ERR_NULL_POINTER);
	}
    pTab = clOmClassEntryGet(CL_OM_HANDLE_TO_CLASSID(handle));
	CL_ASSERT(pTab);
	strcpy(nameBuf, (const char*) pTab->className);
	CL_FUNC_EXIT();
	return (CL_OK);
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:38,代码来源:omObjUtils.c


示例16: cosSysvMutexValueSet

ClRcT
cosSysvMutexValueSet(ClOsalMutexIdT mutexId, ClInt32T value)
{
    ClOsalMutexT *pMutex = (ClOsalMutexT *) mutexId;
    ClRcT rc = CL_OK;
    ClInt32T semId = pMutex->shared_lock.sem.semId;
    ClInt32T err = 0;
    CosSemCtl_t arg = {0};

    CL_FUNC_ENTER();

    if(value >= SEMVMX)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Error in setting sem value to [%d]\n", value));
        rc = CL_OSAL_RC(CL_ERR_INVALID_PARAMETER);
        goto out;
    }
    arg.val = value;
    err = semctl(semId, 0, SETVAL, arg);
    if(err < 0 )
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Mutex value set- semctl error: [%s]\n", strerror(errno)));
        rc = CL_OSAL_RC(CL_ERR_LIBRARY);
        goto out;
    }

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


示例17: clOmParentClassGet

/**
 * This routine returns the class of the super class of the parent class
 */
ClRcT
clOmParentClassGet(ClHandleT handle, ClOmClassTypeT *peParentClass)
{
	ClOmClassTypeT classId = CL_OM_HANDLE_TO_CLASSID(handle); 
	ClOmClassControlBlockT * pTab = NULL;

	CL_FUNC_ENTER();

	/* sanity check for input parameters */
	if(NULL == peParentClass)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL input argument"));
		return CL_OM_SET_RC(CL_OM_ERR_NULL_PTR);
	}

	if (omClassTypeValidate(classId) != CL_OK)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR,
					("Invalid classID field within handle argument"));
		return CL_OM_SET_RC(CL_OM_ERR_INVALID_CLASS);
	}
	pTab = clOmClassEntryGet(classId);
	if(NULL == pTab)
	{
		CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("Class Entry not found for classId %d\n",classId));
		return CL_OM_SET_RC(CL_OM_ERR_INVALID_CLASS);
	}
	*peParentClass = pTab->eParentObj;

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


示例18: 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


示例19: clOmClassVersionGet

/**
 * Get class version
 *
 * This routine returns the current version that is associated with the
 * class of objects.
 *
 * @param handle - OM handle
 * @param version - [OUT] Version of th class
 *
 * @returns CL_OK if number of instances could be obtained successfully
 * @returns  CL_OM_ERR_INVALID_CLASS if the class passed by means of handle is
 *								is not valid
 */
ClRcT
clOmClassVersionGet(ClHandleT handle, ClUint32T *version)
{
	ClOmClassTypeT classId = CL_OM_HANDLE_TO_CLASSID(handle);
	ClOmClassControlBlockT * pTab = NULL;

	CL_ASSERT(version);
	CL_FUNC_ENTER();

	if (omClassTypeValidate(classId) != CL_OK)
    {
        CL_DEBUG_PRINT(CL_DEBUG_ERROR,
                ("Invalid classID field within handle argument"));
	return (CL_OM_SET_RC(CL_OM_ERR_INVALID_CLASS));
    }

	if (!version)
	{
            CL_DEBUG_PRINT(CL_DEBUG_ERROR, ("NULL version argument passed"));
  	    return (CL_ERR_INVALID_PARAMETER);
	}

    pTab = clOmClassEntryGet(classId);
	CL_ASSERT(pTab);
	*version = pTab->vVersion;

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


示例20: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ CL_Disconnect函数代码示例发布时间:2022-05-30
下一篇:
C++ CL_DEBUG函数代码示例发布时间: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