Esempio n. 1
0
File: display.c Progetto: danmia/mtr
void display_open(void)
{
  switch(DisplayMode) {

  case DisplayReport:
    report_open();
    break;
  case DisplayTXT:
    txt_open();
    break;
  case DisplayXML:
    xml_open();
    break;
  case DisplayJSON:
    json_open();
    break;
  case DisplayCSV:
    csv_open();
    break;
  case DisplayCurses:
    mtr_curses_open();  
#ifdef IPINFO
    if (ipinfo_no >= 0)
        asn_open();
#endif
    break;
  case DisplaySplit:
    split_open();
    break;
  case DisplayGTK:
    gtk_open();
    break;
  }
}
Esempio n. 2
0
void display_open(void)
{
  switch(DisplayMode) {

  case DisplayReport:
    report_open();
    break;
  case DisplayTXT:
    txt_open();
    break;
  case DisplayXML:
    xml_open();
    break;
  case DisplayCSV:
    csv_open();
    break;
  case DisplayCurses:
    mtr_curses_open();  
    break;
  case DisplaySplit:            /* BL */
    split_open();
    break;
  case DisplayGTK:
    gtk_open();
    break;
  }
}
Esempio n. 3
0
/******************************************************************************
 * *Function: conf_init
 * *Description: open and parse xml config file
 * *Input: none
 * *Output: none
 * *Return: CONF_SUCCESS/CONF_FAIL
 * *Date: 2016/8/22
 * ****************************************************************************/
int conf_init()
{
	if(xml_open(CONF_FNAME) == PARSE_FAIL)
		return CONF_FAIL;

	if(xml_parse() == PARSE_FAIL)
		return CONF_FAIL;
	
	return CONF_SUCCESS;
}
Esempio n. 4
0
int	xml_parse( char * nptr, struct xml_relay * fptr, void * aptr )
{
	int	status=0;
	int	c;
	int	lno=0;
	struct	xml_parser	*	sptr;

	/* attempt to open the source context */
	/* ---------------------------------- */
	if (!( sptr = xml_open( nptr, aptr )))
		return(_XML_FILE_ERROR);
	else	{
		/* install user relay table if provided */
		/* ------------------------------------ */
		xml_use_relays( sptr, fptr );

		/* connect application to parser */
		/* ----------------------------- */
		sptr->work->parent = sptr;

		/* Parse until end of source */
		/* ------------------------- */
		status = xml_parse_tokens(sptr);

		/* detect incomplete termination */
		/* ----------------------------- */
		if ( status ) {
			if ( status != 48 ) {
				lno = sptr->lines;
				sptr = xml_close( sptr );
				if (!( fptr->failure ))
					return( status );
				else	return((fptr->failure)(nptr,status,lno));
				}
			else	return( _XML_SUCCESS );
			}
		else if (!( sptr->nesting )) {
			sptr = xml_close( sptr );
			return( _XML_SUCCESS );
			}
		else	{
			sptr = xml_close( sptr );
			return( _XML_UNEXPECTED_EOF );
			}
		}
}