4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
\r
8 * Jaewon Lim <jaewon81.lim@samsung.com>
\r
9 * Woojin Jung <woojin2.jung@samsung.com>
\r
10 * Juyoung Kim <j0.kim@samsung.com>
\r
12 * This library is free software; you can redistribute it and/or modify it under
\r
13 * the terms of the GNU Lesser General Public License as published by the
\r
14 * Free Software Foundation; either version 2.1 of the License, or (at your option)
\r
15 * any later version.
\r
17 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
\r
18 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
\r
20 * License for more details.
\r
22 * You should have received a copy of the GNU Lesser General Public License
\r
23 * along with this library; if not, write to the Free Software Foundation, Inc., 51
\r
24 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
\r
31 #include <wchar.h> // for wcslen
\r
32 #include <unistd.h> // for unlink
\r
33 #include <sys/types.h>
\r
34 #include <dirent.h> // for opendir, readdir
\r
36 #include "dahelper.h"
\r
38 char *lib_string[NUM_ORIGINAL_LIBRARY] = {"libc.so.6", "libpthread.so.0",
\r
39 "libelementary.so", "libosp-uifw.so", "libosp-appfw.so", "libosp-web.so",
\r
40 "libecore_input_evas.so.1", "libdaemon.so.0", "libcapi-appfw-application.so.0"};
\r
41 void *lib_handle[NUM_ORIGINAL_LIBRARY];
\r
43 /* trace info global variable */
\r
44 __traceInfo gTraceInfo =
\r
47 1, // int eventIndex
\r
48 PTHREAD_MUTEX_INITIALIZER // pthread_mutex_t eventMutex
\r
51 -1, // int daemonSock
\r
52 PTHREAD_MUTEX_INITIALIZER // ptrhread_mutex_t sockMutex
\r
55 {0, }, // char appName[128]
\r
56 0 // unsigned int startTime
\r
60 PTHREAD_MUTEX_INITIALIZER // ptrhread_mutex_t ssMutex
\r
61 }, // __screenshotInfo
\r
66 -1, // int stateTouch
\r
67 0, // int init_complete
\r
68 0, // int custom_chart_callback_count
\r
69 0 // unsigned long optionflag
\r
72 void WcharToChar(char* pstrDest, const wchar_t* pwstrSrc)
\r
74 int nLen=(int)wcslen(pwstrSrc);
\r
75 wcstombs(pstrDest, pwstrSrc, nLen+1);
\r
78 // return 0 if succeed
\r
79 // return -1 if error occured
\r
80 int remove_indir(const char *dirname)
\r
83 struct dirent *entry;
\r
84 char path[MAX_PATH_LENGTH];
\r
86 dir = opendir(dirname);
\r
92 while((entry = readdir(dir)) != NULL)
\r
94 if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, ".."))
\r
96 snprintf(path, (size_t) MAX_PATH_LENGTH, "%s/%s", dirname, entry->d_name);
\r
97 if (entry->d_type != DT_DIR) // file
\r
101 else { } // directory
\r