ClInt32T main(ClInt32T argc, ClCharT *argv[])
{
    SaAisErrorT rc = SA_AIS_OK;

    /* Connect to the SAF cluster */
    rc = initializeAmf();
    
    if( rc != SA_AIS_OK)
    {
      CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("CKPT: ckptInitialize failed [0x%X]\n\r", rc));
        return rc;
    }       
	
   
    /* Do the application specific initialization here. */
    
    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();
    
    
    /* Now finalize my connection with the SAF cluster */
    rc = saAmfFinalize(amfHandle);
      

    return 0;
}
int main(int argc, char *argv[])
{
    ClRcT   rc = CL_OK;
    if (argc < 2){
        clLog (EMER,GEN,NA, "usage : %s", GMS_USAGE);
        exit(0);
    }

    /* Connect to the SAF cluster */
    rc = initializeAmf();
    if( rc != CL_OK)
    {
        clLogCritical(GEN,NA,
                      "GMS: gmsInitialize failed [0x%X]\n\r", rc);
        return rc;
    }
    _clGmsServiceInitialize ( argc , argv );

    
    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();
    
    saAmfFinalize(amfHandle); 

    return 0;
}
int main(int argc, char *argv[])
{
    SaAisErrorT rc = SA_AIS_OK;

    /* Connect to the SAF cluster */
    initializeAmf();

    /* Do the application specific initialization here. */
    /* Set up console redirection for demo purposes */
    (void)ev_init(argc, argv, (ClCharT*)appName.value);

    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();
    
    /* Do the application specific finalization here. */

    /* Now finalize my connection with the SAF cluster */
    if((rc = saAmfFinalize(amfHandle)) != SA_AIS_OK)
      clprintf (CL_LOG_SEV_ERROR, "AMF finalization error[0x%X]", rc);
    else
      clprintf (CL_LOG_SEV_INFO, "AMF Finalized");   

    return 0;
}
int main(int argc, char *argv[])
{
    SaAisErrorT rc = SA_AIS_OK;

    /* Connect to the SAF cluster */
    initializeAmf();

    /* Do the application specific initialization here. */
    
    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();

    checkpoint_finalize();
    
    /* Do the application specific finalization here. */

    /* Now finalize my connection with the SAF cluster */
    if((rc = saAmfFinalize(amfHandle)) != SA_AIS_OK)
      clprintf (CL_LOG_SEV_ERROR, "AMF finalization error[0x%X]", rc);
    else
      clprintf (CL_LOG_SEV_INFO, "AMF Finalized");   

    return 0;
}
Ejemplo n.º 5
0
Archivo: dev.cpp Proyecto: nyorain/ny
int main()
{
	auto& backend = ny::Backend::choose();
	auto ac = backend.createAppContext();

	ny::BufferSurface* bufferSurface {};
	MyWindowListener listener;

	ny::WindowSettings settings;
	settings.title = "Ayy sick shit";
	settings.listener = &listener;
	settings.surface = ny::SurfaceType::buffer;
	settings.buffer.storeSurface = &bufferSurface;
	auto wc = ac->createWindowContext(settings);

	ny::LoopControl control;

	listener.lc = &control;
	listener.ac = ac.get();
	listener.wc = wc.get();
	listener.surface = bufferSurface;

	ny::log("Entering main loop");
	ac->dispatchLoop(control);
}
Ejemplo n.º 6
0
    void
    BottomTracker::brake(bool start) const
    {
      IMC::Brake brk;
      brk.setSourceEntity(m_args->eid);
      brk.op = start ? IMC::Brake::OP_START : IMC::Brake::OP_STOP;
      dispatchLoop(brk);

      if (start)
        info(DTR("Started braking"));
      else
        info(DTR("Stopped braking"));
    }
ClInt32T main(ClInt32T argc, ClCharT *argv[])
{
   ClRcT  rc = CL_OK;
   rc = clLogSvrInitialize(argc,argv);
   if(rc != CL_OK)
   {
        CL_LOG_DEBUG_ERROR(("clLogSvrInitialize() failed with : rc[0x %x]", rc));
        return rc;
   }
   dispatchLoop();
   saAmfFinalize(amfHandle);   
   return 0;
}
Ejemplo n.º 8
0
Archivo: intro.cpp Proyecto: nyorain/ny
//Main function that just chooses a backend, creates Window- and AppContext from it, registers
//a custom EventHandler and then runs the mainLoop.
//There is no special main function (like WinMain or sth.) needed for different backends.
int main()
{
	//We let ny choose a backend.
	//If no backend is available, this function will simply throw an exception.
	//The backend will determine the type of display manager used, usually there is only
	//one available, but for corner cases (like e.g. wayland and XWayland) it will choose the
	//better/native one (in this case wayland).
	auto& backend = ny::Backend::choose();

	//Here we let the backend create an AppContext implementation.
	//This represents the connection to the display, our method of creating windows and
	//receiving events.
	auto ac = backend.createAppContext(); //decltype(ac): std::unique_ptr<ny::AppContext>

	//Now we let the AppContext create a WindowContext implementation.
	//Just use the defaulted WindowSettings.
	//This can later be used to change various aspects of the created window.
	ny::WindowSettings settings;
	auto wc = ac->createWindowContext(settings); //decltype(wc): std::unique_ptr<ny::WindowContext>

	//Now we create a LoopControl object.
	//With this object we can stop the dispatchLoop (which is called below) from the inside
	//or even from different threads (see ny-multithread).
	//We construct the EventHandler with a reference to it and when it receives an event that
	//the WindowContext was closed, it will stop the dispatchLoop, which will end this
	//program.
	ny::LoopControl control;
	MyEventHandler handler(control, *wc);

	//This call registers our EventHandler to receive the WindowContext related events from
	//the dispatchLoop.
	wc->eventHandler(handler);
	wc->refresh();

	//ny::log can be used to easily output application information.
	//There are also other output methods, see ny/log.hpp.
	//The call will have no cost/effect when not compiled in debug mode.
	ny::log("Entering main loop");
	ac->dispatchLoop(control);
}
ClInt32T main(ClInt32T argc, ClCharT *argv[])
{
    SaAisErrorT rc = SA_AIS_OK;

    /* Connect to the SAF cluster */
    rc = initializeAmf();
    if( rc != SA_AIS_OK)
    {
       clLogCritical(CL_LOG_AREA_UNSPECIFIED, CL_LOG_CONTEXT_UNSPECIFIED,
                     "CKPT: ckptInitialize failed [0x%X]\n\r", rc);
        return rc;
    }       
        
    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();
        
    /* Now finalize my connection with the SAF cluster */
    rc = saAmfFinalize(amfHandle);
   
    return 0;
}
ClInt32T main(ClInt32T argc, ClCharT *argv[])
{
    ClRcT rc = CL_OK;

    /* Connect to the SAF cluster */

    rc = initializeAmf();
    if(rc != CL_OK)
    {
       CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("MSG: msgInitialize failed [0x%X]\n\r", rc));
       return rc;
    }

    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();

    /* Now finalize my connection with the SAF cluster */

   saAmfFinalize(amfHandle);

   return 0;
}
ClInt32T main(ClInt32T argc, ClCharT *argv[])
{
    ClRcT rc = CL_OK;

    clAppConfigure(&clEoConfig,clEoBasicLibs,clEoClientLibs);
    
    rc = clEvtInitialize(argc,argv);
    if( rc != CL_OK )
    {
        CL_DEBUG_PRINT(CL_DEBUG_CRITICAL,
                       ("Event: clEvtInitialize failed [0x%X]\n\r", rc));
        return rc;
    }
            
    /* Block on AMF dispatch file descriptor for callbacks.
       When this function returns its time to quit. */
    dispatchLoop();
    
    /* Do the Event Service finalization here. */
    
   saAmfFinalize(gClEvtAmfHandle);
     
   return 0;
}