void *user_data;
} internal_param_t;
-static const char *__appid = NULL;
-static const char *__pkgid = NULL;
-static const char *__root_path = NULL;
+static const char *__appid;
+static const char *__pkgid;
+static const char *__root_path;
API int aul_app_get_pid(const char *appid)
{
const char *__get_preinit_appid(void)
{
- const char *appid;
-
- appid = getenv("AUL_APPID");
- if (appid) {
- if (__appid == NULL)
- __appid = strdup(appid);
- unsetenv("AUL_APPID");
- }
+ if (!__appid)
+ __appid = getenv("AUL_APPID");
return __appid;
}
const char *__get_preinit_pkgid(void)
{
- const char *pkgid;
-
- pkgid = getenv("AUL_PKGID");
- if (pkgid) {
- if (__pkgid == NULL)
- __pkgid = strdup(pkgid);
- unsetenv("AUL_PKGID");
- }
+ if (!__pkgid)
+ __pkgid = getenv("AUL_PKGID");
return __pkgid;
}
API const char *aul_get_preinit_root_path(void)
{
- const char *root_path;
-
- root_path = getenv("AUL_ROOT_PATH");
- if (root_path) {
- if (__root_path == NULL)
- __root_path = strdup(root_path);
- unsetenv("AUL_ROOT_PATH");
- }
+ if (!__root_path)
+ __root_path = getenv("AUL_ROOT_PATH");
return __root_path;
}