Пример #1
0
Файл: cgi.c Проект: Accio/ribios
SEXP r_cgiParameters() {
  int i;
  char *name;
  Stringa value=stringCreate(16);
  Texta keys=textCreate(8);
  Texta values=textCreate(8);
  SEXP r_keys, r_values;

  cgiGetInit();

  while(name = cgiGetNext(value)) {
    textAdd(keys, name);
    textAdd(values, string(value));
  }
  
  int n=arrayMax(keys);
  PROTECT(r_keys=allocVector(STRSXP, n));
  PROTECT(r_values=allocVector(STRSXP, n));
  for(i=0; i<n; ++i) {
    SET_STRING_ELT(r_keys, i, mkChar(textItem(keys,i)));
    SET_STRING_ELT(r_values, i, mkChar(textItem(values,i)));
  }
  setNames(r_values, r_keys);

  stringDestroy(value);
  textDestroy(keys);
  textDestroy(values);
  UNPROTECT(2);
  return(r_values);
}
Пример #2
0
void ccCorkDlg::swap()
{
	m_isSwapped = !m_isSwapped;

	QString A = meshALineEdit->text();
	QString B = meshBLineEdit->text();
	setNames(B,A);
}
Пример #3
0
/*!  
 *  Constructor for parallel 3D grid.
 *  Calls default constructor and sets provided input information.
 *  @param[in]  dir_        directory of VTK file with final "/"
 *  @param[in]  name_       name of VTK without suffix
 *  @param[in]  codex_      codex of data [VTKFormat::ASCII/VTKFormat::APPENDED]
 *  @param[in]  n1_         min node index in first direction 
 *  @param[in]  n2_         max node index in first direction 
 *  @param[in]  m1_         min node index in second direction 
 *  @param[in]  m2_         max node index in second direction 
 *  @param[in]  l1_         min node index in third direction 
 *  @param[in]  l2_         max node index in third direction 
 */
VTKRectilinearGrid::VTKRectilinearGrid( std::string dir_, std::string name_, VTKFormat codex_, int n1_, int n2_, int m1_, int m2_, int l1_, int l2_ ) :VTKRectilinearGrid( ) {

    setNames( dir_, name_ ) ;

    setDimensions( n1_, n2_, m1_, m2_, l1_, l2_) ;
    setGeomCodex( codex_ ) ;

    return ;
};
Пример #4
0
/*!  
 *  Constructor for serial 2D grid.
 *  Calls default constructor and sets provided input information.
 *  @param[in]  dir_        directory of VTK file with final "/"
 *  @param[in]  name_       name of VTK without suffix
 *  @param[in]  codex_      codex of data [VTKFormat::ASCII/VTKFormat::APPENDED]
 *  @param[in]  n_          number of nodes in first direction 
 *  @param[in]  m_          number of nodes in second direction 
 */
VTKRectilinearGrid::VTKRectilinearGrid( std::string dir_, std::string name_, VTKFormat codex_, int n_, int m_ ) : VTKRectilinearGrid( ) {

    setNames( dir_, name_ ) ;

    setDimensions( 0, n_-1, 0, m_-1, 0, 0) ;
    setGeomCodex( codex_ ) ;

    return ;
};
Пример #5
0
/*!  
 *  Constructor for parallel 3D grid.
 *  Calls default constructor and sets provided input information.
 *  @param[in] dir directory of VTK file with final "/"
 *  @param[in] name name of VTK without suffix
 *  @param[in] codex codex of data [VTKFormat::ASCII/VTKFormat::APPENDED]
 *  @param[in] n1 min node index in first direction 
 *  @param[in] n2 max node index in first direction 
 *  @param[in] m1 min node index in second direction 
 *  @param[in] m2 max node index in second direction 
 *  @param[in] l1 min node index in third direction 
 *  @param[in] l2 max node index in third direction 
 */
VTKRectilinearGrid::VTKRectilinearGrid( std::string dir, std::string name, VTKFormat codex, int n1, int n2, int m1, int m2, int l1, int l2 ) :VTKRectilinearGrid( ) {

    setNames( dir, name ) ;

    setDimensions( n1, n2, m1, m2, l1, l2) ;
    setGeomCodex( codex ) ;

    return ;
};
Пример #6
0
/*!  
 *  Constructor for serial 2D grid.
 *  Calls default constructor and sets provided input information.
 *  @param[in] dir directory of VTK file with final "/"
 *  @param[in] name name of VTK without suffix
 *  @param[in] codex codex of data [VTKFormat::ASCII/VTKFormat::APPENDED]
 *  @param[in] n number of nodes in first direction 
 *  @param[in] m number of nodes in second direction 
 */
VTKRectilinearGrid::VTKRectilinearGrid( std::string dir, std::string name, VTKFormat codex, int n, int m ) : VTKRectilinearGrid( ) {

    setNames( dir, name ) ;

    setDimensions( 0, n-1, 0, m-1, 0, 0) ;
    setGeomCodex( codex ) ;

    return ;
};
Пример #7
0
static int preinit(const char *arg) {
	int id = 0;
	const opt_t subopts[] = {
	{ "id",          OPT_ARG_INT,  &id,  NULL},
	{ "mode", OPT_ARG_INT, &smp.buffercount, NULL },
	{ NULL } };

	if (subopt_parse(arg, subopts) != 0) {
		//mp_msg(MSGT_VO, MSGL_WARN, MSGTR_LIBVO_TGA_UnknownSubdevice, arg);
		mp_tmsg(MSGT_VO,MSGL_WARN, "[VO_TGA] Unknown subdevice: %s.\n",arg);
		return ENOSYS;
	}

	if (smp.buffercount < 1 || smp.buffercount > 2 || id < 0) { //Todo: check if shm_setting_id exists
		return -1;
	}
	printf("buffercount: %d  id: %d\n", smp.buffercount, id);

	initstruct(&smp);
	setNames(id, &smp);

	return 0;
}
Пример #8
0
/*! 
 * Constructor referes to a serial VTK file with appended binary data.
 * @param[in]  dir_    directory of file with final "/"
 * @param[in]  name_   file name without suffix
 */
VTK::VTK( std::string dir_,  std::string name_ ):
     VTK(){

    setNames(dir_, name_) ;

};
Пример #9
0
    Mapper::Mapper(const std::vector<std::string>& inNames, const std::vector<std::string>& outNames) {

        setNames(inNames, outNames);
    }
Пример #10
0
/*!  
 *  Constructor.
 *  sets input parameters and calls default constructor
 *  @param[in]  dir_        Directory of vtk file with final "/"
 *  @param[in]  name_       Name of vtk file without suffix
 */
VTKUnstructuredGrid::VTKUnstructuredGrid( std::string dir_, std::string name_ ):VTKUnstructuredGrid( ){

  setNames( dir_, name_ ) ; 
  return ;

};
Пример #11
0
/*!  
 *  Constructor for parallel 3D grid.
 *  Calls default constructor and sets provided input information.
 *  @param[in]  dir_        directory of VTK file with final "/"
 *  @param[in]  name_       name of VTK without suffix
 */
VTKRectilinearGrid::VTKRectilinearGrid( std::string dir_, std::string name_ ) :VTKRectilinearGrid( ) {

    setNames( dir_, name_ ) ;

    return ;
};