libweed  0.6.0
 All Data Structures Files Functions Variables Typedefs Macros
weed-host.h
Go to the documentation of this file.
1 /* WEED is free software; you can redistribute it and/or
2  modify it under the terms of the GNU Lesser General Public
3  License as published by the Free Software Foundation; either
4  version 3 of the License, or (at your option) any later version.
5 
6  Weed is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9  Lesser General Public License for more details.
10 
11  You should have received a copy of the GNU Lesser General Public
12  License along with this source code; if not, write to the Free Software
13  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
14 
15 
16  Weed is developed by:
17 
18  Gabriel "Salsaman" Finch - http://lives.sourceforge.net
19 
20  mainly based on LiViDO, which is developed by:
21 
22 
23  Niels Elburg - http://veejay.sf.net
24 
25  Gabriel "Salsaman" Finch - http://lives.sourceforge.net
26 
27  Denis "Jaromil" Rojo - http://freej.dyne.org
28 
29  Tom Schouten - http://zwizwa.fartit.com
30 
31  Andraz Tori - http://cvs.cinelerra.org
32 
33  reviewed with suggestions and contributions from:
34 
35  Silvano "Kysucix" Galliani - http://freej.dyne.org
36 
37  Kentaro Fukuchi - http://megaui.net/fukuchi
38 
39  Jun Iio - http://www.malib.net
40 
41  Carlo Prelz - http://www2.fluido.as:8080/
42 
43 */
44 
45 /* (C) Gabriel "Salsaman" Finch, 2005 - 2007 */
46 
47 #ifndef __WEED_HOST_H__
48 #define __WEED_HOST_H__
49 
50 #ifndef __WEED_H__
51 #include <weed/weed.h>
52 #endif
53 
54 #ifdef __cplusplus
55 extern "C"
56 {
57 #endif /* __cplusplus */
58 
59 /* Plant types */
60 #define WEED_PLANT_UNKNOWN 0
61 
62 /* Caller Types */
63 #define WEED_CALLER_HOST 0
64 #define WEED_CALLER_PLUGIN 1
65 
66 /* host only functions */
67 typedef void (*weed_plant_free_f)(weed_plant_t *plant);
68 typedef int (*weed_leaf_delete_f)(weed_plant_t *plant, const char *key);
69 typedef int (*weed_leaf_set_flags_f)(weed_plant_t *plant, const char *key, int flags);
70 typedef int (weed_leaf_set_caller_f)(weed_plant_t *plant, const char *key, int seed_type, int num_elems, void *value, int caller);
71 
72 #ifndef _SKIP_WEED_API_
73 #ifndef _WEED_VISIBLE_FUNCTIONS_
74 
88 
93 
94 #else
95 
96 void weed_plant_free(weed_plant_t *leaf) __attribute__((visibility("default")));
97 char **weed_plant_list_leaves(weed_plant_t *plant) __attribute__((visibility("default")));
98 int weed_leaf_set_flags(weed_plant_t *plant, const char *key, int flags) __attribute__((visibility("default")));
99 int weed_leaf_get_flags(weed_plant_t *plant, const char *key) __attribute__((visibility("default")));
100 weed_plant_t *weed_plant_new(int plant_type) __attribute__((visibility("default")));
101 int weed_default_get(weed_plant_t *plant, const char *key, int idx, void *value) __attribute__((visibility("default")));
102 int weed_leaf_get(weed_plant_t *plant, const char *key, int idx, void *value) __attribute__((visibility("default")));
103 int weed_leaf_num_elements(weed_plant_t *plant, const char *key) __attribute__((visibility("default")));
104 size_t weed_leaf_element_size(weed_plant_t *plant, const char *key, int idx) __attribute__((visibility("default")));
105 int weed_leaf_seed_type(weed_plant_t *plant, const char *key) __attribute__((visibility("default")));
106 int weed_leaf_get_flags(weed_plant_t *plant, const char *key) __attribute__((visibility("default")));
107 int weed_leaf_set_plugin(weed_plant_t *plant, const char *key, int seed_type, int num_elems, void *value)
108 __attribute__((visibility("default")));
109 void *weed_malloc(size_t n) __attribute__((visibility("default")));
110 void weed_free(void *p) __attribute__((visibility("default")));
111 void *weed_memset(void *p, int c, size_t n) __attribute__((visibility("default")));
112 void *weed_memcpy(void *dest, const void *src, size_t n) __attribute__((visibility("default")));
113 int weed_leaf_set(weed_plant_t *plant, const char *key, int seed_type, int num_elems, void *value)
114 __attribute__((visibility("default")));
115 int weed_leaf_set_plugin(weed_plant_t *plant, const char *key, int seed_type, int num_elems, void *value)
116 __attribute__((visibility("default")));
117 int weed_leaf_delete(weed_plant_t *plant, const char *key) __attribute__((visibility("default")));
118 
119 #endif
120 
121 #endif
122 
123 #ifndef _WEED_VISIBLE_FUNCTIONS_
124 void weed_init(int api_v, weed_malloc_f, weed_free_f, weed_memcpy_f, weed_memset_f) __attribute__((visibility("default")));
125 #endif
126 
127 
128 #ifdef __cplusplus
129 }
130 #endif /* __cplusplus */
131 
132 #endif // #ifndef __WEED_HOST_H__
133 
134 
weed_leaf_seed_type_f weed_leaf_seed_type
Definition: weed-host.h:85
weed_leaf_get_flags_f weed_leaf_get_flags
Definition: weed-host.h:86
weed_free_f weed_free
Definition: weed-host.h:90
void(* weed_plant_free_f)(weed_plant_t *plant)
Definition: weed-host.h:67
int(* weed_leaf_delete_f)(weed_plant_t *plant, const char *key)
Definition: weed-host.h:68
void *(* weed_memset_f)(void *s, int c, size_t n)
Definition: weed.h:91
weed_leaf_delete_f weed_leaf_delete
Definition: weed-host.h:81
void(* weed_free_f)(void *ptr)
Definition: weed.h:90
char **(* weed_plant_list_leaves_f)(weed_plant_t *plant)
Definition: weed.h:126
weed_leaf_num_elements_f weed_leaf_num_elements
Definition: weed-host.h:83
weed_memcpy_f weed_memcpy
Definition: weed-host.h:91
weed_leaf_set_f weed_leaf_set
Definition: weed-host.h:77
void *(* weed_malloc_f)(size_t size)
Definition: weed.h:89
int(* weed_leaf_set_f)(weed_plant_t *plant, const char *key, int seed_type, int num_elems, void *value)
Definition: weed.h:127
weed_memset_f weed_memset
Definition: weed-host.h:92
weed_leaf_element_size_f weed_leaf_element_size
Definition: weed-host.h:84
weed_malloc_f weed_malloc
Definition: weed-host.h:89
int(* weed_leaf_num_elements_f)(weed_plant_t *plant, const char *key)
Definition: weed.h:129
int(* weed_leaf_get_flags_f)(weed_plant_t *plant, const char *key)
Definition: weed.h:132
int(* weed_leaf_seed_type_f)(weed_plant_t *plant, const char *key)
Definition: weed.h:131
weed_leaf_t weed_plant_t
Definition: weed.h:99
weed_plant_t *(* weed_plant_new_f)(int plant_type)
Definition: weed.h:125
weed_leaf_get_f weed_leaf_get
Definition: weed-host.h:76
int(* weed_leaf_set_flags_f)(weed_plant_t *plant, const char *key, int flags)
Definition: weed-host.h:69
size_t(* weed_leaf_element_size_f)(weed_plant_t *plant, const char *key, int idx)
Definition: weed.h:130
void *(* weed_memcpy_f)(void *dest, const void *src, size_t n)
Definition: weed.h:92
weed_plant_new_f weed_plant_new
Definition: weed-host.h:79
int(* weed_leaf_get_f)(weed_plant_t *plant, const char *key, int idx, void *value)
Definition: weed.h:128
int( weed_leaf_set_caller_f)(weed_plant_t *plant, const char *key, int seed_type, int num_elems, void *value, int caller)
Definition: weed-host.h:70
weed_plant_free_f weed_plant_free
Definition: weed-host.h:80
int(* weed_default_getter_f)(weed_plant_t *plant, const char *key, int idx, void *value)
Definition: weed.h:122
weed_plant_list_leaves_f weed_plant_list_leaves
Definition: weed-host.h:82
weed_leaf_set_flags_f weed_leaf_set_flags
Definition: weed-host.h:87
void weed_init(int api_v, weed_malloc_f, weed_free_f, weed_memcpy_f, weed_memset_f) __attribute__((visibility("default")))
Definition: weed-gslice.c:414
weed_leaf_set_f weed_leaf_set_plugin
Definition: weed-host.h:78
weed_default_getter_f weed_default_get
Definition: weed-host.h:75