error_handler: removed deprecated functions
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 6 Aug 2015 04:22:42 +0000 (13:22 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 6 Aug 2015 04:22:42 +0000 (13:22 +0900)
Change-Id: I7c4889f6d81c944589fc34f29bed278501358bc2
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
tizen/src/util/error_handler.c
tizen/src/util/error_handler.h

index 87f36f7c2b37f768c86010af43c4b5d137682f13..161da33b0e25ea3ffdce1731c3a49c7e75c3b632 100644 (file)
 #include "error_handler.h"
 #include "emulator_common.h"
 #include "emulator.h"
+#include "skin/maruskin_client.h"
 
 #include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(qemu, backtrace);
 
-// deprecated
-/* This table must match the enum definition */
-static char _maru_string_table[][JAVA_MAX_COMMAND_LENGTH] = {
-    /* 0 */ "",
-    /* 1 */ FAILED_TO_ALLOCATE_MEMORY,
-    /* 2 */ FAILED_TO_LOAD_KERNEL CHECK_FILE_VALID,
-    /* 3 */ FAILED_TO_LOAD_BIOS CHECK_FILE_VALID,
-    /* 4 */ FAILED_TO_INITIALIZE_SKIN,
-    /* 5 */ EMULATOR_HAS_STOPPED,
-    /* add here.. */
-    ""
-};
-
-static int maru_exit_status = MARU_EXIT_NORMAL;
-static char *maru_exit_msg;
-
 #ifdef CONFIG_WIN32
 static LPTOP_LEVEL_EXCEPTION_FILTER prevExceptionFilter;
 #endif
@@ -75,70 +60,6 @@ static pthread_spinlock_t siglock;
 void maru_sighandler(int sig);
 #endif
 
-// deprecated
-char *get_canonical_path(char const *const path)
-{
-    if ((int)g_path_is_absolute(path)) {
-        return (char *)g_strdup(path);
-    }
-
-    char *canonical_path;
-
-#ifndef _WIN32
-    char *current_dir = g_get_current_dir();
-    canonical_path = g_strdup_printf("%s/%s", current_dir, path);
-    g_free(current_dir);
-#else
-    canonical_path = g_malloc(MAX_PATH);
-    GetFullPathName(path, MAX_PATH, canonical_path, NULL);
-#endif
-
-    return canonical_path;
-}
-
-// deprecated
-// Use error_report() instead
-void register_exit_message(int status, char const *format, ...)
-{
-    va_list args;
-
-    if (status >= MARU_EXIT_NORMAL) {
-        fprintf(stderr, "Invalid error message index = %d\n",
-            status);
-        return;
-    }
-    if (maru_exit_status != MARU_EXIT_NORMAL) {
-        fprintf(stderr, "The error message is already registered = %d\n",
-            maru_exit_status);
-        return;
-    }
-
-    maru_exit_status = status;
-
-    if (maru_exit_status == MARU_EXIT_HB_TIME_EXPIRED) {
-        fprintf(stderr, "Skin client could not connect to Skin server."
-                " The time of internal heartbeat has expired.\n");
-    }
-
-    if (!format) {
-        format = "";
-    }
-
-    va_start(args, format);
-    char *additional = g_strdup_vprintf(format, args);
-    va_end(args);
-    maru_exit_msg = g_strdup_printf("%s%s", _maru_string_table[maru_exit_status],
-                        additional);
-    g_free(additional);
-
-    if (strlen(maru_exit_msg) >= JAVA_MAX_COMMAND_LENGTH) {
-        maru_exit_msg[JAVA_MAX_COMMAND_LENGTH - 1] = '\0';
-    }
-
-    fprintf(stdout, "The error message is registered = %d : %s\n",
-        maru_exit_status, maru_exit_msg);
-}
-
 /* Print 'backtrace' */
 #ifdef _WIN32
 struct frame_layout {
@@ -254,13 +175,6 @@ static void dump_backtrace(void *ptr, int depth)
 
 static void handle_error_at_exit(void)
 {
-
-    // deprecated
-    if (maru_exit_status != MARU_EXIT_NORMAL || maru_exit_msg) {
-        start_simple_client(maru_exit_msg);
-    }
-    g_free(maru_exit_msg);
-
     // dump backtrace log no matter what
     INFO("Stack backtrace for tracing...\n");
     INFO("This is not an error.\n");
index 7081672d1a97996bfdce123a2484fc7860f78a32..f45b05f320ccfae867e86e578f0b71c337c45021 100644 (file)
 #ifndef __ERROR_HANDLER_H__
 #define __ERROR_HANDLER_H__
 
-#include "tizen/src/skin/maruskin_client.h"
-
-// deprecated
-/* TODO: define macro for fair of definition */
-/* This enum must match the table definition */
-enum {
-    /* 0 */ MARU_EXIT_UNKNOWN = 0,
-    /* 1 */ MARU_EXIT_MEMORY_EXCEPTION,
-    /* 2 */ MARU_EXIT_KERNEL_FILE_EXCEPTION,
-    /* 3 */ MARU_EXIT_BIOS_FILE_EXCEPTION,
-    /* 4 */ MARU_EXIT_SKIN_SERVER_FAILED,
-    /* 5 */ MARU_EXIT_HB_TIME_EXPIRED,
-    /* add here.. */
-    MARU_EXIT_NORMAL
-};
-
 void init_error_handler(void);
-// deprecated
-void register_exit_message(int status, char const *format, ...);
-// deprecated
-char *get_canonical_path(char const *const path);
 
 #endif /* __ERROR_HANDLER_H__ */