/* * Copyright (C), 2010 by TuxWeb S.r.l. - http://www.tuxweb.it/ * Dino Ciuffetti - * * 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 of the License, 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, see . */ //#include "common.h" // <- MAX_LINEBUF is defined here typedef struct _fast_mode_data { long pos; // access_log file offset of the last scanned, encountered first timeperiod char line[MAX_LINEBUF]; // the entire line time_t last_exec; // last execution time (fast_mode write time) int timeperiod; // specified time period (-t command line option) int hits; // specified hits (-n command line option) int fastmode_valid; // internally used } fast_mode_data; int acquire_lock(); int remove_lock(); int access_log_open(); int access_log_close(); int rewind_file(FILE *f); long previous_line_fileoffset(FILE *f); long last_valid_line_fileoffset(FILE *f); fast_mode_data *fast_mode_setup(); int fast_mode_free(fast_mode_data *f); fast_mode_data *fast_mode_getdata(fast_mode_data *f); fast_mode_data *fast_mode_checkdata(fast_mode_data *f); int fast_mode_setdata(fast_mode_data *f, long pos, char *line);