ekg2
remote/userlist.h
Idź do dokumentacji tego pliku.
00001 /* $Id: userlist.h 4412 2008-08-17 12:28:15Z peres $ */
00002 
00003 /*
00004  *  (C) Copyright 2001-2003 Wojtek Kaniewski <wojtekka@irc.pl>
00005  *                          Robert J. Woźny <speedy@ziew.org>
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License Version 2 as
00009  *  published by the Free Software Foundation.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 #ifndef __EKG_USERLIST_H
00022 #define __EKG_USERLIST_H
00023 
00024 #include <time.h>
00025 
00026 #include "dynstuff.h"
00027 #include "plugins.h"
00028 #include "sessions.h"
00029 #include "windows.h"
00030 
00031 typedef struct userlist {
00032         struct userlist *next;
00033 
00034         char            *uid;           
00035         char            *nickname;      
00036         struct ekg_group *groups;       
00040         status_t        status;         
00041         char            *descr;         /* */
00042         char            *descr1line;
00043 
00044         void *__resources;              /* ekg2-remote: OK, NULL */     /* XXX, to w ogole by sie przydalo dorobic w ui-pluginach */
00045         time_t          __last_seen;    /* ekg2-remote: OK, 0 */
00046         char            *__foreign;     /* ekg2-remote: OK, NULL */
00047 
00048         void            *priv;          
00050         unsigned int    blink   : 1;    
00051         unsigned int    typing  : 1;    
00053         status_t        last_status;    
00054         char            *last_descr;    
00055         time_t          status_time;    
00056         void            *private;          
00057         private_data_t  *priv_list;     /* New user private data */
00058 } userlist_t;
00059 
00060 typedef enum {
00061         EKG_XSTATE_BLINK        = 1,
00062         EKG_XSTATE_TYPING       = 2
00063 } xstate_t;
00064 
00065 struct ekg_group {
00066         struct ekg_group *next;
00067         char *name;             
00068 };
00069 
00070 typedef enum {
00071         IGNORE_STATUS           = 0x01,
00072         IGNORE_STATUS_DESCR     = 0x02,
00073         IGNORE_MSG              = 0x04,
00074         IGNORE_DCC              = 0x08,
00075         IGNORE_EVENTS           = 0x10,
00076         IGNORE_NOTIFY           = 0x20,
00077         IGNORE_XOSD             = 0x40,
00078         IGNORE_LOG              = 0x80,
00079         
00080         IGNORE_ALL              = 0xFF
00081 } ignore_t;
00082 
00083 struct ignore_label {
00084         ignore_t        level;
00085         char            *name;
00086 };
00087 
00088 extern struct ignore_label ignore_labels[];
00089 
00090 userlist_t *remote_userlist_add_entry(userlist_t **userlist, char **__entry, int count);
00091 int userlist_remove(session_t *session, userlist_t *u);
00092 userlist_t *userlist_find(session_t *session, const char *uid);
00093 #define userlist_find_n(a, b) userlist_find(session_find(a), b)
00094 void userlist_free(session_t *session);
00095 void userlists_destroy(userlist_t **userlist);
00096 
00097 int ignored_check(session_t *session, const char *uid);
00098 
00099 int ekg_group_member(userlist_t *u, const char *group);
00100 
00101 char *get_uid(session_t *session, const char *text);
00102 
00103 #define user_private_item_get_int(user, name) \
00104         private_item_get_int(&(user)->priv_list, name)
00105 #define user_private_item_set(user, name, value) \
00106         private_item_set(&(user)->priv_list, name, value)
00107 
00108 #endif /* __EKG_USERLIST_H */
00109 
00110 /*
00111  * Local Variables:
00112  * mode: c
00113  * c-file-style: "k&r"
00114  * c-basic-offset: 8
00115  * indent-tabs-mode: t
00116  * End:
00117  */
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje