ekg2
Strona główna
Dodatkowe strony
Moduły
Struktury Danych
Pliki
Lista plików
Globalne
All
Struktury Danych
Pliki
Funkcje
Zmienne
Definicje typów
Wyliczenia
Wartości wyliczeń
Definicje
Grupay
Strony
ekg
vars.h
Idź do dokumentacji tego pliku.
1
/* $Id$ */
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 "
dynstuff.h
"
24
#include "
plugins.h
"
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
30
typedef
enum
{
31
VAR_STR
,
/* ciąg znaków */
32
VAR_INT
,
/* liczba całkowita */
33
VAR_BOOL
,
/* 0/1, tak/nie, yes/no, on/off */
34
VAR_MAP
,
/* bitmapa */
35
VAR_FILE
,
/* plik */
36
VAR_DIR
,
/* katalog */
37
VAR_THEME
/* theme */
38
}
variable_class_t
;
39
40
typedef
struct
{
41
char
*
label
;
/* nazwa wartości */
42
int
value
;
/* wartość */
43
int
conflicts
;
/* wartości, z którymi koliduje */
44
}
variable_map_t
;
45
46
typedef
void (
variable_notify_func_t
)(
const
char
*);
47
typedef
void (
variable_check_func_t
)(
const
char
*,
const
char
*);
48
typedef
int (
variable_display_func_t
)(
const
char
*);
49
50
typedef
struct
variable
{
51
struct
variable
*
next
;
52
53
char
*
name
;
/* nazwa zmiennej */
54
plugin_t
*
plugin
;
/* wstyczka obsługująca zmienną */
55
int
name_hash
;
/* hash nazwy zmiennej */
56
int
type
;
/* rodzaj */
57
int
display
;
/* 0 bez wartości, 1 pokazuje, 2 w ogóle */
58
void
*
ptr
;
/* wskaźnik do zmiennej */
59
variable_check_func_t
*
check
;
60
/* funkcja sprawdzająca czy wartość jest
61
* prawidłowa */
62
variable_notify_func_t
*
notify
;
63
/* funkcja wywoływana po zmianie wartości */
64
variable_map_t
*
map
;
/* mapa wartości i etykiet */
65
variable_display_func_t
*
dyndisplay
;
66
/* funkcja sprawdzająca, czy zmienną można
67
* wyświetlić na liście zmiennych */
68
}
variable_t
;
69
70
#ifndef EKG2_WIN32_NOFUNCTION
71
72
extern
variable_t
*
variables
;
73
74
void
variable_init
();
75
void
variable_set_default
();
76
variable_t
*
variable_find
(
const
char
*
name
);
77
variable_map_t
*
variable_map
(
int
count
, ...);
78
#define variable_hash ekg_hash
79
80
variable_t
*
variable_add
(
81
plugin_t
*
plugin
,
82
const
char
*
name
,
83
int
type
,
84
int
display
,
85
void
*
ptr
,
86
variable_notify_func_t
*
notify
,
87
variable_map_t
*
map
,
88
variable_display_func_t
*
dyndisplay
);
89
90
int
variable_set
(
const
char
*
name
,
const
char
*value);
91
void
variable_help
(
const
char
*
name
);
92
int
variable_remove
(
plugin_t
*
plugin
,
const
char
*
name
);
93
94
variable_t
*
variables_removei
(
variable_t
*v);
95
void
variables_destroy
();
96
97
#endif
98
99
#ifdef __cplusplus
100
}
101
#endif
102
103
#endif
/* __EKG_VARS_H */
104
105
/*
106
* Local Variables:
107
* mode: c
108
* c-file-style: "k&r"
109
* c-basic-offset: 8
110
* indent-tabs-mode: t
111
* End:
112
*/
Wygenerowano Pn, 15 lip 2013 08:05:25 dla ekg2 programem
1.8.4