ekg2
 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 "ekg2-config.h"
25 #include <stdio.h>
26 #include <ekg/sessions.h>
27 #include <ekg/plugins.h>
28 #include <ekg/protocol.h>
29 
30 typedef struct {
31  int logformat;
32  /* 19:55:24 <@zdzichuBG> wtedy trzeba by jescze jakis callback na zmiane zmiennej logs_format
33  * callback zmiennych sesyjnych w ekg2 niet. jest cos takiego.
34  */
35  char *path; /* path don't free it ! .... */
36  FILE *file; /* file don't close it! it will be closed at unloading plugin. */
37 } log_window_t;
38 
39 typedef struct {
40  char *session; /* session name */
41  char *uid; /* uid of user */
42  time_t t; /* time when we create (lw->path || just lw) */
44 } logs_log_t;
45 
46 /* log ff types... */
47 typedef enum {
53 } log_format_t;
54 
55  /* irssi style info messages */
56 #define IRSSI_LOG_EKG2_OPENED "--- Log opened %a %b %d %H:%M:%S %Y" /* defaultowy log_open_string irssi , jak cos to dodac zmienna... */
57 #define IRSSI_LOG_EKG2_CLOSED "--- Log closed %a %b %d %H:%M:%S %Y" /* defaultowy log_close_string irssi, jak cos to dodac zmienna... */
58 #define IRSSI_LOG_DAY_CHANGED "--- Day changed %a %b %d %Y" /* defaultowy log_day_changed irssi , jak cos to dodac zmienna... */
59 
60 static char *logs_prepare_path(session_t *session, const char *logs_path, const char *uid, time_t sent);
61 static const char *prepare_timestamp_format(const char *format, time_t t);
62 
63 static logs_log_t *logs_log_find(const char *session, const char *uid, int create);
64 static logs_log_t *logs_log_new(logs_log_t *l, const char *session, const char *uid);
65 
66 static FILE *logs_open_file(char *path, int ff);
67 
68 static void logs_simple(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class, const char *status);
69 static void logs_xml (FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class);
70 static void logs_irssi(FILE *file, const char *session, const char *uid, const char *text, time_t sent, msgclass_t class);
71 #if 0 /* never started? */
72 static void logs_gaim();
73 #endif
74 
75 static list_t log_logs = NULL;
76 
77 static int config_logs_log;
82 static int config_logs_max_files = 7;
83 static char *config_logs_path;
84 static char *config_logs_timestamp;
85 
86 #endif