#include "eina_private.h"
/* The actual share */
-static Eina_Share *share;
+static Eina_Share *binshare_share;
static const char EINA_MAGIC_BINSHARE_NODE_STR[] = "Eina Binshare Node";
/*============================================================================*
EAPI Eina_Bool
eina_binshare_init(void)
{
- return eina_share_common_init(&share, EINA_MAGIC_BINSHARE_NODE, EINA_MAGIC_BINSHARE_NODE_STR);
+ return eina_share_common_init(&binshare_share, EINA_MAGIC_BINSHARE_NODE, EINA_MAGIC_BINSHARE_NODE_STR);
}
/**
eina_binshare_shutdown(void)
{
Eina_Bool ret;
- ret = eina_share_common_shutdown(&share);
+ ret = eina_share_common_shutdown(&binshare_share);
return ret;
}
{
if (!str)
return;
- eina_share_common_del(share,(const char *) str);
+ eina_share_common_del(binshare_share,(const char *) str);
}
/**
EAPI const char *
eina_binshare_add_length(const char *str, unsigned int slen)
{
- return (const char *) eina_share_common_add_length(share,(const char *) str, (slen) * sizeof(char), 0);
+ return (const char *) eina_share_common_add_length(binshare_share,(const char *) str, (slen) * sizeof(char), 0);
}
/**
EAPI const char *
eina_binshare_ref(const char *str)
{
- if (!str)
- {
- return (const char *) eina_share_common_ref(share, (const char *) str);
- }
- return (const char *) eina_share_common_ref(share, (const char *) str);
+ return (const char *) eina_share_common_ref(binshare_share, (const char *) str);
}
/**
EAPI int
eina_binshare_length(const char *str)
{
- return eina_share_common_length(share, (const char *) str);
+ return eina_share_common_length(binshare_share, (const char *) str);
}
/**
EAPI void
eina_binshare_dump(void)
{
- eina_share_common_dump(share, NULL, 0);
+ eina_share_common_dump(binshare_share, NULL, 0);
}
/**
*/
/**
- * @page tutorial_ustringshare_page UStringshare Tutorial
+ * @page tutorial_stringshare_page Stringshare Tutorial
*
* to be written...
*
#include "eina_share_common.h"
/* The actual share */
-static Eina_Share *share;
+static Eina_Share *stringshare_share;
static const char EINA_MAGIC_STRINGSHARE_NODE_STR[] = "Eina Stringshare Node";
#ifdef EFL_HAVE_THREADS
eina_stringshare_init(void)
{
Eina_Bool ret;
- ret = eina_share_common_init(&share, EINA_MAGIC_STRINGSHARE_NODE, EINA_MAGIC_STRINGSHARE_NODE_STR);
+ ret = eina_share_common_init(&stringshare_share, EINA_MAGIC_STRINGSHARE_NODE, EINA_MAGIC_STRINGSHARE_NODE_STR);
if (ret)
{
_eina_stringshare_small_init();
{
Eina_Bool ret;
_eina_stringshare_small_shutdown();
- ret = eina_share_common_shutdown(&share);
+ ret = eina_share_common_shutdown(&stringshare_share);
return ret;
}
return;
else if (slen < 4)
{
- eina_share_common_population_del(share, slen);
+ eina_share_common_population_del(stringshare_share, slen);
STRINGSHARE_LOCK_SMALL();
_eina_stringshare_small_del(str, slen);
STRINGSHARE_UNLOCK_SMALL();
return;
}
- eina_share_common_del(share, str);
+ eina_share_common_del(stringshare_share, str);
}
/**
STRINGSHARE_UNLOCK_SMALL();
return s;
}
- return eina_share_common_add_length(share, str, slen * sizeof(char), sizeof(char));
+ return eina_share_common_add_length(stringshare_share, str, slen * sizeof(char), sizeof(char));
}
/**
if (!str)
{
- return eina_share_common_ref(share, str);
+ return eina_share_common_ref(stringshare_share, str);
}
/* special cases */
if (slen < 2)
{
- eina_share_common_population_add(share, slen);
+ eina_share_common_population_add(stringshare_share, slen);
return str;
}
else if (slen < 4)
{
const char *s;
- eina_share_common_population_add(share, slen);
+ eina_share_common_population_add(stringshare_share, slen);
STRINGSHARE_LOCK_SMALL();
s = _eina_stringshare_small_add(str, slen);
return s;
}
- return eina_share_common_ref(share, str);
+ return eina_share_common_ref(stringshare_share, str);
}
/**
if (str[2] == '\0') return 2;
if (str[3] == '\0') return 3;
- len = eina_share_common_length(share, (const char *) str);
+ len = eina_share_common_length(stringshare_share, (const char *) str);
len = (len > 0) ? len / (int) sizeof(char) : -1;
return len;
}
EAPI void
eina_stringshare_dump(void)
{
- eina_share_common_dump(share, _eina_stringshare_small_dump, sizeof(_eina_stringshare_single));
+ eina_share_common_dump(stringshare_share, _eina_stringshare_small_dump, sizeof(_eina_stringshare_single));
}
/**
#include "eina_private.h"
/* The actual share */
-static Eina_Share *share;
+static Eina_Share *ustringshare_share;
static const char EINA_MAGIC_USTRINGSHARE_NODE_STR[] = "Eina UStringshare Node";
/*============================================================================*
Eina_Bool
eina_ustringshare_init(void)
{
- return eina_share_common_init(&share, EINA_MAGIC_USTRINGSHARE_NODE, EINA_MAGIC_USTRINGSHARE_NODE_STR);
+ return eina_share_common_init(&ustringshare_share, EINA_MAGIC_USTRINGSHARE_NODE, EINA_MAGIC_USTRINGSHARE_NODE_STR);
}
/**
eina_ustringshare_shutdown(void)
{
Eina_Bool ret;
- ret = eina_share_common_shutdown(&share);
+ ret = eina_share_common_shutdown(&ustringshare_share);
return ret;
}
{
if (!str)
return;
- eina_share_common_del(share,(const char *) str);
+ eina_share_common_del(ustringshare_share,(const char *) str);
}
/**
EAPI const Eina_Unicode *
eina_ustringshare_add_length(const Eina_Unicode *str, unsigned int slen)
{
- return (const Eina_Unicode *) eina_share_common_add_length(share,(const char *) str, slen * sizeof(Eina_Unicode), sizeof(Eina_Unicode));
+ return (const Eina_Unicode *) eina_share_common_add_length(ustringshare_share,(const char *) str, slen * sizeof(Eina_Unicode), sizeof(Eina_Unicode));
}
/**
EAPI const Eina_Unicode *
eina_ustringshare_ref(const Eina_Unicode *str)
{
- if (!str)
- {
- return (Eina_Unicode *) eina_share_common_ref(share, (const char *) str);
- }
- return (const Eina_Unicode *) eina_share_common_ref(share, (const char *) str);
+ return (const Eina_Unicode *) eina_share_common_ref(ustringshare_share, (const char *) str);
}
/**
EAPI int
eina_ustringshare_strlen(const Eina_Unicode *str)
{
- int len = eina_share_common_length(share, (const char *) str);
+ int len = eina_share_common_length(ustringshare_share, (const char *) str);
len = (len > 0) ? len / (int) sizeof(Eina_Unicode) : -1;
return len;
}
EAPI void
eina_ustringshare_dump(void)
{
- eina_share_common_dump(share, NULL, 0);
+ eina_share_common_dump(ustringshare_share, NULL, 0);
}
/**