AM_PROG_AR
LT_INIT([disable-static])
-AC_SUBST([LIBTZPLATFORM_CONFIG_SO_VERSION], [2:0:0])
-AC_SUBST([LIBTZPLATFORM_CONFIG_VERSION], [2.0])
+AC_SUBST([LIBTZPLATFORM_CONFIG_SO_VERSION], [0:0:0])
+AC_SUBST([LIBTZPLATFORM_CONFIG_VERSION], [3.0])
AC_CONFIG_FILES([
Makefile
bin_PROGRAMS = tzplatform-get
-SRC_FROMWRAPPER_STATIC= \
- static-api.c \
- isadmin.h \
- isadmin.c
-
-SRC_FROMWRAPPER_SHARED= \
+libtzplatform_config_@LIBTZPLATFORM_CONFIG_VERSION@_la_SOURCES = \
buffer.h \
buffer.c \
foreign.h \
foreign.c \
+ global-api.c \
heap.h \
heap.c \
parser.h \
hashing.h \
init.c \
init.h \
+ isadmin.h \
+ isadmin.c \
shared-api.c \
shared-api.h \
tzplatform_config.sym \
- tzplatform_config.h
-
-SRC_FROMWRAPPER=$(SRC_FROMWRAPPER_SHARED) $(SRC_FROMWRAPPER_STATIC)
+ tzplatform_config.h \
+ $(SRC_FROMTOOL)
SRC_TOOL = \
buffer.c \
SRC_FROMTOOL= \
tzplatform_variables.h \
- signup.inc \
hash.inc
libtzplatform_config_@LIBTZPLATFORM_CONFIG_VERSION@_la_CFLAGS = -fPIC
CLEANFILES=tzplatform-tool $(SRC_FROMTOOL)
-libtzplatform_config_@LIBTZPLATFORM_CONFIG_VERSION@_la_SOURCES = \
- $(SRC_FROMWRAPPER) \
- $(SRC_FROMTOOL)
-
tzplatform-tool: $(SRC_TOOL)
$(CC) $^ -o $@
hash.inc: tizen-platform.conf tzplatform-tool
./tzplatform-tool c $< >$@
-signup.inc: tizen-platform.conf tzplatform-tool
- ./tzplatform-tool signup $< >$@
-
libtzplatform_config_@LIBTZPLATFORM_CONFIG_VERSION@_la_LDFLAGS = -version-info $(LIBTZPLATFORM_CONFIG_SO_VERSION)
libtzplatform_config_@LIBTZPLATFORM_CONFIG_VERSION@_la_LDFLAGS += -Wl,--version-script=tzplatform_config.sym
libtzplatform_config_@LIBTZPLATFORM_CONFIG_VERSION@_la_LDFLAGS += -Wl,-O3
#include "shared-api.h"
#include "isadmin.h"
-#include "signup.inc"
-
int tzplatform_getcount()
{
return _TZPLATFORM_VARIABLES_COUNT_;
const char* tzplatform_getname(enum tzplatform_variable id)
{
- return _getname_tzplatform_(id, tizen_platform_config_signup);
+ return _getname_tzplatform_(id);
}
enum tzplatform_variable tzplatform_getid(const char *name)
{
- return _getid_tzplatform_(name, tizen_platform_config_signup);
+ return _getid_tzplatform_(name);
}
const char* tzplatform_getenv(enum tzplatform_variable id)
{
- return _getenv_tzplatform_(id, tizen_platform_config_signup);
+ return _getenv_tzplatform_(id);
}
const char* tzplatform_context_getenv(struct tzplatform_context *context, enum tzplatform_variable id)
{
- return _context_getenv_tzplatform_(id, tizen_platform_config_signup, context);
+ return _context_getenv_tzplatform_(id, context);
}
int tzplatform_getenv_int(enum tzplatform_variable id)
{
- return _getenv_int_tzplatform_(id, tizen_platform_config_signup);
+ return _getenv_int_tzplatform_(id);
}
int tzplatform_context_getenv_int(struct tzplatform_context *context, enum tzplatform_variable id)
{
- return _context_getenv_int_tzplatform_(id, tizen_platform_config_signup, context);
+ return _context_getenv_int_tzplatform_(id, context);
}
const char* tzplatform_mkstr(enum tzplatform_variable id, const char * str)
{
- return _mkstr_tzplatform_(id, str, tizen_platform_config_signup);
+ return _mkstr_tzplatform_(id, str);
}
const char* tzplatform_context_mkstr(struct tzplatform_context *context, enum tzplatform_variable id, const char *str)
{
- return _context_mkstr_tzplatform_(id, str, tizen_platform_config_signup, context);
+ return _context_mkstr_tzplatform_(id, str, context);
}
const char* tzplatform_mkpath(enum tzplatform_variable id, const char * path)
{
- return _mkpath_tzplatform_(id, path, tizen_platform_config_signup);
+ return _mkpath_tzplatform_(id, path);
}
const char* tzplatform_context_mkpath(struct tzplatform_context *context, enum tzplatform_variable id, const char *path)
{
- return _context_mkpath_tzplatform_(id, path, tizen_platform_config_signup, context);
+ return _context_mkpath_tzplatform_(id, path, context);
}
const char* tzplatform_mkpath3(enum tzplatform_variable id, const char * path, const char* path2)
{
- return _mkpath3_tzplatform_(id, path, path2, tizen_platform_config_signup);
+ return _mkpath3_tzplatform_(id, path, path2);
}
const char* tzplatform_context_mkpath3(struct tzplatform_context *context, enum tzplatform_variable id, const char *path, const char *path2)
{
- return _context_mkpath3_tzplatform_(id, path, path2, tizen_platform_config_signup, context);
+ return _context_mkpath3_tzplatform_(id, path, path2, context);
}
const char* tzplatform_mkpath4(enum tzplatform_variable id, const char * path, const char* path2, const char *path3)
{
- return _mkpath4_tzplatform_(id, path, path2, path3, tizen_platform_config_signup);
+ return _mkpath4_tzplatform_(id, path, path2, path3);
}
const char* tzplatform_context_mkpath4(struct tzplatform_context *context, enum tzplatform_variable id, const char *path, const char *path2, const char *path3)
{
- return _context_mkpath4_tzplatform_(id, path, path2, path3, tizen_platform_config_signup, context);
+ return _context_mkpath4_tzplatform_(id, path, path2, path3, context);
}
uid_t tzplatform_getuid(enum tzplatform_variable id)
{
- return _getuid_tzplatform_(id, tizen_platform_config_signup);
+ return _getuid_tzplatform_(id);
}
uid_t tzplatform_context_getuid(struct tzplatform_context *context, enum tzplatform_variable id)
{
- return _context_getuid_tzplatform_(id, tizen_platform_config_signup, context);
+ return _context_getuid_tzplatform_(id, context);
}
gid_t tzplatform_getgid(enum tzplatform_variable id)
{
- return _getgid_tzplatform_(id, tizen_platform_config_signup);
+ return _getgid_tzplatform_(id);
}
gid_t tzplatform_context_getgid(struct tzplatform_context *context, enum tzplatform_variable id)
{
- return _context_getgid_tzplatform_(id, tizen_platform_config_signup, context);
+ return _context_getgid_tzplatform_(id, context);
}
-int tzplatform_has_system_group(uid_t uid)
+int tzplatform_has_system_group(uid_t uid)
{
return _has_system_group_static_(uid);
}
.user = _USER_NOT_SET_
};
-/* the signup of names */
-#include "signup.inc"
-
-/* validate the signup */
-static void validate_signup(char signup[33])
-{
- if (memcmp(signup+1, tizen_platform_config_signup+1, 32)) {
- syslog(LOG_CRIT, "Bad signup of the client of tizen-platform-config");
- abort();
- }
- signup[0] = 1;
-}
-
-/* check the signup */
-static inline void check_signup(char signup[33])
-{
- if (!signup[0])
- validate_signup(signup);
-}
+/*
+ * Tizen 4.0: signup validation is deprecated
+ * version matching will be conducted by numbering of so version
+ */
/* locks the context */
inline static void lock(struct tzplatform_context *context)
unlock( context);
}
-uid_t tzplatform_get_user(char signup[33])
+uid_t tzplatform_get_user(void)
{
return tzplatform_context_get_user( &global_context);
}
/*************** PUBLIC INTERNAL API begins here **************/
-const char* _getname_tzplatform_(int id, char signup[33])
+const char* _getname_tzplatform_(int id)
{
- check_signup(signup);
return 0 <= id && id < _TZPLATFORM_VARIABLES_COUNT_ ? keyname(id) : NULL;
}
-int _getid_tzplatform_(const char *name, char signup[33])
+int _getid_tzplatform_(const char *name)
{
- check_signup(signup);
return hashid(name, strlen(name));
}
-const char* _getenv_tzplatform_(int id, char signup[33])
+const char* _getenv_tzplatform_(int id)
{
- return _context_getenv_tzplatform_(id, signup, &global_context);
+ return _context_getenv_tzplatform_(id, &global_context);
}
-const char* _context_getenv_tzplatform_(int id, char signup[33], struct tzplatform_context *context)
+const char* _context_getenv_tzplatform_(int id, struct tzplatform_context *context)
{
const char *array[2];
const char *result;
- check_signup(signup);
result = get_lock(id, context);
if (result != NULL) {
array[0] = result;
return result;
}
-int _getenv_int_tzplatform_(int id, char signup[33])
+int _getenv_int_tzplatform_(int id)
{
- return _context_getenv_int_tzplatform_(id, signup, &global_context);
+ return _context_getenv_int_tzplatform_(id, &global_context);
}
-int _context_getenv_int_tzplatform_(int id, char signup[33], struct tzplatform_context *context)
+int _context_getenv_int_tzplatform_(int id, struct tzplatform_context *context)
{
const char *value;
int result;
- check_signup(signup);
value = get_lock(id, context);
result = value==NULL ? -1 : atoi(value);
unlock( context);
return result;
}
-const char* _mkstr_tzplatform_(int id, const char * str, char signup[33])
+const char* _mkstr_tzplatform_(int id, const char * str)
{
- return _context_mkstr_tzplatform_(id, str, signup, &global_context);
+ return _context_mkstr_tzplatform_(id, str, &global_context);
}
-const char* _context_mkstr_tzplatform_(int id, const char *str, char signup[33], struct tzplatform_context *context)
+const char* _context_mkstr_tzplatform_(int id, const char *str, struct tzplatform_context *context)
{
const char *array[3];
const char *result;
- check_signup(signup);
result = get_lock(id, context);
if (result != NULL) {
array[0] = result;
return result;
}
-const char* _mkpath_tzplatform_(int id, const char * path, char signup[33])
+const char* _mkpath_tzplatform_(int id, const char * path)
{
- return _context_mkpath_tzplatform_(id, path, signup, &global_context);
+ return _context_mkpath_tzplatform_(id, path, &global_context);
}
-const char* _context_mkpath_tzplatform_(int id, const char *path, char signup[33], struct tzplatform_context *context)
+const char* _context_mkpath_tzplatform_(int id, const char *path, struct tzplatform_context *context)
{
const char *array[3];
const char *result;
- check_signup(signup);
result = get_lock(id, context);
if (result != NULL) {
array[0] = result;
return result;
}
-const char* _mkpath3_tzplatform_(int id, const char * path, const char* path2, char signup[33])
+const char* _mkpath3_tzplatform_(int id, const char * path, const char* path2)
{
- return _context_mkpath3_tzplatform_( id, path, path2, signup, &global_context);
+ return _context_mkpath3_tzplatform_( id, path, path2, &global_context);
}
-const char* _context_mkpath3_tzplatform_(int id, const char *path, const char *path2, char signup[33], struct tzplatform_context *context)
+const char* _context_mkpath3_tzplatform_(int id, const char *path, const char *path2, struct tzplatform_context *context)
{
const char *array[4];
const char *result;
- check_signup(signup);
result = get_lock(id, context);
if (result != NULL) {
array[0] = result;
return result;
}
-const char* _mkpath4_tzplatform_(int id, const char * path, const char* path2, const char *path3, char signup[33])
+const char* _mkpath4_tzplatform_(int id, const char * path, const char* path2, const char *path3)
{
- return _context_mkpath4_tzplatform_( id, path, path2, path3, signup, &global_context);
+ return _context_mkpath4_tzplatform_( id, path, path2, path3, &global_context);
}
-const char* _context_mkpath4_tzplatform_(int id, const char *path, const char *path2, const char *path3, char signup[33], struct tzplatform_context *context)
+const char* _context_mkpath4_tzplatform_(int id, const char *path, const char *path2, const char *path3, struct tzplatform_context *context)
{
const char *array[5];
const char *result;
- check_signup(signup);
result = get_lock(id, context);
if (result != NULL) {
array[0] = result;
return result;
}
-uid_t _getuid_tzplatform_(int id, char signup[33])
+uid_t _getuid_tzplatform_(int id)
{
- return _context_getuid_tzplatform_( id, signup, &global_context);
+ return _context_getuid_tzplatform_( id, &global_context);
}
-uid_t _context_getuid_tzplatform_(int id, char signup[33], struct tzplatform_context *context)
+uid_t _context_getuid_tzplatform_(int id, struct tzplatform_context *context)
{
uid_t result;
const char *value;
- check_signup(signup);
result = (uid_t)-1;
value = get_lock(id, context);
if (value != NULL) {
return result;
}
-gid_t _getgid_tzplatform_(int id, char signup[33])
+gid_t _getgid_tzplatform_(int id)
{
- return _context_getgid_tzplatform_( id, signup, &global_context);
+ return _context_getgid_tzplatform_( id, &global_context);
}
-gid_t _context_getgid_tzplatform_(int id, char signup[33], struct tzplatform_context *context)
+gid_t _context_getgid_tzplatform_(int id, struct tzplatform_context *context)
{
gid_t result;
const char *value;
- check_signup(signup);
result = (uid_t)-1;
value = get_lock(id, context);
if (value != NULL) {
#ifndef SHARED_API_H
#define SHARED_API_H
-extern const char* _getname_tzplatform_(int id, char signup[33]);
-extern int _getid_tzplatform_(const char *name, char signup[33]);
-extern const char* _getenv_tzplatform_(int id, char signup[33]) ;
-extern const char* _context_getenv_tzplatform_(int id, char signup[33], struct tzplatform_context *context);
-extern int _getenv_int_tzplatform_(int id, char signup[33]);
-extern int _context_getenv_int_tzplatform_(int id, char signup[33], struct tzplatform_context *context);
-extern const char* _mkstr_tzplatform_(int id, const char * str, char signup[33]);
-extern const char* _context_mkstr_tzplatform_(int id, const char *str, char signup[33], struct tzplatform_context *context);
-extern const char* _mkpath_tzplatform_(int id, const char * path, char signup[33]);
-extern const char* _context_mkpath_tzplatform_(int id, const char *path, char signup[33], struct tzplatform_context *context);
-extern const char* _mkpath3_tzplatform_(int id, const char * path, const char* path2, char signup[33]);
-extern const char* _context_mkpath3_tzplatform_(int id, const char *path, const char *path2, char signup[33], struct tzplatform_context *context);
-extern const char* _mkpath4_tzplatform_(int id, const char * path, const char* path2, const char *path3, char signup[33]);
-extern const char* _context_mkpath4_tzplatform_(int id, const char *path, const char *path2, const char *path3, char signup[33], struct tzplatform_context *context);
-extern uid_t _getuid_tzplatform_(int id, char signup[33]);
-extern uid_t _context_getuid_tzplatform_(int id, char signup[33], struct tzplatform_context *context);
-extern gid_t _getgid_tzplatform_(int id, char signup[33]);
-extern gid_t _context_getgid_tzplatform_(int id, char signup[33], struct tzplatform_context *context);
+extern const char* _getname_tzplatform_(int id);
+extern int _getid_tzplatform_(const char *name);
+extern const char* _getenv_tzplatform_(int id) ;
+extern const char* _context_getenv_tzplatform_(int id, struct tzplatform_context *context);
+extern int _getenv_int_tzplatform_(int id);
+extern int _context_getenv_int_tzplatform_(int id, struct tzplatform_context *context);
+extern const char* _mkstr_tzplatform_(int id, const char * str);
+extern const char* _context_mkstr_tzplatform_(int id, const char *str, struct tzplatform_context *context);
+extern const char* _mkpath_tzplatform_(int id, const char * path);
+extern const char* _context_mkpath_tzplatform_(int id, const char *path, struct tzplatform_context *context);
+extern const char* _mkpath3_tzplatform_(int id, const char * path, const char* path2);
+extern const char* _context_mkpath3_tzplatform_(int id, const char *path, const char *path2, struct tzplatform_context *context);
+extern const char* _mkpath4_tzplatform_(int id, const char * path, const char* path2, const char *path3);
+extern const char* _context_mkpath4_tzplatform_(int id, const char *path, const char *path2, const char *path3, struct tzplatform_context *context);
+extern uid_t _getuid_tzplatform_(int id);
+extern uid_t _context_getuid_tzplatform_(int id, struct tzplatform_context *context);
+extern gid_t _getgid_tzplatform_(int id);
+extern gid_t _context_getgid_tzplatform_(int id, struct tzplatform_context *context);
#endif