ekg2  GIT master
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
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