ekg2  GIT master
main.h
Idź do dokumentacji tego pliku.
1 /* $Id$ */
2 
3 /*
4  * (C) Copyright 2003-2004 Leszek Krupiński <leafnode@wafel.com>
5  * 2005 Adam Mikuta <adamm@ekg2.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License Version
9  * 2.1 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20 
21 #ifndef __logs_h__
22 #define __logs_h__
23 
24 #include <stdio.h>
25 
26 typedef struct {
27  int logformat;
28  /* 19:55:24 <@zdzichuBG> wtedy trzeba by jescze jakis callback na zmiane zmiennej logs_format
29  * callback zmiennych sesyjnych w ekg2 niet. jest cos takiego.
30  */
31  char *path; /* path don't free it ! .... */
32  FILE *file; /* file don't close it! it will be closed at unloading plugin. */
33 } log_window_t;
34 
35 typedef struct {
36  char *session; /* session name */
37  char *uid; /* uid of user */
38  time_t t; /* time when we create (lw->path || just lw) */
40 } logs_log_t;
41 
42 /* log ff types... */
43 typedef enum {
49 } log_format_t;
50 
51  /* irssi style info messages */
52 #define IRSSI_LOG_EKG2_OPENED "--- Log opened %a %b %d %H:%M:%S %Y" /* defaultowy log_open_string irssi , jak cos to dodac zmienna... */
53 #define IRSSI_LOG_EKG2_CLOSED "--- Log closed %a %b %d %H:%M:%S %Y" /* defaultowy log_close_string irssi, jak cos to dodac zmienna... */
54 #define IRSSI_LOG_DAY_CHANGED "--- Day changed %a %b %d %Y" /* defaultowy log_day_changed irssi , jak cos to dodac zmienna... */
55 
56 static char *logs_prepare_path(session_t *session, const char *logs_path, const char *uid, time_t sent);
57 static const char *prepare_timestamp_format(const char *format, time_t t);
58 
59 static logs_log_t *logs_log_find(const char *session, const char *uid, int create);
60 static logs_log_t *logs_log_new(logs_log_t *l, const char *session, const char *uid);
61 
62 static FILE *logs_open_file(char *path, int ff);
63 
64 static void logs_simple(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class, const char *status);
65 static void logs_xml (FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class);
66 static void logs_irssi(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class);
67 #if 0 /* never started? */
68 static void logs_gaim();
69 #endif
70 
71 static list_t log_logs = NULL;
72 
73 static int config_logs_log;
78 static int config_logs_max_files = 7;
79 static char *config_logs_path;
80 static char *config_logs_timestamp;
81 static gchar *config_logs_encoding;
82 
83 #endif
static list_t log_logs
Definition: main.h:71
log_window_t * lw
Definition: main.h:39
static char * config_logs_timestamp
Definition: main.h:80
Definition: main.h:48
Definition: sessions.h:127
char * path
Definition: main.h:31
Definition: ekg_hash_benchmark.c:47
static void logs_simple(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class, const char *status)
Definition: main.h:45
char * uid
Definition: main.h:37
static void logs_xml(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class)
#define NULL
Definition: oralog.c:49
time_t t
Definition: main.h:38
log_format_t
Definition: main.h:43
Definition: main.h:35
static int config_logs_log_status
Definition: main.h:76
static int config_logs_log
Definition: main.h:73
FILE * file
Definition: main.h:32
static int config_logs_log_raw
Definition: main.h:74
static int config_logs_log_ignored
Definition: main.h:75
static gchar * config_logs_encoding
Definition: main.h:81
static char * config_logs_path
Definition: main.h:79
static char * logs_prepare_path(session_t *session, const char *logs_path, const char *uid, time_t sent)
static int config_logs_max_files
Definition: main.h:78
char * session
Definition: main.h:36
Definition: main.h:26
Definition: main.h:47
Definition: ekg_hash_benchmark.c:14
static logs_log_t * logs_log_find(const char *session, const char *uid, int create)
static void logs_irssi(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class)
static int config_logs_remind_number
Definition: main.h:77
static const char * prepare_timestamp_format(const char *format, time_t t)
static FILE * logs_open_file(char *path, int ff)
msgclass_t
Definition: protocol.h:71
static logs_log_t * logs_log_new(logs_log_t *l, const char *session, const char *uid)
Definition: main.h:44
Definition: main.h:46
int logformat
Definition: main.h:27