]>
git.ipfire.org Git - thirdparty/sarg.git/blob - include/readlog.h
5 \brief Possible return codes for the functions parsing the input log.
7 enum ReadLogReturnCodeEnum
9 //! Line successfuly read.
11 //! Line is known and should be ignored.
13 //! Unknown line format.
15 //! Error encountered during the parsing of the file.
18 RLRC_LastRetCode
//!< last entry of the list.
22 \brief Data read from an input log file.
26 //! The time corresponding to the entry.
28 //! The IP address connecting to internet.
33 The URL of the visited site.
35 The pointer may be NULL if the URL doesn't exists in the log file.
38 //! Time necessary to process the user's request.
40 //! Number of transfered bytes.
41 long long int DataSize
;
42 //! HTTP code returned to the user for the entry.
44 //! HTTP method or NULL if the information is not stored in the log.
49 \brief Functions to read a log file.
51 struct ReadLogProcessStruct
53 //! The name of the log file processed by this object.
55 //! Inform the module about the reading of a new file.
56 void (*NewFile
)(const char *FileName
);
57 //! Funtion to read one entry from the log.
58 enum ReadLogReturnCodeEnum (*ReadEntry
)(char *Line
,struct ReadLogStruct
*Entry
);
62 * \brief Persistant data to parse a log line.
66 const struct ReadLogProcessStruct
*current_format
;
67 int current_format_idx
;
68 int successive_errors
;
70 const char *file_name
;
73 //! Opaque object used to parse a log line.
74 typedef struct LogLineStruct
*LogLineObject
;
76 void LogLine_Init(struct LogLineStruct
*log_line
);
77 void LogLine_File(struct LogLineStruct
*log_line
,const char *file_name
);
78 enum ReadLogReturnCodeEnum
LogLine_Parse(struct LogLineStruct
*log_line
,struct ReadLogStruct
*log_entry
,char *linebuf
);
80 #endif //READLOG_HEADER