Ejemplo n.º 1
0
/*
	init the CControlLogic class
*/
int CControlLogic::Init()
{

	if (!UIConnection())//establish connection UI between testperf
	{
		printf("ERROR Can not connect server.exit\n");
		return 0;
	}
	if (!ReadConfigFile())
	{

		return 0;
	}

	if (!StartAMBTUIParseCammandTask())
	{
		return 0;
	}
    if(!StartAutoFixtureTask())
    {
        return 0;
    }

	usleep(1);
	return 1;
}
Ejemplo n.º 2
0
int CVICALLBACK ConfigCMD (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			 DimAction(1);
			  WriteLog();
			  ResetTextBox (panelHandle, PANEL_TEXTBOX, "");
		
			if (ReadConfigFile(BBUCOMMON_CONFIGCMD))
			{
				if (0==InstallPopup(configHandle))
				{
					SetPanelAttribute (configHandle, ATTR_TITLE, "CheckCMD");    
					SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
					SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
				}
			}
			else
			{
				SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from cmd.txt error,please check it by manual!\r\n");
			}
					
		
			  DimAction(0);   
			break;
	}
	return 0;
}
Ejemplo n.º 3
0
int main( int argc, char *argv[] ) {
  //get args
  get_args(argc, argv);
  
  
  initDefaultSettings();

  //read settings file
  ReadConfigFile();

  //init system
  SystemInit(&argc,argv);
  initNetwork();

  //starting the tracker
  start_tracker();
  
  while(1) {
    //parse network
    handle_tracker();
    check_serveractivity();
    #ifdef macintosh
        mac_yield_cpu (10000);
    #else
        SDL_Delay(10);
    #endif
  }

  stop_tracker();

  //cleanup
  return 0;
}
Ejemplo n.º 4
0
void ReadConfig(void)
{

// defaults
	iResX=640;
	iResY=480;
	iColDepth=16;
	iWindowMode=1;
	iUseScanLines=0;
	iUseDither=0;
	UseFrameLimit=0;
	UseFrameSkip=0;
	iFrameLimit=2;
	fFrameRate=200.0f;
	dwCfgFixes=0;
	iUseFixes=0;
	iUseNoStretchBlt=1;
	iShowFPS=0;
	bSSSPSXLimit=FALSE;

// read sets
	ReadConfigFile();

// additional checks
	if (!iColDepth)       iColDepth=32;
	if (iUseFixes)        dwActFixes=dwCfgFixes;
}
Ejemplo n.º 5
0
//////////////////////////////////////////////////////////////////////////////
//
// Start
//
static bool AppInitRPC(int argc, char* argv[])
{
    //
    // Parameters
    //
    ParseParameters(argc, argv);
    if (!boost::filesystem::is_directory(GetDataDir(false)))
    {
        fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
        return false;
    }
    ReadConfigFile(mapArgs, mapMultiArgs);
    // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause)
    if (!SelectParamsFromCommandLine()) {
        fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
        return false;
    }

    if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
    {
        // First part of help message is specific to RPC client
        std::string strUsage = _("Envycoin RPC client version") + " " + FormatFullVersion() + "\n\n" +
            _("Usage:") + "\n" +
              "  envycoin-cli [options] <command> [params]  " + _("Send command to Envycoin server") + "\n" +
              "  envycoin-cli [options] help                " + _("List commands") + "\n" +
              "  envycoin-cli [options] help <command>      " + _("Get help for a command") + "\n";

        strUsage += "\n" + HelpMessageCli(true);

        fprintf(stdout, "%s", strUsage.c_str());
        return false;
    }
    return true;
}
Ejemplo n.º 6
0
//////////////////////////////////////////////////////////////////////////////
//
// Start
//
static bool AppInitRPC(int argc, char* argv[])
{
    //
    // Parameters
    //
    ParseParameters(argc, argv);
    if (!boost::filesystem::is_directory(GetDataDir(false)))
    {
        fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
        return false;
    }
    ReadConfigFile(mapArgs, mapMultiArgs);

    if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
    {
        // First part of help message is specific to RPC client
        std::string strUsage = _("Bitcoin RPC client version") + " " + FormatFullVersion() + "\n\n" +
            _("Usage:") + "\n" +
              "  bitcoin-cli [options] <command> [params]  " + _("Send command to Bitcoin server") + "\n" +
              "  bitcoin-cli [options] help                " + _("List commands") + "\n" +
              "  bitcoin-cli [options] help <command>      " + _("Get help for a command") + "\n";

        strUsage += "\n" + HelpMessage(HMM_BITCOIN_CLI);

        fprintf(stdout, "%s", strUsage.c_str());
        return false;
    }
    return true;
}
Ejemplo n.º 7
0
void ReadConfig(void)
{
// defaults
    iResX=640;
    iResY=480;
    iWinSize=MAKELONG(iResX,iResY);
    iColDepth=16;
    iWindowMode=1;
    iUseScanLines=0;
    if (frameLimit == FRAMELIMIT_AUTO)
    {
        UseFrameLimit=1;
        iFrameLimit=2;
    }
    else
    {
        UseFrameLimit=0;
        iFrameLimit=0;
    }
    UseFrameSkip = frameSkip;
    fFrameRate=60.0f;
    dwCfgFixes=0;
    iUseFixes=0;
    iUseNoStretchBlt=1;
    iShowFPS=0;
    bSSSPSXLimit=FALSE;

// read sets
    ReadConfigFile();

// additional checks
    if(!iColDepth)       iColDepth=32;
    if(iUseFixes)        dwActFixes=dwCfgFixes;
    SetFixes();
}
Ejemplo n.º 8
0
Archivo: cfg.c Proyecto: bsv798/pcsxr
void ReadConfig(void)
{
 // defaults
 iResX=640;iResY=480;
 iWinSize=MAKELONG(iResX,iResY);
 iColDepth=32;
 iWindowMode=1;
 iMaintainAspect=0;
 UseFrameLimit=1;
 UseFrameSkip=0;
 iFrameLimit=2;
 fFrameRate=200.0f;
 dwCfgFixes=0;
 iUseFixes=0;
 iUseNoStretchBlt=0;
 iUseDither=0;
 iShowFPS=0;

 // read sets
 ReadConfigFile();

 // additional checks
 if(!iColDepth)       iColDepth=32;
 if(iUseFixes)        dwActFixes=dwCfgFixes;
 SetFixes();
}
Ejemplo n.º 9
0
//////////////////////////////////////////manualbar callback function/////////////////////////////////////////////////
void CVICALLBACK Config (int menuBar, int menuItem, void *callbackData,
		int panel)
{
			  DimAction(1);
			  WriteLog();
			  ResetTextBox (panelHandle, PANEL_TEXTBOX, "");
			  switch (menuItem)
			  {
			  	case MENUBAR_CONFIG_CONFIGIP:
					if (ReadConfigFile(MENUBAR_CONFIG_CONFIGIP))
					{
						if (0==InstallPopup(configHandle))
						{
							SetPanelAttribute (configHandle, ATTR_TITLE, "CheckBBUIP");
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
						}
					
					}
					else
					{
						SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from bbuip.txt error,please check it by manual!\r\n");        
					}
					break;
				case BBUCOMMON_CONFIGCMD:
					if (ReadConfigFile(BBUCOMMON_CONFIGCMD))
					{
						if (0==InstallPopup(configHandle))
						{
							SetPanelAttribute (configHandle, ATTR_TITLE, "CheckCMD");    
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
							SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
						}
					}
					else
					{
						SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from cmd.txt error,please check it by manual!\r\n");
					}
					
			  }
			  DimAction(0);   
}  
// ****************************************************************************
// Method: SingleAttributeConfigManager::Import
//
// Purpose: 
//   Imports the atribute from the named file.
//
// Returns:    true on success; false otherwise
//
// Programmer: Jeremy Meredith
// Creation:   January  2, 2009
//
// Modifications:
//
//   Tom Fogal, Fri Mar  6 10:26:12 MST 2009
//   Fix: function wasn't returning anything in the `success' case.
//   
// ****************************************************************************
bool
SingleAttributeConfigManager::Import(std::istream& in)
{
    DataNode *node = ReadConfigFile(in);

    if (!node)
        return false;

    attribute->SetFromNode(node);
    return true;
}
Ejemplo n.º 11
0
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
  int	n;
  Arg	args[6];

  Initialize();
  ProcessArgs(argv);
  ReadConfigFile();

  AutoScale();

  if (!Interactive)
    PrintPS((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
  else
    {
    AppShell = XtAppInitialize(&appContext, APP_CLASS, NULL, 0, &argc, argv,
                                fallback_resources, NULL, 0);

    XtGetApplicationResources(AppShell, (caddr_t) &iv, resources,
                                XtNumber(resources), NULL, 0);

    n = 0;
    MainShell = XtCreatePopupShell("topLevelShell",
                                topLevelShellWidgetClass, AppShell, args, n);

    MainWindow = CreateMainWindow(MainShell);

    n = 0;
    ControlShell = XtCreatePopupShell("controlShell",
                                topLevelShellWidgetClass, AppShell, args, n);

    CreateControlWindow(ControlShell);

    CreateErrorBox(AppShell);
    CreateQueryBox(AppShell);
    CreateWarningBox(AppShell);
    CreateFileSelectionBox(AppShell);

    if (NumberDataFiles > 0)
      NewDataFile((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);

    OpenControlWindow(NULL, NULL, NULL);
    XtManageChild(MainWindow);
    XtPopup(XtParent(MainWindow), XtGrabNone);

    if (RealTime)
      XtAppAddTimeOut(appContext, 1000, UpdateDataRT, NULL);

    XtAppMainLoop(appContext);
    }

  return(0);

}	/* END MAIN */
bool
SingleAttributeConfigManager::Import(const std::string &filename)
{
    DataNode *node = ReadConfigFile(filename.c_str());

    if (!node)
        return false;

    attribute->SetFromNode(node);
    return true;
}
Ejemplo n.º 13
0
int ReadConfigurationFile(int fd)
{
 static int first_time=1;
 char *errmsg;

 if(first_time)
   {
    errmsg=ReadConfigFile(1);

    if(errmsg)
      {
       if(fd!=-1)
          write_string(fd,errmsg);
       free(errmsg);

       return(1);
      }

    SetLocalPort(ConfigInteger(HTTP_Port));

    first_time=0;
   }

 errmsg=ReadConfigFile(0);

 if(errmsg)
   {
    if(fd!=-1)
       write_string(fd,errmsg);
    free(errmsg);

    return(1);
   }

 SyslogLevel=ConfigInteger(LogLevel);

 SetDNSTimeout(ConfigInteger(DNSTimeout));
 SetConnectTimeout(ConfigInteger(ConnectTimeout));

 return(0);
}
Ejemplo n.º 14
0
void ReadConfigSPU(void)
{
 iVolume=2;
 iXAPitch=0;
 iSPUIRQWait=0;
 iUseTimer=2;
 iUseReverb=2;
 iUseInterpolation=2;
 iDisStereo=0;

 ReadConfigFile();
}
Ejemplo n.º 15
0
void ModuleFactory::Init(const string& configFileName)
{
	ReadConfigFile(configFileName.c_str());
#ifdef USE_MONGODB
	ReadParametersFromMongoDB();
//#else
	//ReadParametersFromSQLite();
#endif

	size_t n = m_moduleIDs.size();
	// read all the .dll or .so and create objects
	for (size_t i = 0; i < n; i++)
	{
		string id = m_moduleIDs[i];
		string dllID = id;
		// for ITP modules, the input ids are ITP_T, ITP_P and ITP should be used as ID name
		if(id.find(MID_ITP) != string::npos)
#ifndef linux
			dllID = MID_ITP;
#else
			dllID = "lib" + string(MID_ITP);
#endif
		else if (id.find(MID_TSD_RD) != string::npos)
#ifndef linux
			dllID = MID_TSD_RD;
#else
			dllID = "lib" + string(MID_TSD_RD);
#endif

#ifdef INTEL_COMPILER
		dllID = dllID + "_intel";
#endif
#ifdef INTEL_COMPILER_SINGLE
		dllID = dllID + "_intel_single";
#endif
#ifdef SINGLE
		dllID = dllID + "_single";
#endif
		// load function pointers from DLL
		ReadDLL(id, dllID);

		// load metadata
		MetadataFunction metadataInfo = m_metadataFuncs[id];
		const char* metadata = metadataInfo();
		m_metadata[id] = metadata;
		// parse the metadata
		TiXmlDocument doc;
		doc.Parse(metadata);
		ReadParameterSetting(id, doc, m_settings[id]);
		ReadInputSetting(id, doc, m_settings[id]);
		ReadOutputSetting(id, doc, m_settings[id]);
	}
Ejemplo n.º 16
0
bool Adapter::LoadConfig( )
{
  if( !ReadConfigFile( ))
    return false;
  ReadConfig( "Name", name );
  ReadConfig( "UDev-ID", uid );

  Log( "Loading Adapter '%s'", name.c_str( ));

  if( !CreateFromConfigFactory<Frontend, Adapter>( *this, "frontend", frontends ))
    return false;
  return true;
}
Ejemplo n.º 17
0
int
main(int argc, char *argv[])
{
  int opt;
  while ((opt = getopt(argc, argv, "ql:d:uw:f:bc:s:")) != -1) {
    switch (opt) {
    case 'q':
      quietFlag = 1;
      break;
    case 'd': {
      char *c = optarg;
      while (*c) {
        Debug_SetFlag(*c, 1);
        c++;
      }
      break;
    }
    default:
      PrintUsageAndExit(argv[0]);
    }
  }
  if (optind != argc-1) {
    PrintUsageAndExit(argv[0]);
  }

  char *configfile = argv[optind];
  int err = ReadConfigFile(configfile);
  if (err < 0) {
    exit(EXIT_FAILURE);
  }

  /*
   * Since we create a process (i.e. fork) we need to clean up its state when
   * we exit.  We do this by having the OS send us a signal when something
   * finishes.
   */
  signal(SIGCHLD, handleSIGCHLD);

  err = InitializeBackends();
  if (err < 0) {
    exit(EXIT_FAILURE);
  }

  int listenfd = SetupListenSocket();
  if(listenfd < 0){
    exit(EXIT_FAILURE);
  }
  HandleConnections(listenfd);

  return 0; /* Never reached. */
}
Ejemplo n.º 18
0
bool SourcesList::ReadVendors()
{
    Configuration Cnf;

    string CnfFile = _config->FindFile("Dir::Etc::vendorlist");
    if (FileExists(CnfFile) == true) {
        if (ReadConfigFile(Cnf, CnfFile, true) == false) {
            return false;
        }
    }

    for (VendorRecord *vr : VendorRecords) {
        delete vr;
    }
    VendorRecords.clear();

    // Process 'simple-key' type sections
    const Configuration::Item *Top = Cnf.Tree("simple-key");
    for (Top = (Top == 0 ? 0 : Top->Child); Top != 0; Top = Top->Next) {
        Configuration Block(Top);
        VendorRecord Vendor;

        Vendor.VendorID = Top->Tag;
        Vendor.FingerPrint = Block.Find("Fingerprint");
        Vendor.Description = Block.Find("Name");

        char *buffer = new char[Vendor.FingerPrint.length() + 1];
        char *p = buffer;;
        for (string::const_iterator I = Vendor.FingerPrint.begin();
             I != Vendor.FingerPrint.end(); ++I) {
            if (*I != ' ' && *I != '\t') {
                *p++ = *I;
            }
        }
        *p = 0;
        Vendor.FingerPrint = buffer;
        delete[]buffer;

        if (Vendor.FingerPrint.empty() == true ||
                Vendor.Description.empty() == true) {
            _error->Error("Vendor block %s is invalid",
                          Vendor.VendorID.c_str());
            continue;
        }

        AddVendorNode(Vendor);
    }

    return !_error->PendingError();
}
DataNode *
VLIFileManager::ReadConfigFile(const char *filename)
{
    DataNode *node = 0;

    // Try and open the file for reading.
    std::ifstream inf(filename, ios::in); // | ios::trunc);
    if (inf.is_open() == false)
        return node;
    node = ReadConfigFile(inf);
    inf.close();
 
    return node;
}
Ejemplo n.º 20
0
Archivo: joyd.c Proyecto: mmitch/joyd
int main (int argc, char **argv)
/* simple main program */
{
	/* don't tell me that this condition looks ugly... */
	if (    (argc > 2)
	     || (
                   (argc == 2)
                && (
                      (strcmp(argv[1],PRINT_VERSION)      == 0)
		   || (strcmp(argv[1],PRINT_VERSION_LONG) == 0)
		   )
                 )
           ) {
		printf(PROGRAM_VERSION "\n");
		printf(PROGRAM_INFOTEXT "\n");
		exit(0);
	};

	SetDefaultValues();

	if (config.debug > 1) {
		Print(stdout,PROGRAM_VERSION," starting up");
	}

	InstallSignalHandler();

	if (argc > 1) {
		free(config.config_file);
		config.config_file = AllocString(argv[1]);
	}
	
	ReadConfigFile();

	if (config.daemon) {
		ForkToBackground();
	}
	
	OpenJoystick();

	AddMissingCalibrations();

	ActionLoop();

	CloseJoystick();

	Print(stdout,PROGRAM_VERSION," quits now (should've never come around here!?)");

	return 0;
}
Ejemplo n.º 21
0
//
// This function returns either one of EXIT_ codes when it's expected to stop the process or
// CONTINUE_EXECUTION when it's expected to continue further.
//
static int AppInitRPC(int argc, char* argv[])
{
    //
    // Parameters
    //
    ParseParameters(argc, argv);
    if (argc<2 || IsArgSet("-?") || IsArgSet("-h") || IsArgSet("-help") || IsArgSet("-version")) {
        std::string strUsage = strprintf(_("%s RPC client version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n";
        if (!IsArgSet("-version")) {
            strUsage += "\n" + _("Usage:") + "\n" +
                  "  bitcoin-cli [options] <command> [params]  " + strprintf(_("Send command to %s"), _(PACKAGE_NAME)) + "\n" +
                  "  bitcoin-cli [options] -named <command> [name=value] ... " + strprintf(_("Send command to %s (with named arguments)"), _(PACKAGE_NAME)) + "\n" +
                  "  bitcoin-cli [options] help                " + _("List commands") + "\n" +
                  "  bitcoin-cli [options] help <command>      " + _("Get help for a command") + "\n";

            strUsage += "\n" + HelpMessageCli();
        }

        fprintf(stdout, "%s", strUsage.c_str());
        if (argc < 2) {
            fprintf(stderr, "Error: too few parameters\n");
            return EXIT_FAILURE;
        }
        return EXIT_SUCCESS;
    }
    if (!boost::filesystem::is_directory(GetDataDir(false))) {
        fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", GetArg("-datadir", "").c_str());
        return EXIT_FAILURE;
    }
    try {
        ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
    } catch (const std::exception& e) {
        fprintf(stderr,"Error reading configuration file: %s\n", e.what());
        return EXIT_FAILURE;
    }
    // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)
    try {
        SelectBaseParams(ChainNameFromCommandLine());
    } catch (const std::exception& e) {
        fprintf(stderr, "Error: %s\n", e.what());
        return EXIT_FAILURE;
    }
    if (GetBoolArg("-rpcssl", false))
    {
        fprintf(stderr, "Error: SSL mode for RPC (-rpcssl) is no longer supported.\n");
        return EXIT_FAILURE;
    }
    return CONTINUE_EXECUTION;
}
Ejemplo n.º 22
0
///////////////////////Private/////////////////////////////
void DataSearchConfig::InitUi()
{
    ui->combo_DBdriver->clear();
    ui->combo_DBdriver->addItems(QSqlDatabase::drivers());
    if(ReadConfigFile())
    {
        RefreshUi();
    }
    else
    {
        QMessageBox::critical(this,
                              tr("Error"),
                              tr("Could not read config file"));
    }
}
Ejemplo n.º 23
0
/*---------------------------------------------------------------------------
 Next part is the main function which build the logical layer of the module
---------------------------------------------------------------------------*/
int main (int argc, char *argv[]) {
	char *config = NULL;                    /* config file name */
	XF86ConfigPtr conf;

	conf = ReadConfigFile("/etc/X11/XF86Config");
 
	printf("%p\n",conf->conf_flags);
	printf("%p\n",conf->conf_input_lst);
	printf("%p\n",conf->conf_layout_lst);
	printf("%p\n",conf->conf_device_lst);
	printf("%p\n",conf->conf_monitor_lst);
	printf("%p\n",conf->conf_screen_lst);  

	exit(0);
}
Ejemplo n.º 24
0
int main( void ) {
	char	*encoder_pref = NULL;

	ReadConfigFile( 0 );
	InitSQLconnection();

	encoder_pref = GetConfigVar( "config-encoder" );
	if (CheckExecutable( encoder_pref ) == 0) {
		printf("could not execute '%s'", encoder_pref );
		exit(1);
	}

	my_Check_New_Configs( encoder_pref );
	return 0;
}
Ejemplo n.º 25
0
void ReadConfig(void)                                  // read config (linux file)
{
 iResX=640;
 iResY=480;
 iColDepth=16;
 bChangeRes=FALSE;
 bWindowMode=TRUE;
 iUseScanLines=0;
 bFullScreen=FALSE;
 bFullVRam=FALSE;
 iFilterType=0;
 bAdvancedBlend=FALSE;
 bDrawDither=FALSE;
 bUseLines=FALSE;
 bUseFrameLimit=TRUE;
 bUseFrameSkip=FALSE;
 iFrameLimit=2;
 fFrameRate=200.0f;
 iOffscreenDrawing=2;
 bOpaquePass=TRUE;
 bUseAntiAlias=FALSE;
 iTexQuality=0;
 iUseMask=0;
 iZBufferDepth=0;
 bUseFastMdec=TRUE;
 dwCfgFixes=0;
 bUseFixes=FALSE;
 iFrameTexType=1;
 iFrameReadType=0;
 bUse15bitMdec=FALSE;
 iShowFPS=0;
 bGteAccuracy=0;
 bKeepRatio=FALSE;
 bForceRatio43=FALSE;
 iScanBlend=0;
 iVRamSize=0;
 iTexGarbageCollection=1;
 iBlurBuffer=0;
 iHiResTextures=0;
 iForceVSync=-1;

 ReadConfigFile();                                     // read file

 if(!iColDepth)  iColDepth=32;                         // adjust color info
 if(iUseMask)    iZBufferDepth=16;                     // set zbuffer depth 
 else            iZBufferDepth=0;
 if(bUseFixes)   dwActFixes=dwCfgFixes;                // init game fix global
}
Ejemplo n.º 26
0
	TestingSetup() {
		{
			//vmscript test init
			delete pScriptDB;
			delete pContractScriptTip;

			pScriptDB = new CScriptDB(1024*1024, false , false);
			pContractScriptTip = new CContractScriptCache(pScriptDB);
		}
		mapArgs["-datadir"] = "D:\\bitcoin";
		ReadConfigFile(mapArgs, mapMultiArgs);
		if (!SelectParamsFromCommandLine()) {
		       fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
		}
//		Params().InitalConfig();
	}
DataNode *
SingleAttributeConfigManager::ReadConfigFile(const char *filename)
{
    DataNode *node = 0;
    std::ifstream inf;

    inf.open(filename, ios::in);
    // Try and open the file for reading.
    if(inf.is_open() == false)
        return node;

    node = ReadConfigFile(inf);

    inf.close();

    return node;
}
Ejemplo n.º 28
0
DataNode *
ColorTableManager::ReadConfigFile(const char *filename)
{
    std::ifstream inf;
    DataNode* node = NULL;

    // Try and open the file for reading.
    inf.open(filename, ios::in);
    if(inf.is_open() == false)
        return node;

    node = ReadConfigFile(inf);

    inf.close();

    return node;
}
Ejemplo n.º 29
0
ConfigFile::ConfigFile(std::string filename, std::string identifier, bool bAddDefaultsToConfig)
{
    m_strFilename = filename;
    m_strIdentifier = identifier;
    m_bAddDefaultsToConfig = bAddDefaultsToConfig;
    m_bOpenSuccessful = false;
    bIsModified = false;

    //Add default configurations
    LoadDefaults();
    
    m_bOpenSuccessful = ReadConfigFile();
    if(!m_bOpenSuccessful)
    {
        std::cout << "Failed to read config file. Using defaults." << std::endl;
    }
    
}
int main(int argc, char* argv[])
{
    const char*     configPath = "/system/etc/mountd.conf";
    int             i;    

    for (i = 1; i < argc; i++)
    {
        const char* arg = argv[i];
        
        if (strcmp(arg, "-f") == 0)
        {
            if (i < argc - 1)
                configPath = argv[++i];
        }
    }
        
    ReadConfigFile(configPath);
    StartAutoMounter();
    return RunServer();
}