Exemple #1
0
Interface::Interface()
{
	pNext = NULL;
	szName = NULL;

	DefineTag(XML_NAME, TT_STRING, &szName);
	DefineTag(XML_IP, TT_USER, NULL);
}
Exemple #2
0
/* Coordinates Config update and Tags data */
static void DeclareUserTag( TidyDocImpl* doc, TidyOptionId optId,
                            UserTagType tagType, ctmbstr name )
{
  ctmbstr prvval = cfgStr( doc, optId );
  tmbstr catval = NULL;
  ctmbstr theval = name;
  if ( prvval )
  {
    uint len = tmbstrlen(name) + tmbstrlen(prvval) + 3;
    catval = tmbstrndup( prvval, len );
    tmbstrcat( catval, ", " );
    tmbstrcat( catval, name );
    theval = catval;
  }
  DefineTag( doc, tagType, name );
  SetOptionValue( doc, optId, theval );
  if ( catval )
    MemFree( catval );
}
Exemple #3
0
RouterType::RouterType()
{
	pNext = NULL;
	sx = 68;
	sy = 38;
	id = -1;
	r  = 0;
	g  = 0;
	b  = 0;
	info = (RI_NAME|RI_IP);
	labels[0] = 0;
	labels[1] = 0;
	labels[2] = 0;
	labIndex = 0;
	/* set default values */		
	iBorderWidth = 1;
	bb = br = bg = 0; /* black */
	ipb = locb = 200;
	ipr = locr = 200;
	ipg = locg = 255;
	loc_size = DEFAULT_LOC_FONT;
	ip_size = DEFAULT_IP_FONT;
	name_size = DEFAULT_NAME_FONT;
	namr = namg = 255; /* yellow */
	namb = 0;
	bSwitch = 0;
	bShadow = 0;

	// povinne tagy
	DefineTag(XML_RT_ID, TT_INT, &id, 1);

	// nepovinne tagy
	DefineTag(XML_RT_DIM, TT_USER, NULL);
	DefineTag(XML_RT_COLOR, TT_USER, NULL);
	DefineTag(XML_RT_INFO, TT_USER, NULL);
	DefineTag(XML_RT_SWITCH, TT_BOOL, &bSwitch);
	DefineTag(XML_RT_SHADOW, TT_BOOL, &bShadow);
}
Exemple #4
0
Router::Router()
{
	// Atributy z xml
	szID = szName = szAPURL = szAP2URL = szRouterURL = szLanURL = szESSID = szESSID2 = szComment = NULL;
	iAP = 0;	// bez antenky
	iEth = 0;	// bez eth segmentu
	iUnderConst = 0;	// v provozu
	rType = -1; // povinny

	// Atributy urcene za behu
	prType = NULL;
	pInterfaces = NULL;
	pNext = NULL;
	nLines = 0;
	parLines = NULL;
	rState = RS_UNKNOWN;
	iX = iRealX = -1;
	iY = iRealY = -1;
	iAPLoad = 0;
	iAP2Load = -1;
	iLANLoad = -1;		
	iHasDefault = 0;

	// atributy pro testovani
	nState  = NS_FRESH;	
	
	// atributy pro vytvareni cest
	pNode	= NULL;

	// povinne tagy
	DefineTag(XML_NAME, TT_STRING, &szName, 1);
	DefineTag(XML_POSITION, TT_USER, NULL, 1);	// pozice je prozatim povinna
	DefineTag(XML_RTYPE, TT_INT, &rType, 1);

	// nepovinne tagy
	DefineTag(XML_IP, TT_USER, NULL);
	DefineTag(XML_ROUTERURL, TT_STRING, &szRouterURL);
	DefineTag(XML_APURL, TT_STRING, &szAPURL);
	DefineTag(XML_AP2URL, TT_STRING, &szAP2URL);
	DefineTag(XML_LANURL, TT_STRING, &szLanURL);
	DefineTag(XML_COMMENT, TT_STRING, &szComment);	
	DefineTag(XML_APTYPE, TT_INT, &iAP);
	DefineTag(XML_ETH, TT_BOOL, &iEth);
	DefineTag(XML_ESSID, TT_STRING, &szESSID);
	DefineTag(XML_ESSID2, TT_STRING, &szESSID2);
	DefineTag(XML_UNDERCONST, TT_BOOL, &iUnderConst);
}
Exemple #5
0
/* ensure that config is self consistent */
void AdjustConfig( TidyDocImpl* doc )
{
    if ( cfgBool(doc, TidyEncloseBlockText) )
        SetOptionBool( doc, TidyEncloseBodyText, yes );

    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState )
        SetOptionInt( doc, TidyIndentSpaces, 0 );

    /* disable wrapping */
    if ( cfg(doc, TidyWrapLen) == 0 )
        SetOptionInt( doc, TidyWrapLen, 0x7FFFFFFF );

    /* Word 2000 needs o:p to be declared as inline */
    if ( cfgBool(doc, TidyWord2000) )
    {
        doc->config.defined_tags |= tagtype_inline;
        DefineTag( doc, tagtype_inline, "o:p" );
    }

    /* #480701 disable XHTML output flag if both output-xhtml and xml input are set */
    if ( cfgBool(doc, TidyXmlTags) )
        SetOptionBool( doc, TidyXhtmlOut, no );

    /* XHTML is written in lower case */
    if ( cfgBool(doc, TidyXhtmlOut) )
    {
        SetOptionBool( doc, TidyXmlOut, yes );
        SetOptionBool( doc, TidyUpperCaseTags, no );
        SetOptionBool( doc, TidyUpperCaseAttrs, no );
        /* SetOptionBool( doc, TidyXmlPIs, yes ); */
    }

    /* if XML in, then XML out */
    if ( cfgBool(doc, TidyXmlTags) )
    {
        SetOptionBool( doc, TidyXmlOut, yes );
        SetOptionBool( doc, TidyXmlPIs, yes );
    }

    /* #427837 - fix by Dave Raggett 02 Jun 01
    ** generate <?xml version="1.0" encoding="iso-8859-1"?>
    ** if the output character encoding is Latin-1 etc.
    */
    if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
         cfg(doc, TidyOutCharEncoding) != UTF8 &&
#if SUPPORT_UTF16_ENCODINGS
         cfg(doc, TidyOutCharEncoding) != UTF16 &&
         cfg(doc, TidyOutCharEncoding) != UTF16BE &&
         cfg(doc, TidyOutCharEncoding) != UTF16LE &&
#endif
         cfg(doc, TidyOutCharEncoding) != RAW &&
         cfgBool(doc, TidyXmlOut) )
    {
        SetOptionBool( doc, TidyXmlDecl, yes );
    }

    /* XML requires end tags */
    if ( cfgBool(doc, TidyXmlOut) )
    {
#if SUPPORT_UTF16_ENCODINGS
        /* XML requires a BOM on output if using UTF-16 encoding */
        ulong enc = cfg( doc, TidyOutCharEncoding );
        if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
            SetOptionInt( doc, TidyOutputBOM, yes );
#endif
        SetOptionBool( doc, TidyQuoteAmpersand, yes );
        SetOptionBool( doc, TidyHideEndTags, no );
    }
}