Esempio n. 1
0
	userdir_plugin(x0d::XzeroDaemon* d, const std::string& name) :
		x0d::XzeroPlugin(d, name),
		dirname_("/public_html")
	{
		setupFunction("userdir.name", &userdir_plugin::setup_userdir, x0::FlowType::String);
		mainFunction("userdir", &userdir_plugin::handleRequest);
	}
Esempio n. 2
0
int main(void) {
	e_iap_status iap_status;

	/* Fill the flash with payload and hash data */
	iap_status = (e_iap_status) generator_init();
	if (iap_status != CMD_SUCCESS)
		while (1)
			;   // Error !!!

	Details d;

	initButton();
    initDMA();
	initDetails(&d, getNumberOfChunks(), getSizeOfChunk());

	while (buttonIterrupt) {
	}

	int res = mainFunction(&d, 32);

	if(res==0) {
		blinkLed(1000000);
	}
	else {
		blinkLed(100);
	}


	return 0;
}
Esempio n. 3
0
void Display()
{
    glClear(GL_COLOR_BUFFER_BIT);

    //graphWin.drawAxes();
    mainFunction();
    glFlush();
}
Esempio n. 4
0
void Display()
{
    glClear(GL_COLOR_BUFFER_BIT);

    GeomGlut::getInstance()->drawAxes();
    mainFunction();
    glFlush();
}
Esempio n. 5
0
ReturnType getCamComp::onExecute()
{   	


	//if(pStorageface) cvReleaseMemStorage(&pStorageface);
	//PrintMessage("on execute \n ");
	
	if(capture!=NULL){
		numberFaces=mainFunction();
		std::ostringstream ossnumber;
		ossnumber<<numberFaces;
		stringnumberFaces=ossnumber.str();
		//cout<<"stringnumberfaces"<<stringnumberFaces<<std::endl;
        numberFacesOut.push(numberFaces);
		stringNumberFacesOut.push(stringnumberFaces);
		
		if (numberFaces==0)//sinon on continue d'envoyer les coord du dernier visage detecté
		{
			//PrintMessage("pas de visages \n");
			faceCoordinateOut.push("");

		}
		if (numberFaces!=0) 
			{	
			faceCoordinateOut.push(coordF);
			}
             

		

		if(numberFaces == oldNumberFaces){ if(pourcentFaces<100){pourcentFaces++;}}
		else { if(pourcentFaces>0){pourcentFaces--;}}
        
		if(pourcentFaces>pourcentPrecision)
		  {
		     string stringNumberFaces = static_cast<ostringstream*>( &(ostringstream() << numberFaces) )->str();
	       	 //numberFacesOut.push(stringNumberFaces);
			 oldNumberFaces=numberFaces;

			// PrintMessage("fonction bizare§§§§§§§§§§§§§§§§§§ \n" ); 
			 
            
             
			// voir si necessité d'une raz 
			

	       
		  }

	}
	else { 
		PrintMessage("capture nulle \n ");
	}
	//else{cout<<"capture null"<<std::endl;} 

	
	return OPROS_SUCCESS;
}
Esempio n. 6
0
void MainWindow::on_Experiment_clicked()
{
    ini = 0;

    ui->pBInicia->setEnabled(false);
    ui->Experiment->setEnabled(false);

    mainFunction(n_h_streets, m_v_streets, d_s_block, p_t, met, _P, maxim_n, maxim_m, min_time, max_time, metodo_s, precision, distance_d, distance_r, distance_e);

}
Esempio n. 7
0
/* main method {{{ */
int main(int argc, char *argv[]) {
    ConfigMap config;
    if(!parseOptions(argc,argv,config)) {        //Parse cmd line options
        cerr << "==> Try '" << argv[0] << " --usage'" << endl;
        return -1;
    }
    if(config.find("usage")!=config.end()||config.find("help")!=config.end()) {
        usage(argv[0]);
        return -1;
    }
    if(!parseConfig(config)) {
        cerr << "==> Try 'man " << argv[0] << "'" << endl;
        return -1;
    }
    return mainFunction(config);
}
Esempio n. 8
0
int
main(int ac, const char** av)
{
  const unsigned PropHeaderSize = 5;
  const unsigned HeaderSize = 13;

  SizeT inSize = SYMBOL(end) - SYMBOL(start);

  int32_t outSize32 = read4(SYMBOL(start) + PropHeaderSize);
  SizeT outSize = outSize32;

  uint8_t* out = static_cast<uint8_t*>(malloc(outSize));
  if (out) {
    ISzAlloc allocator = { myAllocate, myFree };
    ELzmaStatus status = LZMA_STATUS_NOT_SPECIFIED;

    if (SZ_OK == LzmaDecode
        (out, &outSize, SYMBOL(start) + HeaderSize, &inSize, SYMBOL(start),
         PropHeaderSize, LZMA_FINISH_END, &status, &allocator))
    {
      const unsigned BufferSize = 1024;
      char buffer[BufferSize];
      const char* name = temporaryFileName(buffer, BufferSize);
      if (name) {
        int file = open(name, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, S_IRWXU);
        if (file != -1) {
          SizeT result = write(file, out, outSize);
          free(out);

          if (close(file) == 0 and outSize == result) {
            void* library = openLibrary(name);
            unlink(name);

            if (library) {
              void* main = librarySymbol(library, "avianMain");
              if (main) {
                int (*mainFunction)(const char*, int, const char**);
                memcpy(&mainFunction, &main, sizeof(void*));
                return mainFunction(name, ac, av);
              } else {
                fprintf(stderr, "unable to find main in %s", name);
              }
            } else {
              fprintf(stderr, "unable to load %s: %s\n", name,
                      libraryError(library));
            }
          } else {
            unlink(name);

            fprintf(stderr, "close or write failed; tried %d, got %d; %s\n",
                    static_cast<int>(outSize), static_cast<int>(result),
                    strerror(errno));
          }
        } else {
          fprintf(stderr, "unable to open %s\n", name);
        }
      } else {
        fprintf(stderr, "unable to make temporary file name\n");
      }
    } else {
      fprintf(stderr, "unable to decode LZMA data\n");
    }
  } else {
    fprintf(stderr, "unable to allocate buffer of size %d\n",
            static_cast<int>(outSize));
  }

  return -1;
}
Esempio n. 9
0
/* 主程式 */
int main(){
	int errorCode=0;
	mainFunction(&errorCode);
	return(errorCode);
}