Idź do dokumentacji tego pliku.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __logs_h__
00022 #define __logs_h__
00023
00024 #include "ekg2-config.h"
00025 #include <stdio.h>
00026 #include <ekg/sessions.h>
00027 #include <ekg/plugins.h>
00028 #include <ekg/protocol.h>
00029
00030 typedef struct {
00031 int logformat;
00032
00033
00034
00035 char *path;
00036 FILE *file;
00037 } log_window_t;
00038
00039 typedef struct {
00040 char *session;
00041 char *uid;
00042 time_t t;
00043 log_window_t *lw;
00044 } logs_log_t;
00045
00046
00047 typedef enum {
00048 LOG_FORMAT_NONE = 0,
00049 LOG_FORMAT_SIMPLE,
00050 LOG_FORMAT_XML,
00051 LOG_FORMAT_IRSSI,
00052 LOG_FORMAT_RAW,
00053 } log_format_t;
00054
00055
00056 #define IRSSI_LOG_EKG2_OPENED "--- Log opened %a %b %d %H:%M:%S %Y"
00057 #define IRSSI_LOG_EKG2_CLOSED "--- Log closed %a %b %d %H:%M:%S %Y"
00058 #define IRSSI_LOG_DAY_CHANGED "--- Day changed %a %b %d %Y"
00059
00060 static char *logs_prepare_path(session_t *session, const char *logs_path, const char *uid, time_t sent);
00061 static const char *prepare_timestamp_format(const char *format, time_t t);
00062
00063 static logs_log_t *logs_log_find(const char *session, const char *uid, int create);
00064 static logs_log_t *logs_log_new(logs_log_t *l, const char *session, const char *uid);
00065
00066 static FILE *logs_open_file(char *path, int ff);
00067
00068 static void logs_simple(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class, const char *status);
00069 static void logs_xml (FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class);
00070 static void logs_irssi(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class);
00071 #if 0
00072 static void logs_gaim();
00073 #endif
00074
00075 static list_t log_logs = NULL;
00076
00077 static int config_logs_log;
00078 static int config_logs_log_raw;
00079 static int config_logs_log_ignored;
00080 static int config_logs_log_status;
00081 static int config_logs_remind_number = 0;
00082 static int config_logs_max_files = 7;
00083 static char *config_logs_path;
00084 static char *config_logs_timestamp;
00085
00086 #endif