* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. */
-#ifndef __LIBCOMMON_COMMON_H__
-#define __LIBCOMMON_COMMON_H__
+#ifndef __SYSCOMMON_COMMON_H__
+#define __SYSCOMMON_COMMON_H__
#include <stdbool.h>
*
* @return true if running on emulator, otherwise false even on operation failure
*/
-bool libsys_is_emulator(void);
+bool syscommon_is_emulator(void);
/**
* @brief Check if running on container
*
* @return true if running on container, otherwise false even on operation failure
*/
-bool libsys_is_container(void);
+bool syscommon_is_container(void);
#ifdef __cplusplus
}
#endif
-#endif /* __LIBCOMMON_COMMON_H__ */
+#endif /* __SYSCOMMON_COMMON_H__ */
*
* @return zero if cannot read else the number of matched and assigned items
*/
-int libsys_parse_cmdline_scanf(const char *format, ...);
+int syscommon_parse_cmdline_scanf(const char *format, ...);
#ifdef __cplusplus
}
* @param[in] user_data user data is passed to cb.
* @return 0 on success, negative if failed
*/
-int libsys_config_parse_by_section(const char *file_name, int cb(const struct parse_result *, void *), void *user_data);
+int syscommon_config_parse_by_section(const char *file_name, int cb(const struct parse_result *, void *), void *user_data);
#ifdef __cplusplus
}
#define FEATURE_MODEL_NAME_EMULATOR "Emulator"
#define CONTAINER_FILE_PATH "/run/systemd/container"
-bool libsys_is_emulator(void)
+bool syscommon_is_emulator(void)
{
int ret = 0;
char *model_name = NULL;
ret = system_info_get_platform_string(FEATURE_MODEL_NAME, &model_name);
if (ret < 0) {
- _E("Cannot get model name: %d, libsys_is_emulator() returns false on operation failure", ret);
+ _E("Cannot get model name: %d, syscommon_is_emulator() returns false on operation failure", ret);
return false;
}
return is_emul;
}
-bool libsys_is_container(void)
+bool syscommon_is_container(void)
{
static bool is_container = false;
static bool is_cached = false;
return 0;
}
-int libsys_parse_cmdline_scanf(const char *format, ...)
+int syscommon_parse_cmdline_scanf(const char *format, ...)
{
FILE *fp = NULL;
char *token = NULL;
free(data);
}
-int libsys_config_parse_by_section(const char *fname, int cb(const struct parse_result *, void *), void *user_data)
+int syscommon_config_parse_by_section(const char *fname, int cb(const struct parse_result *, void *), void *user_data)
{
FILE *fp = NULL;
char *line = NULL;