%{ /**************************************************************************** * BiffSocko * answerparser.lex * * parses answer.xml files located in Murex. I go under assumption that the * file modification date is the finish time of the process. I basically stat * the file and use the variable modtime to get the last modification of the file. * Based on that I derive the start_time as well. * * OUTPUT: * ======= * the output is CSV Formatted. The Header is created in a shell script * that calls this process. The header appears like this: * * Hostname,Process,Status,ElpsedTime,CPU_Time,IO_Time,Start_Time,Finish_Time,CPU_Percent,Rdbcom1,Rdbcom2 * * COMPILE: * ======= * flex answerparser.lex * fcc lex.yy.c * ****************************************************************************/ #include #include #include #include #include #define MAX 512 /************************************************************ * when DEBUG is uncommented, you get some extra output that * can be helpful in troubleshooting *************************************************************/ /* #define DEBUG */ char* get_time_date(time_t); /********************************* * Some Global Variables (yuck) ********************************/ char status[MAX]; /* output status of murex app */ char name[MAX]; /* name of murex app */ char host[MAX]; /* host the murex app ran on */ char elapsed_time[MAX]; /* how long the murex app ran */ char cpu_time[MAX]; /* how much cpu time the murex app used */ char io_time[MAX]; /* how much io time the murex app used */ %} %option stack %START parseScript %START parseStatus %START parseName %START parseHost %START parseElapsedTime %START parseCPUTime %START parseIOTime %START parseTimeing %% "