diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/eina/src/lib/eina_ustringshare.c | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to 'libraries/eina/src/lib/eina_ustringshare.c')
-rw-r--r-- | libraries/eina/src/lib/eina_ustringshare.c | 69 |
1 files changed, 63 insertions, 6 deletions
diff --git a/libraries/eina/src/lib/eina_ustringshare.c b/libraries/eina/src/lib/eina_ustringshare.c index 3992dc6..33be242 100644 --- a/libraries/eina/src/lib/eina_ustringshare.c +++ b/libraries/eina/src/lib/eina_ustringshare.c | |||
@@ -27,11 +27,38 @@ | |||
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "eina_share_common.h" | 30 | #ifdef HAVE_CONFIG_H |
31 | #include "eina_unicode.h" | 31 | # include "config.h" |
32 | #endif | ||
33 | |||
34 | #include "eina_config.h" | ||
32 | #include "eina_private.h" | 35 | #include "eina_private.h" |
36 | #include "eina_unicode.h" | ||
37 | #include "eina_log.h" | ||
38 | #include "eina_share_common.h" | ||
39 | |||
40 | /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ | ||
41 | #include "eina_safety_checks.h" | ||
33 | #include "eina_ustringshare.h" | 42 | #include "eina_ustringshare.h" |
34 | 43 | ||
44 | |||
45 | #ifdef CRITICAL | ||
46 | #undef CRITICAL | ||
47 | #endif | ||
48 | #define CRITICAL(...) EINA_LOG_DOM_CRIT(_eina_share_ustringshare_log_dom, __VA_ARGS__) | ||
49 | |||
50 | #ifdef ERR | ||
51 | #undef ERR | ||
52 | #endif | ||
53 | #define ERR(...) EINA_LOG_DOM_ERR(_eina_share_ustringshare_log_dom, __VA_ARGS__) | ||
54 | |||
55 | #ifdef DBG | ||
56 | #undef DBG | ||
57 | #endif | ||
58 | #define DBG(...) EINA_LOG_DOM_DBG(_eina_share_ustringshare_log_dom, __VA_ARGS__) | ||
59 | |||
60 | static int _eina_share_ustringshare_log_dom = -1; | ||
61 | |||
35 | /* The actual share */ | 62 | /* The actual share */ |
36 | static Eina_Share *ustringshare_share; | 63 | static Eina_Share *ustringshare_share; |
37 | static const char EINA_MAGIC_USTRINGSHARE_NODE_STR[] = "Eina UStringshare Node"; | 64 | static const char EINA_MAGIC_USTRINGSHARE_NODE_STR[] = "Eina UStringshare Node"; |
@@ -54,9 +81,31 @@ static const char EINA_MAGIC_USTRINGSHARE_NODE_STR[] = "Eina UStringshare Node"; | |||
54 | Eina_Bool | 81 | Eina_Bool |
55 | eina_ustringshare_init(void) | 82 | eina_ustringshare_init(void) |
56 | { | 83 | { |
57 | return eina_share_common_init(&ustringshare_share, | 84 | Eina_Bool ret; |
58 | EINA_MAGIC_USTRINGSHARE_NODE, | 85 | |
59 | EINA_MAGIC_USTRINGSHARE_NODE_STR); | 86 | if (_eina_share_ustringshare_log_dom < 0) |
87 | { | ||
88 | _eina_share_ustringshare_log_dom = eina_log_domain_register | ||
89 | ("eina_ustringshare", EINA_LOG_COLOR_DEFAULT); | ||
90 | |||
91 | if (_eina_share_ustringshare_log_dom < 0) | ||
92 | { | ||
93 | EINA_LOG_ERR("Could not register log domain: eina_ustringshare"); | ||
94 | return EINA_FALSE; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | ret = eina_share_common_init(&ustringshare_share, | ||
99 | EINA_MAGIC_USTRINGSHARE_NODE, | ||
100 | EINA_MAGIC_USTRINGSHARE_NODE_STR); | ||
101 | |||
102 | if (!ret) | ||
103 | { | ||
104 | eina_log_domain_unregister(_eina_share_ustringshare_log_dom); | ||
105 | _eina_share_ustringshare_log_dom = -1; | ||
106 | } | ||
107 | |||
108 | return ret; | ||
60 | } | 109 | } |
61 | 110 | ||
62 | /** | 111 | /** |
@@ -75,6 +124,13 @@ eina_ustringshare_shutdown(void) | |||
75 | { | 124 | { |
76 | Eina_Bool ret; | 125 | Eina_Bool ret; |
77 | ret = eina_share_common_shutdown(&ustringshare_share); | 126 | ret = eina_share_common_shutdown(&ustringshare_share); |
127 | |||
128 | if (_eina_share_ustringshare_log_dom >= 0) | ||
129 | { | ||
130 | eina_log_domain_unregister(_eina_share_ustringshare_log_dom); | ||
131 | _eina_share_ustringshare_log_dom = -1; | ||
132 | } | ||
133 | |||
78 | return ret; | 134 | return ret; |
79 | } | 135 | } |
80 | 136 | ||
@@ -88,7 +144,8 @@ eina_ustringshare_del(const Eina_Unicode *str) | |||
88 | if (!str) | 144 | if (!str) |
89 | return; | 145 | return; |
90 | 146 | ||
91 | eina_share_common_del(ustringshare_share,(const char *)str); | 147 | if (!eina_share_common_del(ustringshare_share, (const char *)str)) |
148 | CRITICAL("EEEK trying to del non-shared ustringshare \"%s\"", (const char *)str); | ||
92 | } | 149 | } |
93 | 150 | ||
94 | EAPI const Eina_Unicode * | 151 | EAPI const Eina_Unicode * |