Esempio n. 1
0
BOOL CReturnParameter::StoreToXMLFile(CXXMLFile* pFile, CXXMLFile::CElement* pParentElement)
{
    CXXMLFile::CElement* pElement;

    if(pFile && pParentElement)
    {
        //ReturnParameter Elements
        pElement = (CXXMLFile::CElement*)pFile->AddElement(pParentElement);
        pFile->SetText(pElement, "ReturnParameter");
        pElement->SetAt("Id", GetIndexStr());
        pElement->SetAt("Name", GetName());
        pElement->SetAt("Type", GetTypeStr());
        pElement->SetAt("Value", GetValueStr(OVF_HEX));

        if(!m_oVisible) pElement->SetAt("Visible", GetVisibleStr());

        return TRUE;
    }

    return FALSE;
}
Esempio n. 2
0
void 
Init(NodeObj Main){

	char * logname;
	NodeObj RegObjList;

	/* just hum along, add in the parts to initialize base object as I find we need them. */

	DebugPrint ( "Entering Init function.", __FILE__, __LINE__, PROG_FLOW);

	/* Set the name of the main object */
	SetName (Main, "Main");

	/* Create a place to store registered Objects */
	SetPropInt(Main, "RegObjList", 1);
	RegObjList = GetPropNode(Main, "RegObjList");
	ObjSetRegObjList(RegObjList);

	/* activate the main object */
	SetPropInt(Main, "State", Running);

	/* Insert release info into the Main node properties */
	SetPropStr(Main, "ReleaseMajor", RELEASEMAJOR);
	SetPropStr(Main, "ReleaseName",  RELEASENAME);
	SetPropStr(Main, "ReleaseMinor", RELEASEMINOR);
	SetPropStr(Main, "ReleaseLevel", RELEASELEVEL);
	SetPropStr(Main, "Copyright",    COPYRIGHT);
	SetPropStr(Main, "Author",       AUTHOR);
	SetPropStr(Main, "ReleaseTag",   RELEASETAG);

	/* process the command line */

	/* print out the help text if printhelp is turned on */
	if (GetValueInt(GetPropNode(Main, "printhelp"))) {
		printf ("%s %s.%s %s - (C) %s %s\n%s\nhttp://grokthink.org\n\n  Usage: framework <options>\n\n  Options:\n\n       -h              : This help screen\n       -d              : Become a server process\n       -l    <logfile> : logfile to output debug info\n       -p              : Print Main Nodes on exit\n       -t              : Perform Unit Testing of library functions\n       -v     <number> : Verbose level from 0 to 9, inclusive\n\n", RELEASENAME, RELEASEMAJOR, RELEASEMINOR, RELEASELEVEL, COPYRIGHT, AUTHOR, RELEASETAG);
	}

	/* if -t command line argument is set, perform unit test */
	if (GetValueInt(GetPropNode(Main, "UnitTest"))) {
		PerformTesting();
	}

	/* if deamon option was turned on, become a deamon */
	if (GetValueInt(GetPropNode(Main, "deamon"))) {
		// also turn off logging in debug print.
		// because part of becoming a deamon is eliminating stdout

		DebugPrint ( "Becoming a Deamon.", __FILE__, __LINE__, PROG_FLOW);
		become_deamon ();
	}

	/* if logname is given, set the debug print to use the logfile */
	logname = GetValueStr(GetPropNode(Main, "logname"));
	if (logname && strlen(logname)) {
		// set up the debug print to output to logfile
		// turn on normal debug printing
		DebugPrint ( "Verbose Logging Enabled.", __FILE__, __LINE__, PROG_FLOW);
		;
	}

	/* set the logging level for debug print */

	DebugPrint ( "Logging Level Set.", __FILE__, __LINE__, PROG_FLOW);


	/* Setup task list */
	Tasks = CreateList();

}