aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/include/eina_inline_lock_void.x
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/eina/src/include/eina_inline_lock_void.x
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/eina/src/include/eina_inline_lock_void.x')
-rw-r--r--libraries/eina/src/include/eina_inline_lock_void.x247
1 files changed, 247 insertions, 0 deletions
diff --git a/libraries/eina/src/include/eina_inline_lock_void.x b/libraries/eina/src/include/eina_inline_lock_void.x
new file mode 100644
index 0000000..8cb9a49
--- /dev/null
+++ b/libraries/eina/src/include/eina_inline_lock_void.x
@@ -0,0 +1,247 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2011 Vincent Torri
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_INLINE_LOCK_VOID_X_
20#define EINA_INLINE_LOCK_VOID_X_
21
22#ifdef EINA_UNUSED
23# undef EINA_UNUSED
24#endif
25#ifdef __GNUC__
26# define EINA_UNUSED __attribute__((unused))
27#else
28# define EINA_UNUSED
29#endif
30
31/**
32 * @addtogroup Eina_Lock_Group Lock
33 *
34 * @brief These functions provide Mutual Exclusion objects management.
35 *
36 * @note On Windows XP, critical sections are used, while on Windows
37 * CE, standard Mutex objects are used.
38 *
39 * @{
40 */
41
42/**
43 * @typedef Eina_Lock
44 * Abtract type for a mutual exclusive object.
45 */
46typedef void *Eina_Lock;
47typedef void *Eina_RWLock;
48typedef void *Eina_Condition;
49typedef void *Eina_TLS;
50
51/**
52 * @brief Create a new #Eina_Lock.
53 *
54 * @param mutex A pointer to the lock object.
55 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
56 *
57 * This function creates a new #Eina_Lock object and stores it in the
58 * @p mutex buffer. On success, this function returns #EINA_TRUE and
59 * #EINA_FALSE otherwise. To free the resources allocated by this
60 * function, use eina_lock_free(). For performance reasons, no check
61 * is done on @p mutex.
62 */
63static inline Eina_Bool
64eina_lock_new(Eina_Lock *mutex EINA_UNUSED)
65{
66 return EINA_FALSE;
67}
68
69/**
70 * @brief Free the ressources of the given lock object.
71 *
72 * @param mutex The lock object to free.
73 *
74 * This function frees the resources of @p mutex allocated by
75 * eina_lock_new(). For performance reasons, no check is done on
76 * @p mutex.
77 */
78static inline void
79eina_lock_free(Eina_Lock *mutex EINA_UNUSED)
80{
81}
82
83/**
84 * @brief Lock the given mutual exclusion object.
85 *
86 * @param mutex The lock object to lock.
87 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
88 *
89 * This function locks @p mutex. @p mutex must have been created by
90 * eina_lock_new(). On success, this function returns #EINA_TRUE and
91 * #EINA_FALSE otherwise. For performance reasons, no check is done on
92 * @p mutex.
93 */
94static inline Eina_Lock_Result
95eina_lock_take(Eina_Lock *mutex EINA_UNUSED)
96{
97 return EINA_LOCK_FAIL;
98}
99
100/**
101 * @brief Try to lock the given mutual exclusion object.
102 *
103 * @param mutex The lock object to try to lock.
104 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
105 *
106 * This function tries to lock @p mutex. @p mutex must have been created by
107 * eina_lock_new(). If @p mutex can be locked, this function returns
108 * #EINA_TRUE; if @p mutex can not be locked, or is already locked, it
109 * returns #EINA_FALSE. This function does not block and returns
110 * immediately. For performance reasons, no check is done on
111 * @p mutex.
112 *
113 * @note On Windows CE, this function is actually eina_lock_take().
114 */
115static inline Eina_Lock_Result
116eina_lock_take_try(Eina_Lock *mutex EINA_UNUSED)
117{
118 return EINA_LOCK_FAIL;
119}
120
121/**
122 * @brief Unlock the given mutual exclusion object.
123 *
124 * @param mutex The lock object to unlock.
125 * @return #EINA_TRUE on success, #EINA_FALSE otherwise.
126 *
127 * This function unlocks @p mutex. @p mutex must have been created by
128 * eina_lock_new(). On success, this function returns #EINA_TRUE and
129 * #EINA_FALSE otherwise. For performance reasons, no check is done on
130 * @p mutex.
131 */
132static inline Eina_Lock_Result
133eina_lock_release(Eina_Lock *mutex EINA_UNUSED)
134{
135 return EINA_LOCK_FAIL;
136}
137
138static inline void
139eina_lock_debug(const Eina_Lock *mutex EINA_UNUSED)
140{
141}
142
143static inline Eina_Bool
144eina_condition_new(Eina_Condition *cond EINA_UNUSED, Eina_Lock *mutex EINA_UNUSED)
145{
146 return EINA_FALSE;
147}
148
149static inline void
150eina_condition_free(Eina_Condition *cond EINA_UNUSED)
151{
152}
153
154static inline Eina_Bool
155eina_condition_wait(Eina_Condition *cond EINA_UNUSED)
156{
157 return EINA_FALSE;
158}
159
160static inline Eina_Bool
161eina_condition_timedwait(Eina_Condition *cond EINA_UNUSED, double val EINA_UNUSED)
162{
163 return EINA_FALSE;
164}
165
166static inline Eina_Bool
167eina_condition_broadcast(Eina_Condition *cond EINA_UNUSED)
168{
169 return EINA_FALSE;
170}
171
172static inline Eina_Bool
173eina_condition_signal(Eina_Condition *cond EINA_UNUSED)
174{
175 return EINA_FALSE;
176}
177
178static inline Eina_Bool
179eina_rwlock_new(Eina_RWLock *mutex EINA_UNUSED)
180{
181 return EINA_FALSE;
182}
183
184static inline void
185 eina_rwlock_free(Eina_RWLock *mutex EINA_UNUSED)
186{
187}
188
189static inline Eina_Lock_Result
190eina_rwlock_read_take(Eina_RWLock *mutex EINA_UNUSED)
191{
192 return EINA_LOCK_FAIL;
193}
194
195static inline Eina_Lock_Result
196eina_rwlock_write_take(Eina_RWLock *mutex EINA_UNUSED)
197{
198 return EINA_LOCK_FAIL;
199}
200
201static inline Eina_Lock_Result
202eina_rwlock_release(Eina_RWLock *mutex EINA_UNUSED)
203{
204 return EINA_LOCK_FAIL;
205}
206
207static inline Eina_Lock_Result
208eina_rwlock_take_read(Eina_RWLock *mutex EINA_UNUSED)
209{
210 return EINA_LOCK_FAIL;
211}
212
213static inline Eina_Lock_Result
214eina_rwlock_take_write(Eina_RWLock *mutex EINA_UNUSED)
215{
216 return EINA_LOCK_FAIL;
217}
218
219static inline Eina_Bool
220eina_tls_new(Eina_TLS *key EINA_UNUSED)
221{
222 return EINA_FALSE;
223}
224
225static inline void
226eina_tls_free(Eina_TLS key EINA_UNUSED)
227{
228}
229
230static inline void *
231eina_tls_get(Eina_TLS key EINA_UNUSED)
232{
233 return NULL;
234}
235
236static inline Eina_Bool
237eina_tls_set(Eina_TLS key EINA_UNUSED, const void *data EINA_UNUSED)
238{
239 return EINA_FALSE;
240}
241
242
243/**
244 * @}
245 */
246
247#endif