summaryrefslogtreecommitdiff
path: root/src/lib/emile/Emile.h
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2015-03-17 08:49:57 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-17 09:58:17 +0100
commit0b04186a7fd530bc36dccfd27930a18506313ee4 (patch)
tree302dd8d493f7a1b97bdae48b934ded99894c6997 /src/lib/emile/Emile.h
parent0f13052b6ae3e65c7a9fd99bbdb11d240147adbb (diff)
emile: initial introduction of Emile.
The intent of Emile is to be the common layer for serialisation, compression and ciphering. It will expose the library we currently use internally to an easier use from the outside (like gcrypt and lz4). It should improve portability. Instead of pushing JSON, XML and what's not to Eina, I do think that they will fit better in Emile. As for the naming of Emile, you will need to be French and say : "Un quoi ?" "Un serializer !" Regarding why it is put there in the stack. Right now there is two users of compression (eet and terminology), two users of cipher library (eet and ecore_con) and a few handful of user for serialization (eina, eet, efreet, ecore_con, ...). So the choice was quite simple, it needed to be below Eet. Now it could have been on top of Eo or integrated into Eina. One of the use case I am thinking of, is to compress Eo object when a canvas get hidden/minized. For that it require Eo to use that library and it can't be a higher level object. And with current implementation of Eo it is perfectly possible to implement such idea. So not at Eo level. As for Eina, I am starting to think it is getting to much things in its namespace. I do believe that infact Eina_Simple_XML and Eina_File should after all have landed in their own library. That's why I am putting the current logic in a new library. It is going to expand, I want it to provide an few SAX like parser for JSON, Eet_Data and protobuf with also an API like Eet_Data to directly feed those value into a C structure without using a DOM at all. It would also be the right place to experiment and benchmark for a new Eet_Data format that could be more efficient to use. So at the end, and due to how I see things going and being used, I do think it is better of in its own library.
Diffstat (limited to 'src/lib/emile/Emile.h')
-rw-r--r--src/lib/emile/Emile.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/lib/emile/Emile.h b/src/lib/emile/Emile.h
new file mode 100644
index 0000000000..b0ab0efa64
--- /dev/null
+++ b/src/lib/emile/Emile.h
@@ -0,0 +1,111 @@
1/* EMILE - EFL serialization, compression and crypto library.
2 * Copyright (C) 2013 Enlightenment Developers:
3 * Cedric Bail <cedric.bail@samsung.com>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library 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 GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library;
17 * if not, see <http://www.gnu.org/licenses/>.
18 */
19
20/**
21 * @brief Emile serialization, compression and ciphering public API calls.
22 *
23 * These routines are used for Emile Library interaction
24 *
25 * @date 2013 (created)
26 */
27#ifndef EMILE_H_
28#define EMILE_H_
29
30#ifdef EAPI
31# undef EAPI
32#endif /* ifdef EAPI */
33
34#ifdef _WIN32
35# ifdef EFL_EMILE_BUILD
36# ifdef DLL_EXPORT
37# define EAPI __declspec(dllexport)
38# else /* ifdef DLL_EXPORT */
39# define EAPI
40# endif /* ! DLL_EXPORT */
41# else /* ifdef EFL_EET_BUILD */
42# define EAPI __declspec(dllimport)
43# endif /* ! EFL_EET_BUILD */
44#else /* ifdef _WIN32 */
45# ifdef __GNUC__
46# if __GNUC__ >= 4
47# define EAPI __attribute__ ((visibility("default")))
48# else /* if __GNUC__ >= 4 */
49# define EAPI
50# endif /* if __GNUC__ >= 4 */
51# else /* ifdef __GNUC__ */
52# define EAPI
53# endif /* ifdef __GNUC__ */
54#endif /* ! _WIN32 */
55
56#ifdef __cplusplus
57extern "C" {
58#endif /* ifdef __cplusplus */
59
60/**
61 * @file Emile.h
62 * @brief The file that provide the Emile function
63 *
64 * This header provides the Emile management functions.
65 */
66
67/**
68 * @defgroup Emile_Group Top level functions
69 * @ingroup Emile
70 * Function that affect Emile as a whole.
71 *
72 * @{
73 */
74
75/**
76 * Initialize the Emile library
77 *
78 * The first time this function is called, it will perform all the internal
79 * initialization required for the library to function properly and
80 * increment the initialization counter. Any subsequent call only
81 * increment this counter and return its new value, so it's safe to call
82 * this function more than once.
83 *
84 * @return The new init count. Will be 0 if initialization failed.
85 *
86 * @since 1.9.0
87 */
88EAPI int emile_init(void);
89
90/**
91 * Shut down the Emile library
92 *
93 * If emile_init() was called more than once for the running application,
94 * emile_shutdown() will decrement the initialization counter and return its
95 * new value, without doing anything else. When the counter reaches 0, all
96 * of the internal elements will be shutdown and any memory used freed.
97 *
98 * @return The new init count.
99 * @since 1.9.0
100 */
101EAPI int emile_shutdown(void);
102
103/**
104 * @}
105 */
106
107#ifdef __cplusplus
108}
109#endif /* ifdef __cplusplus */
110
111#endif /* ifndef _EET_H */