ekg2  GIT master
vars.h
Idź do dokumentacji tego pliku.
1 /* $Id: vars.h 4062 2008-07-08 08:17:16Z darkjames $ */
2 
3 /*
4  * (C) Copyright 2001-2003 Wojtek Kaniewski <wojtekka@irc.pl>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License Version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #ifndef __EKG_VARS_H
21 #define __EKG_VARS_H
22 
23 #include "plugins.h"
24 
25 typedef enum {
26  VAR_STR, /* ciąg znaków */
27  VAR_INT, /* liczba całkowita */
28  VAR_BOOL, /* 0/1, tak/nie, yes/no, on/off */
29  VAR_MAP, /* bitmapa */
30  VAR_FILE, /* plik */
31  VAR_DIR, /* katalog */
32  VAR_THEME, /* theme */
33 
34  VAR_REMOTE /* remote, not used by plugins */
36 
37 typedef struct {
38  char *label; /* nazwa wartości */
39  int value; /* wartość */
40  int conflicts; /* wartości, z którymi koliduje */
42 
43 typedef void (variable_notify_func_t)(const char *);
44 typedef void (variable_check_func_t)(const char *, const char *);
45 typedef int (variable_display_func_t)(const char *);
46 
47 typedef struct variable {
48  struct variable *next;
49 
50  char *name; /* ekg2-remote: OK */
51  plugin_t *plugin; /* ekg2-remote: NONE */
52  int name_hash; /* ekg2-remote: OK */
53  int type; /* ekg2-remote: VAR_STR, ncurses completion BAD */
54  int display; /* ekg2-remote: ? 0 bez wartości, 1 pokazuje, 2 w ogóle */
55  void *ptr; /* ekg2-remote: OK, olewamy wartosc */
56  variable_check_func_t *check; /* ekg2-remote: BAD */
57  variable_notify_func_t *notify; /* ekg2-remote: ? */
58  variable_map_t *map; /* ekg2-remote: BAD */
59  variable_display_func_t *dyndisplay; /* ekg2-remote: BAD */
60 } variable_t;
61 
62 extern variable_t *variables;
63 
64 void variable_init();
65 variable_t *variable_find(const char *name);
66 variable_map_t *variable_map(int count, ...);
67 
69 variable_t *remote_variable_add(const char *name, const char *value);
70 
72 
73 void variables_destroy();
74 
75 #endif /* __EKG_VARS_H */
76 
77 /*
78  * Local Variables:
79  * mode: c
80  * c-file-style: "k&r"
81  * c-basic-offset: 8
82  * indent-tabs-mode: t
83  * End:
84  */
Definition: vars.h:38
variable_notify_func_t * notify
Definition: vars.h:62
variable_class_t
Definition: vars.h:32
void variable_init()
Definition: vars.c:65
variable_t * variables_removei(variable_t *v)
struct variable_map_t variable_map_t
Definition: vars.h:39
void() variable_notify_func_t(const char *)
Definition: vars.h:48
Definition: vars.h:35
int() variable_display_func_t(const char *)
Definition: vars.h:50
int display
Definition: vars.h:57
variable_display_func_t * dyndisplay
Definition: vars.h:65
void() variable_check_func_t(const char *, const char *)
Definition: vars.h:49
Definition: vars.h:33
Definition: plugins.h:76
struct variable * next
Definition: vars.h:48
Definition: vars.h:37
char * name
Definition: vars.h:53
Definition: vars.h:42
void variables_destroy()
Definition: vars.c:508
Definition: vars.h:36
GSList * variables
Definition: vars.c:35
variable_check_func_t * check
Definition: vars.h:59
plugin_t * plugin
Definition: vars.h:54
void * ptr
Definition: vars.h:58
variable_t * remote_variable_add(const char *name, const char *value)
Definition: vars.h:34
struct variable variable_t
variable_map_t * map
Definition: vars.h:64
variable_map_t * variable_map(int count,...)
Definition: vars.c:196
variable_t * variable_find(const char *name)
Definition: vars.c:166
variable_t * variable_add(plugin_t *plugin, const char *name, int type, int display, void *ptr, variable_notify_func_t *notify, variable_map_t *map, variable_display_func_t *dyndisplay)
Definition: vars.c:232
Definition: vars.h:52
Definition: vars.h:34
int name_hash
Definition: vars.h:55
int type
Definition: vars.h:56