#include <sys/types.h>
#include <tzplatform_variables.h>
-/*------------------------------ COMMON API (no context) ---------------*/
+//=================================================================================
+//======================== COMMON APIs (No context) ===============================
+//=================================================================================
/*
Return the count of variables.
extern
enum tzplatform_variable tzplatform_getid(const char *name);
-/*------------------------------ GLOBAL API (default global context) ----*/
+//=================================================================================
+//====================== GLOBAL APIs (default global context) =====================
+//=================================================================================
/*
Enforces the removal of the previously evaluated tizen platform variables.
*/
extern
const char* tzplatform_mkpath3(enum tzplatform_variable id, const char *path,
- const char *path2);
+ const char *path2);
/*
Return the string resulting of the path-concatenation of string value of the
*/
extern
const char* tzplatform_mkpath4(enum tzplatform_variable id, const char *path,
- const char *path2, const char *path3);
+ const char *path2, const char *path3);
/*
Return the uid for a given user name, stored in variable <id>
extern
gid_t tzplatform_getgid(enum tzplatform_variable id);
-/*------------------------------ CONTEXTUAL API --------------------------*/
+//=================================================================================
+//============================ UID-based APIs =====================================
+//=================================================================================
+
+/*
+ In the following APIs, a 'uid' parameter is added to the form of GLOBAL APIs.
+
+ How-to-use is the same with GLOBAL APIs, but contexts are internally created and set for each uid.
+
+ uid should be one of root(0), owner(5001), and so on.
+*/
+
+extern
+const char* tzplatform_uid_getenv(uid_t uid, enum tzplatform_variable id);
+
+extern
+const char* tzplatform_uid_mkpath(uid_t uid, enum tzplatform_variable id, const char *path);
+
+extern
+const char* tzplatform_uid_mkpath3(uid_t uid, enum tzplatform_variable id, const char *path,
+ const char *path2);
+
+extern
+const char* tzplatform_uid_mkpath4(uid_t uid, enum tzplatform_variable id, const char *path,
+ const char *path2, const char *path3);
+
+//=================================================================================
+//============================ CONTEXTUAL APIs ====================================
+//=================================================================================
struct tzplatform_context;
Can return NULL in case of internal error or when 'id' isn't defined.
*/
extern
-const char* tzplatform_context_getenv(struct tzplatform_context *context, enum tzplatform_variable id);
+const char* tzplatform_context_getenv(struct tzplatform_context *context,
+ enum tzplatform_variable id);
/*
Return the integer value of the tizen plaform variable 'id'.
*/
extern
-int tzplatform_context_getenv_int(struct tzplatform_context *context, enum tzplatform_variable id);
+int tzplatform_context_getenv_int(struct tzplatform_context *context,
+ enum tzplatform_variable id);
/*
Return the string resulting of the concatenation of string value of the
will return "/opt/home-yes"
*/
extern
-const char* tzplatform_context_mkstr(struct tzplatform_context *context, enum tzplatform_variable id, const char *str);
+const char* tzplatform_context_mkstr(struct tzplatform_context *context,
+ enum tzplatform_variable id, const char *str);
/*
Return the string resulting of the path-concatenation of string value of the
will return "/opt/home/yes"
*/
extern
-const char* tzplatform_context_mkpath(struct tzplatform_context *context, enum tzplatform_variable id, const char *path);
+const char* tzplatform_context_mkpath(struct tzplatform_context *context,
+ enum tzplatform_variable id, const char *path);
/*
Return the string resulting of the path-concatenation of string value of the
will return "/opt/home/yes/no"
*/
extern
-const char* tzplatform_context_mkpath3(struct tzplatform_context *context, enum tzplatform_variable id, const char *path,
- const char *path2);
+const char* tzplatform_context_mkpath3(struct tzplatform_context *context,
+ enum tzplatform_variable id, const char *path,
+ const char *path2);
/*
Return the string resulting of the path-concatenation of string value of the
will return "/opt/home/yes/no/maybe"
*/
extern
-const char* tzplatform_context_mkpath4(struct tzplatform_context *context, enum tzplatform_variable id, const char *path,
- const char *path2, const char *path3);
+const char* tzplatform_context_mkpath4(struct tzplatform_context *context,
+ enum tzplatform_variable id, const char *path,
+ const char *path2, const char *path3);
/*
Return the uid for a given user name, stored in variable <id>