当前位置: 首页>>代码示例>>C++>>正文


C++ clprintf函数代码示例

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


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

示例1: clCompAppStateChange

ClRcT
clCompAppStateChange(
    ClEoStateT eoState)
{
    switch (eoState)
    {
        case CL_EO_STATE_SUSPEND:
        {
            /*
             * ---BEGIN_APPLICATION_CODE---
             */

            clprintf(CL_LOG_SEV_INFO,"csa102: Suspending...");
            running = 0;

            /*
             * ---END_APPLICATION_CODE---
             */

            break;
        }

        case CL_EO_STATE_RESUME:
        {
            /*
             * ---BEGIN_APPLICATION_CODE---
             */

            clprintf(CL_LOG_SEV_INFO,"csa102: Resuming...");
            running = 1;

            /*
             * ---END_APPLICATION_CODE---
             */

            break;
        }
        
        default:
        {
            break;
        }
    }
 
    return CL_OK;
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:46,代码来源:clCompAppMain.c

示例2: safRemoveWork

void safRemoveWork(SaInvocationT  invocation,
                   const SaNameT  *compName,
                   const SaNameT  *csiName,
                   SaAmfCSIFlagsT csiFlags)
{
    clprintf (CL_LOG_SEV_INFO, "Component [%.*s] : PID [%d]. CSI Remove Received\n", 
              compName->length, compName->value, mypid);

    clprintf (CL_LOG_SEV_INFO, "   CSI                     : %.*s\n", csiName->length, csiName->value);
    clprintf (CL_LOG_SEV_INFO, "   CSI Flags               : 0x%d\n", csiFlags);

    /*
     * Add application specific logic for removing the work for this CSI.
     */
    AddRemVirtualAddress("down",&gVirtualIp);
    saAmfResponse(amfHandle, invocation, SA_AIS_OK);
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:17,代码来源:main.c

示例3: activeLoop

void* activeLoop(void* p)
{
    while (running)
    {
        clprintf(CL_LOG_SEV_INFO,"csa102: Threaded Hello World! %s", show_progress());
        sleep(2);
    }
    return NULL;
}
开发者ID:dharamjhatakia,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:9,代码来源:clCompAppMain.c

示例4: clCompAppAMFCSIRemove

void clCompAppAMFCSIRemove(SaInvocationT  invocation,
                           const SaNameT  *compName,
                           const SaNameT  *csiName,
                           SaAmfCSIFlagsT csiFlags)
{
    clprintf (CL_LOG_SEV_INFO, "Component [%.*s] : PID [%d]. CSI Remove Received\n", 
              compName->length, compName->value, mypid);

    clprintf (CL_LOG_SEV_INFO, "   CSI                     : %.*s\n", csiName->length, csiName->value);
    clprintf (CL_LOG_SEV_INFO, "   CSI Flags               : 0x%d\n", csiFlags);

    /*
     * Add application specific logic for removing the work for this CSI.
     */

    saAmfResponse(amfHandle, invocation, SA_AIS_OK);

    return;
}
开发者ID:OpenClovis,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:19,代码来源:clCompAppMain.c

示例5: clCompAppTerminate

void
clCompAppTerminate(
    SaInvocationT       invocation,
    const SaNameT       *compName)
{
    SaAisErrorT rc = SA_AIS_OK;

    clprintf (CL_LOG_SEV_INFO, "Component [%.*s] : PID [%d]. Terminating\n",
              compName->length, compName->value, mypid);
    /*
     * Application should figure out whether the termination request
     * was for the proxy itself or one of its proxied components.
     *
     * In case the termination request was for a proxied component,
     * call the proxied specific termination function and unregister
     * the proxied component.
     * Otherwise, unregister the proxy component and
     * call the client finalize function.
     */


    /*
     * Unregister with AMF and send back a response
     */

    if ( (rc = saAmfComponentUnregister(amfHandle, compName, NULL)) != SA_AIS_OK)
        goto errorexit;

    saAmfResponse(amfHandle, invocation, SA_AIS_OK);

    clprintf (CL_LOG_SEV_INFO, "Component [%.*s] : PID [%d]. Terminated\n", compName->length, compName->value, mypid);

    unblockNow = CL_TRUE;

    return;

errorexit:

    clprintf (CL_LOG_SEV_ERROR, "Component [%.*s] : PID [%d]. Termination error [0x%x]\n",
              compName->length, compName->value, mypid, rc);

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

示例6: csa113Comp_PublishEvent

static SaAisErrorT csa113Comp_PublishEvent()
{
    SaEvtEventIdT      eventId         = 0;
    static int      index           = 0;
    SaSizeT         data_len        = 0;
    SaAisErrorT	    rc              = SA_AIS_OK;
    char            *data           = 0;
    typedef void (*Generator)(char **, ClSizeT*);

    //
    // Note: to add a new generator, just define it above and then include
    // the new functions name in the generators list.
    // Next, maybe something that gets disk free info by way of getfsent
    // and statfs?
    static Generator generators[]   =
    {
        generate_time_of_day,
        generate_load_average
    };

    //
    // every time through increment index and then set index to
    // it's value modulo the number of entries in the generators
    // array.  This will cause us to cycle through the list of
    // generators as we're called to publish events.
    (*generators[index++])(&data, &data_len);
    index %= (int)(sizeof generators / sizeof generators[0]);
    if (data == 0 || data_len == 0)
    {
        clprintf(CL_LOG_SEV_ERROR, "No event data generated.");
        return SA_AIS_ERR_NO_MEMORY;
    }
    clprintf(CL_LOG_SEV_INFO,"Publishing Event: %.*s\n",(int)data_len, data);
    rc = saEvtEventPublish(eventHandle, (void *)data, data_len, &eventId);
    if (rc != SA_AIS_OK)
    {
        clprintf(CL_LOG_SEV_ERROR,"Event publish attempt failed with error [%x]", rc);
    }
    clHeapFree(data);

    return SA_AIS_OK;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:42,代码来源:main.c

示例7: clPyGlueInit

void clPyGlueInit(char* appModule,void (*init_extensions[])(void),int argc, char**argv)
{
  char buf[1024];
  ClRcT rc;
    Py_Initialize();
    PySys_SetArgv(argc, argv);
    PyEval_InitThreads();
    
    if (init_extensions) 
      {
        int i = 0;
        for(i=0; init_extensions[i]!=NULL; i++) (*init_extensions[i])();
      }
    thrdState = PyThreadState_Get();

    rc = clOsalMutexInit(&pyMutex);
    CL_ASSERT(rc==CL_OK); 

    rc = clOsalCondInit(&event);
    CL_ASSERT(rc==CL_OK); 

    rc = clOsalMutexLock(&pyMutex);
    CL_ASSERT(rc==CL_OK); 

    PyThreadState_Swap(thrdState);

    PyRun_SimpleString("import os, os.path, sys\n");
    snprintf(buf,1024,"sys.path.append(os.path.realpath('%s'))\n",CL_APP_BINDIR);
    clprintf(CL_LOG_SEV_INFO, buf);
    PyRun_SimpleString(buf);
    //PyRun_SimpleString("sys.path.append(os.path.realpath('../../bin'))\n");
    snprintf(buf,1024,"from %s import *\n",appModule);
    clprintf(CL_LOG_SEV_INFO, buf);
    PyRun_SimpleString(buf);

    PyThreadState_Swap(NULL);
    PyEval_ReleaseLock();

    rc=clOsalMutexUnlock(&pyMutex);
    CL_ASSERT(rc==CL_OK); 

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

示例8: clCompAppTerminate

ClRcT
clCompAppTerminate(
    ClInvocationT       invocation,
    const SaNameT       *compName)
{
    ClRcT rc = CL_OK;

    clprintf ("Component [%s] : PID [%d]. Terminating\n",
              compName->value, mypid);

    /*
     * ---BEGIN_APPLICATION_CODE--- 
     */

    // ...

    /*
     * ---END_APPLICATION_CODE---
     */
    
    /*
     * Unregister with AMF and send back a response
     */

    if ( (rc = clCpmComponentUnregister(cpmHandle, compName, NULL)) )
        goto errorexit;
    if ( (rc = clCpmClientFinalize(cpmHandle)) )
        goto errorexit;

    clCpmResponse(cpmHandle, invocation, CL_OK);

    clprintf ("Component [%s] : PID [%d]. Terminated\n", compName->value, mypid);

    return rc;

errorexit:

    clprintf ("Component [%s] : PID [%d]. Termination error [0x%x]\n",
              compName->value, mypid, rc);

    return rc;
}
开发者ID:joaohf,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:42,代码来源:clCompAppMain.c

示例9: clCompAppTerminate

ClRcT
clCompAppTerminate(
    ClInvocationT       invocation,
    const ClNameT       *compName)
{
    ClRcT rc = CL_OK;

    clprintf (CL_LOG_SEV_INFO, "Component [%s] : PID [%ld]. Terminating",
              compName->value, mypid);

    /*
     * ---BEGIN_APPLICATION_CODE--- 
     */

    // ...

    /*
     * ---END_APPLICATION_CODE---
     */
    
    /*
     * Unregister with AMF and send back a response
     */

    if ( (rc = clCpmComponentUnregister(cpmHandle, compName, NULL)) )
        goto errorexit;
    if ( (rc = clCpmClientFinalize(cpmHandle)) )
        goto errorexit;

    clprintf (CL_LOG_SEV_INFO, "Component [%s] : PID [%ld]. Terminated", compName->value, mypid);
    clCpmResponse(cpmHandle, invocation, CL_OK);
    clEvalAppLogStreamClose(gEvalLogStream);

    return rc;

errorexit:

    clprintf (CL_LOG_SEV_ERROR, "Component [%s] : PID [%ld]. Termination error [0x%x]",
              compName->value, mypid, rc);

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

示例10: csa112Comp_appEventCallback

static void csa112Comp_appEventCallback(SaEvtSubscriptionIdT subscriptionId, SaEvtEventHandleT eventHandle, SaSizeT eventDataSize)
{
    SaAisErrorT     rc = SA_AIS_OK;
    static ClPtrT   resTest = 0;
    
    clprintf(CL_LOG_SEV_INFO,"We've got an event to receive\n");

    /* A high performance implementation would keep the buffer
       if it was big enough for the next event, OR even faster
       preallocate buffer(s) of the the maximum event size which
       can be known by controlling what processes publish to
       a particular event channel.

       This tutorial will simply free an realloc the event buffer.
    */
    if (resTest != 0)
    {
        clHeapFree((char *)resTest);
        resTest = 0;
    }
    resTest = clHeapAllocate(eventDataSize + 1);
    if (resTest == 0)
    {
        clprintf(CL_LOG_SEV_ERROR, "Failed to allocate space for event");
        return;
    }

    /* This API can be used outside of the callback routine, which is why
       you need to pass the size of the buffer you've allocated. */
    rc = saEvtEventDataGet(eventHandle, resTest, &eventDataSize);
    if (rc!= SA_AIS_OK)
    {
        clprintf(CL_LOG_SEV_ERROR, "Failed to get event data [0x%x]",rc);
        return;
    }
    
    /* This tutorial just prints the event.  Rather then rely on the correct
       null termination at the publisher side, I'm going to append a 0 at
       the end before printing it. */
    *(((char *)resTest) + eventDataSize) = 0;
    clprintf(CL_LOG_SEV_INFO,"received event: %s\n", (char *)resTest);
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:42,代码来源:main.c

示例11: clCompAppTerminate

static void clCompAppTerminate(SaInvocationT invocation, const SaNameT *compName)
{
    SaAisErrorT rc = SA_AIS_OK;

    clprintf (CL_LOG_SEV_INFO, "Component [%s] : PID [%d]. Terminating\n",
              compName->value, mypid);

    /*
     * ---BEGIN_APPLICATION_CODE--- 
     */

    //clPyGlueTerminate();

    /*
     * ---END_APPLICATION_CODE---
     */
    
    /*
     * Unregister with AMF and respond to AMF saying whether the
     * termination was successful or not.
     */

    if ( (rc = saAmfComponentUnregister(amfHandle, compName, NULL)) != SA_AIS_OK)
        goto errorexit;

    saAmfResponse(amfHandle, invocation, SA_AIS_OK);

    clprintf (CL_LOG_SEV_INFO, "Component [%s] : PID [%d]. Terminated\n",
              compName->value, mypid);

    unblockNow = CL_TRUE;
    
    return;

errorexit:

    clprintf (CL_LOG_SEV_ERROR, "Component [%s] : PID [%d]. Termination error [0x%x]\n",
              compName->value, mypid, rc);

    return;
}
开发者ID:rajiva,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:41,代码来源:amfpy.c

示例12: clamfMgmtSAAMFSITABLEProvObjectStart

/**
 * This function is called by the provisioning library before forwarding any of the
 * transaction requests to this application on this managed resource. Please refer the file
 * clamfMgmtSAAMFSITABLEOAMPConfig.h for detailed documentation for this function.
 */
void clamfMgmtSAAMFSITABLEProvObjectStart(ClCorMOIdPtrT pMoId, ClHandleT txnHandle)
{
    /*
     * ---BEGIN_APPLICATION_CODE---
    */

    clprintf(CL_LOG_SEV_INFO, "Inside the function %s", __FUNCTION__);

    /*
     * ---END_APPLICATION_CODE---
    */
}
开发者ID:NguyenHoangOC,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:17,代码来源:clamfMgmtsaAmfSITable.c

示例13: clcsa105CompCSA105RESProvObjectEnd

/**
 * This function is called by the provisioning library after all the transaction requests
 * for this managed resource are forwarded to this application. Please refer the file
 * clcsa105CompCSA105RESOAMPConfig.h for detailed documentation for this function.
 */
void clcsa105CompCSA105RESProvObjectEnd(ClCorMOIdPtrT pMoId, ClHandleT txnHandle)
{
    /*
     * ---BEGIN_APPLICATION_CODE---
     */

    clprintf(CL_LOG_SEV_INFO, "Inside the function %s", __FUNCTION__);

    /*
     * ---END_APPLICATION_CODE---
     */
}
开发者ID:dharamjhatakia,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:17,代码来源:clcsa105Compcsa105Res.c

示例14: clProvisioningTIMESETTABLEProvObjectEnd

/**
 * This function is called by the provisioning library after all the transaction requests
 * for this managed resource are forwarded to this application. Please refer the file
 * clProvisioningTIMESETTABLEOAMPConfig.h for detailed documentation for this function.
 */
void clProvisioningTIMESETTABLEProvObjectEnd(ClCorMOIdPtrT pMoId, ClHandleT txnHandle)
{
    /*
     * ---BEGIN_APPLICATION_CODE---
     */

    clprintf(CL_LOG_SEV_INFO, "Inside the function %s", __FUNCTION__);

    /*
     * ---END_APPLICATION_CODE---
     */
}
开发者ID:dharamjhatakia,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:17,代码来源:clProvisioningtimeSetTable.c

示例15: checkpoint_read_seq

SaAisErrorT checkpoint_read_seq(ClUint32T *seq)
{
    SaAisErrorT rc = SA_AIS_OK;
    ClUint32T err_idx; /* Error index in ioVector */
    ClUint32T seq_no = 0xffffffff;
    SaCkptIOVectorElementT iov = {
        .sectionId  = ckpt_sid,
        .dataBuffer = (ClPtrT)&seq_no,
        .dataSize   = sizeof(ClUint32T),
        .dataOffset = (ClOffsetT)0,
        .readSize   = sizeof(ClUint32T)
    };
        
    rc = saCkptCheckpointRead(ckpt_handle, &iov, 1, &err_idx);
    if (rc != SA_AIS_OK)
    {
        if (rc != SA_AIS_ERR_NOT_EXIST)  /* NOT_EXIST is ok, just means no active has written */
            return SA_AIS_OK;
        
        clprintf(CL_LOG_SEV_ERROR,"Error: [0x%x] from checkpoint read, err_idx = %u", rc, err_idx);
    }

    *seq = ntohl(seq_no);
    
    return SA_AIS_OK;
}

SaAisErrorT checkpoint_replica_activate(void)
{
    SaAisErrorT rc = SA_AIS_OK;

    if ((rc = saCkptActiveReplicaSet(ckpt_handle)) != SA_AIS_OK)
    {
        clprintf(CL_LOG_SEV_ERROR, "checkpoint_replica_activate failed [0x%x] in ActiveReplicaSet", rc);
    }
    else rc = SA_AIS_OK;

    return rc;
}
开发者ID:mrv-communications-pilot,项目名称:SAFplus-Availability-Scalability-Platform,代码行数:39,代码来源:checkpointFns.c


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