#ifndef _MEDIA_UTIL_USER_H_
#define _MEDIA_UTIL_USER_H_
+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
int ms_user_get_mediashared_path(uid_t uid, char **path);
#endif
+size_t ms_user_get_root_length(const char *path, uid_t uid);
char *ms_user_get_ipc_path(ms_msg_port_type_e type);
#ifdef __cplusplus
return NULL;
return g_strdup(tzplatform_mkpath(TZ_SYS_RUN, MEDIA_IPC_PATH[type]));
+}
+
+size_t ms_user_get_root_length(const char *path, uid_t uid)
+{
+ g_autofree gchar *internal = NULL;
+
+ if (!path || strlen(path) == 0)
+ return 0;
+
+ if (g_str_has_prefix(path, tzplatform_getenv(TZ_SYS_STORAGE)))
+ return strlen(tzplatform_getenv(TZ_SYS_STORAGE)) + 1;
+
+ ms_user_get_internal_root_path(uid, &internal);
+
+ return strlen(internal);
}
\ No newline at end of file