/*
 *   logtool - a logfile parsing/monitoring/manipulation utility
 *
 *   Copyright (C) Y2K (2000) A.L.Lambert
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2, or (at your option)
 *   any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "includes.h"

int lto_parse_ascii() {
	parse_pmsg();
	return 0;
}

/* this is a pretty simple module :)	*/
void lto_ascii() {

	/* parse the \033e escpae sequences into native ANSI    */
	lto_parse_ascii();

        /* if it's a duplicate message, just print the "!" warning to screen    */
        if(event.type != EVENT_UNKNOWN && cf.input == TRUE && cf.supdupes == TRUE && 
			strcmp(event.message, event.lmessage) == 0 && strcmp(event.source, event.lsource) == 0) {
                printf("!");
        } else {
                /* if this isn't the first message, print a \newline                    */
                if(cf.input == TRUE) {
                        printf("\n");
                }
                /* print yee old message as parsed by the module in question    */
		cf.input = TRUE;
                printf("%s", event.pmsg);
        }
        fflush(stdout);
}

