forked from enlightenment/efl
efl/eina_prefix: use eina_safety to be loud on NULL pointers.
SVN revision: 82466
This commit is contained in:
parent
2f49e495ee
commit
ba461e9467
|
@ -466,6 +466,12 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
argv0, symbol, magicsharefile, envprefix);
|
argv0, symbol, magicsharefile, envprefix);
|
||||||
DBG("EINA PREFIX: share=%s, bin=%s, lib=%s, data=%s, locale=%s",
|
DBG("EINA PREFIX: share=%s, bin=%s, lib=%s, data=%s, locale=%s",
|
||||||
sharedir, pkg_bin, pkg_lib, pkg_data, pkg_locale);
|
sharedir, pkg_bin, pkg_lib, pkg_data, pkg_locale);
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pkg_bin, NULL);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pkg_lib, NULL);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pkg_data, NULL);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pkg_locale, NULL);
|
||||||
|
|
||||||
pfx = calloc(1, sizeof(Eina_Prefix));
|
pfx = calloc(1, sizeof(Eina_Prefix));
|
||||||
if (!pfx) return NULL;
|
if (!pfx) return NULL;
|
||||||
|
|
||||||
|
@ -752,7 +758,7 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_prefix_free(Eina_Prefix *pfx)
|
eina_prefix_free(Eina_Prefix *pfx)
|
||||||
{
|
{
|
||||||
if (!pfx) return;
|
EINA_SAFETY_ON_NULL_RETURN(pfx);
|
||||||
|
|
||||||
IF_FREE_NULL(pfx->exe_path);
|
IF_FREE_NULL(pfx->exe_path);
|
||||||
IF_FREE_NULL(pfx->prefix_path);
|
IF_FREE_NULL(pfx->prefix_path);
|
||||||
|
@ -766,35 +772,35 @@ eina_prefix_free(Eina_Prefix *pfx)
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_get(Eina_Prefix *pfx)
|
eina_prefix_get(Eina_Prefix *pfx)
|
||||||
{
|
{
|
||||||
if (!pfx) return "";
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pfx, "");
|
||||||
return pfx->prefix_path;
|
return pfx->prefix_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_bin_get(Eina_Prefix *pfx)
|
eina_prefix_bin_get(Eina_Prefix *pfx)
|
||||||
{
|
{
|
||||||
if (!pfx) return "";
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pfx, "");
|
||||||
return pfx->prefix_path_bin;
|
return pfx->prefix_path_bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_lib_get(Eina_Prefix *pfx)
|
eina_prefix_lib_get(Eina_Prefix *pfx)
|
||||||
{
|
{
|
||||||
if (!pfx) return "";
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pfx, "");
|
||||||
return pfx->prefix_path_lib;
|
return pfx->prefix_path_lib;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_data_get(Eina_Prefix *pfx)
|
eina_prefix_data_get(Eina_Prefix *pfx)
|
||||||
{
|
{
|
||||||
if (!pfx) return "";
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pfx, "");
|
||||||
return pfx->prefix_path_data;
|
return pfx->prefix_path_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_locale_get(Eina_Prefix *pfx)
|
eina_prefix_locale_get(Eina_Prefix *pfx)
|
||||||
{
|
{
|
||||||
if (!pfx) return "";
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pfx, "");
|
||||||
return pfx->prefix_path_locale;
|
return pfx->prefix_path_locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ EAPI Eina_Prefix *
|
||||||
eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
const char *sharedir, const char *magicsharefile,
|
const char *sharedir, const char *magicsharefile,
|
||||||
const char *pkg_bin, const char *pkg_lib,
|
const char *pkg_bin, const char *pkg_lib,
|
||||||
const char *pkg_data, const char *pkg_locale);
|
const char *pkg_data, const char *pkg_locale) EINA_ARG_NONNULL(6, 7, 8, 9) EINA_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Free the prefix object and all its contents
|
* @brief Free the prefix object and all its contents
|
||||||
|
@ -164,7 +164,7 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI void
|
EAPI void
|
||||||
eina_prefix_free(Eina_Prefix *pfx);
|
eina_prefix_free(Eina_Prefix *pfx) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the prefix base directory
|
* @brief Get the prefix base directory
|
||||||
|
@ -176,7 +176,7 @@ eina_prefix_free(Eina_Prefix *pfx);
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_get(Eina_Prefix *pfx);
|
eina_prefix_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the binary installation directory
|
* @brief Get the binary installation directory
|
||||||
|
@ -188,7 +188,7 @@ eina_prefix_get(Eina_Prefix *pfx);
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_bin_get(Eina_Prefix *pfx);
|
eina_prefix_bin_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the library installation directory
|
* @brief Get the library installation directory
|
||||||
|
@ -200,7 +200,7 @@ eina_prefix_bin_get(Eina_Prefix *pfx);
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_lib_get(Eina_Prefix *pfx);
|
eina_prefix_lib_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the data installation directory
|
* @brief Get the data installation directory
|
||||||
|
@ -212,7 +212,7 @@ eina_prefix_lib_get(Eina_Prefix *pfx);
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_data_get(Eina_Prefix *pfx);
|
eina_prefix_data_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the locale installation directory
|
* @brief Get the locale installation directory
|
||||||
|
@ -224,7 +224,7 @@ eina_prefix_data_get(Eina_Prefix *pfx);
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
eina_prefix_locale_get(Eina_Prefix *pfx);
|
eina_prefix_locale_get(Eina_Prefix *pfx) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_PURE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
|
Loading…
Reference in New Issue