--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_ABOUTDEVICE_H_
+#define __SC_ABOUTDEVICE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_ad(GenSettingMenu *menu);
+
+#endif /* __SC_ABOUTDEVICE_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_AIRPLANE_H_
+#define __SC_AIRPLANE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_am(GenSettingMenu *menu);
+
+#endif /* __SC_AIRPLANE_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_APPS_H_
+#define __SC_APPS_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_apps(GenSettingMenu *menu);
+
+#endif /* __SC_APPS_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_BATTERY_H_
+#define __SC_BATTERY_H_
+
+#include <GenSettingMenu.h>
+
+MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);
+
+#endif /* __SC_BATTERY_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_BLUETOOTH_H_
+#define __SC_BLUETOOTH_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_bt(GenSettingMenu *menu);
+
+#endif /* __SC_BLUETOOTH_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_DATEUSAGE_H_
+#define __SC_DATEUSAGE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_du(GenSettingMenu *menu);
+
+#endif /* __SC_DATEUSAGE_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_DATETIME_H_
+#define __SC_DATETIME_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_dt(GenSettingMenu *menu);
+
+#endif /* __SC_DATETIME_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_DISPLAY_H_
+#define __SC_DISPLAY_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_di(GenSettingMenu *menu);
+
+#endif /* __SC_DISPLAY_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_SOUND_H_
+#define __SC_SOUND_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_so(GenSettingMenu *menu);
+
+#endif /* __SC_SOUND_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_STORAGE_H_
+#define __SC_STORAGE_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_st(GenSettingMenu *menu);
+
+#endif /* __SC_STORAGE_H_ */
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SC_WIFI_H_
+#define __SC_WIFI_H_
+
+#include <GenSettingMenu.h>
+
+void precreate_wf(GenSettingMenu *menu);
+
+#endif /* __SC_WIFI_H_ */
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/settings)
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs_main REQUIRED
SET(BIN_NAME "setting-cmd")
ADD_EXECUTABLE(${BIN_NAME}
- ./sc_main.cpp
+ ./main.cpp
common/SettingCommand.cpp
common/SettingMenu.cpp
common/GenSettingMenu.cpp
- settings/sc_common.cpp
+ common/SCUtil.cpp
+ common/SCReportMenu.cpp
settings/sc_aboutdevice.cpp
settings/sc_sound.cpp
settings/sc_display.cpp
settings/sc_storage.cpp
settings/sc_battery.cpp
settings/sc_datausage.cpp
- report/sc_report.cpp
)
# dmalloc
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include <GenSettingMenu.h>
-#include <sc-debug.h>
+#include <SCDebug.h>
using namespace std;
-GenSettingMenu::GenSettingMenu(const char * optstr, const char * namestr, MenuGetString getstringptr, MenuFunc funcptr, MenuPreCreate precreateptr)
- :strOpt(optstr), strName(namestr), ptrGetString(getstringptr), ptrFunc(funcptr), ptrPrecreate(precreateptr)
+GenSettingMenu::GenSettingMenu(const char * optstr, const char * namestr, SCFuncValue valuefunc, SCFuncExecute executefunc, SCFuncPrecreate precreatefunc)
+ :strOpt(optstr), strName(namestr), funcValue(valuefunc), funcExecute(executefunc), funcPrecreate(precreatefunc)
{
}
bool GenSettingMenu::create()
{
eprintf("entered in GenSettingMenu::create() of %s\n", name());
- if(ptrPrecreate)
- (*ptrPrecreate)(this);
+ if(funcPrecreate)
+ (*funcPrecreate)(this);
return SettingMenu::create();
}
-MENURUN_ERROR GenSettingMenu::func(string &title, int argc, char *argv[])
+MENURUN_ERROR GenSettingMenu::execute(string &title, int argc, char *argv[])
{
- eprintf("func() of %s, %p, %p, %p\n", name(), ptrFunc, ptrPrecreate, ptrGetString);
- if (ptrFunc) {
+ eprintf("execute() of %s, %p, %p, %p\n", name(), funcExecute, funcPrecreate, funcValue);
+ if (funcExecute) {
printf("%s\n\n", title.c_str());
- return (*ptrFunc)(argc, argv, this);
+ return (*funcExecute)(argc, argv, this);
}
- else if (ptrGetString) {
+ else if (funcValue) {
printf("%s\n\n", title.c_str());
string resultstr;
- MENURUN_ERROR ret = (*ptrGetString)(resultstr, argc, argv, this);
+ MENURUN_ERROR ret = (*funcValue)(resultstr, argc, argv, this);
if (ret != MENURUN_ERR_NONE)
resultstr = "[Failed]";
printf(" %s : %s\n", name(), resultstr.c_str());
return MENURUN_ERR_NONE;
}
-MENURUN_ERROR GenSettingMenu::getstring(string &resultstr, int argc, char *argv[])
+MENURUN_ERROR GenSettingMenu::value(string &resultstr, int argc, char *argv[])
{
- eprintf("getstring() of %s, %p, %p, %p\n", name(), ptrFunc, ptrPrecreate, ptrGetString);
- if (ptrGetString) {
- return (*ptrGetString)(resultstr, argc, argv, this);
+ eprintf("value() of %s, %p, %p, %p\n", name(), funcExecute, funcPrecreate, funcValue);
+ if (funcValue) {
+ return (*funcValue)(resultstr, argc, argv, this);
}
- return SettingMenu::getstring(resultstr, argc, argv);
+ return SettingMenu::value(resultstr, argc, argv);
}
bool GenSettingMenu::isImplemented()
{
- if (ptrFunc == nullptr && ptrGetString == nullptr && subMenus.empty()) return false;
+ if (funcExecute == nullptr && funcValue == nullptr && subMenus.empty()) return false;
return true;
}
return strName;
}
-void GenSettingMenu::addSubmenu(const char * optstr, const char * namestr, MenuGetString getstringptr, MenuFunc funcptr, MenuPreCreate precreateptr)
+void GenSettingMenu::addSubmenu(const char * optstr, const char * namestr, SCFuncValue valuefunc, SCFuncExecute executefunc, SCFuncPrecreate precreatefunc)
{
- subMenus.push_back(new GenSettingMenu(optstr, namestr, getstringptr, funcptr, precreateptr));
+ subMenus.push_back(new GenSettingMenu(optstr, namestr, valuefunc, executefunc, precreatefunc));
}
void GenSettingMenu::addSubmenu(MenuItem item)
{
- addSubmenu(item.optstr, item.namestr, item.getstringptr, item.funcptr, item.precreateptr);
+ addSubmenu(item.optstr, item.namestr, item.valuefunc, item.executefunc, item.precreatefunc);
}
void GenSettingMenu::addSubmenus(MenuItem *items, int count)
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#ifndef __GENSETTINGMENU_H_
#define __GENSETTINGMENU_H_
class GenSettingMenu;
-typedef MENURUN_ERROR(*MenuGetString)(std::string &resultstr, int argc, char *argv[], GenSettingMenu *menu);
-typedef MENURUN_ERROR (*MenuFunc)(int argc, char *argv[], GenSettingMenu *menu);
-typedef void (*MenuPreCreate)(GenSettingMenu *menu);
+typedef MENURUN_ERROR (*SCFuncValue)(std::string &resultstr, int argc, char *argv[], GenSettingMenu *menu);
+typedef MENURUN_ERROR (*SCFuncExecute)(int argc, char *argv[], GenSettingMenu *menu);
+typedef void (*SCFuncPrecreate)(GenSettingMenu *menu);
typedef struct {
const char *optstr;
const char *namestr;
- MenuGetString getstringptr;
- MenuFunc funcptr;
- MenuPreCreate precreateptr;
+ SCFuncValue valuefunc;
+ SCFuncExecute executefunc;
+ SCFuncPrecreate precreatefunc;
} MenuItem;
class GenSettingMenu : public SettingMenu
{
public:
- GenSettingMenu(const char * optstr, const char * namestr, MenuGetString getstringptr = nullptr, MenuFunc funcptr = nullptr, MenuPreCreate precreateptr = nullptr);
+ GenSettingMenu(const char * optstr, const char * namestr, SCFuncValue valuefunc = nullptr, SCFuncExecute executefunc = nullptr, SCFuncPrecreate precreatefunc = nullptr);
public:
bool create();
- MENURUN_ERROR func(std::string &title, int argc, char *argv[]);
- MENURUN_ERROR getstring(std::string &resultstr, int argc, char *argv[]);
+ MENURUN_ERROR execute(std::string &title, int argc, char *argv[]);
+ MENURUN_ERROR value(std::string &resultstr, int argc, char *argv[]);
bool isImplemented();
const char *opt();
const char *name();
- void addSubmenu(const char * optstr, const char * namestr, MenuGetString getstringptr = nullptr, MenuFunc funcptr = nullptr, MenuPreCreate precreateptr = nullptr);
+ void addSubmenu(const char * optstr, const char * namestr, SCFuncValue valuefunc = nullptr, SCFuncExecute executefunc = nullptr, SCFuncPrecreate precreatefunc = nullptr);
void addSubmenu(MenuItem item);
void addSubmenus(MenuItem *items, int count);
const char * strOpt;
const char * strName;
- MenuGetString ptrGetString;
- MenuFunc ptrFunc;
- MenuPreCreate ptrPrecreate;
+ SCFuncValue funcValue;
+ SCFuncExecute funcExecute;
+ SCFuncPrecreate funcPrecreate;
};
#endif //__GENSETTINGMENU_H_
-/*
- * setting
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Contact: MyoungJune Park <mj2004.park@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef _SETTINGCMD_DEBUG_H_
-#define _SETTINGCMD_DEBUG_H_
+ /*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SCDEBUG_H_
+#define __SCDEBUG_H_
#include <glib.h>
#define eprintf(...) do {} while (0)
#endif
-#endif /* _SETTINGCMD_DEBUG_H_ */
+#endif /* __SCDEBUG_H_ */
-#include "sc_report.h"
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "SCReportMenu.h"
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
-#include <sc-debug.h>
-#include <stdio.h>
+using namespace std;
-#include <string>
-using namespace std;
+SCReportMenu::SCReportMenu()
+{
+}
+
+bool SCReportMenu::create()
+{
+
+}
+
+
+#define MAX_TEMPLATEBUFFER 30000
+static char reportTemplate[MAX_TEMPLATEBUFFER];
+
+MENURUN_ERROR SCReportMenu::execute(std::string &title, int argc, char *argv[])
+{
+ if (argc < 1) {
+ eprintf("argc : %d\n", argc);
+ printf("Please give a path of file with report template\n > setting-cmd report [ template file ]\n\n");
+ return MENURUN_ERR_NORMAL;
+ }
+
+ FILE *pfile = fopen(argv[0], "rb");
+ if (pfile == NULL) {
+ eprintf("fopen failed : %s !\n", argv[0]);
+ return MENURUN_ERR_NORMAL;
+ }
+ fseek(pfile, 0, SEEK_END);
+ int fsize = ftell(pfile);
+ fseek(pfile, 0, SEEK_SET);
+
+ eprintf("fsize : %d\n", fsize);
+
+ int numread = fread(reportTemplate, sizeof(char), fsize, pfile);
+ if (numread != fsize) {
+ eprintf("numread != fsize : %d\n", numread);
+ fclose(pfile);
+ return MENURUN_ERR_NORMAL;
+ }
+ fclose(pfile);
+
+ printf("\n\n*************** Template Start *******************\n");
+ printf(reportTemplate);
+ printf("\n*************** Template End *******************\n\n");
+
+ string reportString;
+ MENURUN_ERROR result = getReportString(reportString, reportTemplate, argc, argv);
+ if (result == MENURUN_ERR_NONE) {
+ printf("\n\n*************** Report Start *******************\n");
+ printf(reportString.c_str());
+ printf("\n*************** Report End *******************\n\n");
+ return MENURUN_ERR_NONE;
+ }
+ return MENURUN_ERR_NORMAL;
+}
-void MainMemu_Precreate(GenSettingMenu *menu);
-string getString(string& commandstr, GenSettingMenu *rootmenu, int argc, char *argv[])
+string SCReportMenu::getString(string& commandstr, SettingMenu *rootmenu, int argc, char *argv[])
{
string title("report");
SettingCommand settingcommands(title, commandstr);
string resultstr;
- MENURUN_ERROR result = rootmenu->get(resultstr, settingcommands, argc, argv);
+ MENURUN_ERROR result = rootmenu->query(resultstr, settingcommands, argc, argv);
if (result != MENURUN_ERR_NONE) {
resultstr = "[Failed]";
}
return resultstr;
}
-
-bool isSeperator(char ch)
+bool SCReportMenu::isSeperator(char ch)
{
if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\0')
return true;
return false;
}
-MENURUN_ERROR getReportString(string &reportStr, const string &templateStr, int argc, char *argv[])
+extern void MainMemu_Precreate(GenSettingMenu *menu);
+
+MENURUN_ERROR SCReportMenu::getReportString(string &reportStr, const string &templateStr, int argc, char *argv[])
{
GenSettingMenu mainMenu("setting-cmd", "Main Menu", nullptr, nullptr, MainMemu_Precreate);
}
-#define MAX_TEMPLATEBUFFER 30000
-//char reportTemplate[MAX_TEMPLATEBUFFER] = "[About Device]\r\n\r\n - Name : @ad/name\r\n - Model: @ad/mn\r\n - Tizen version: @ad/ver\n";
-char reportTemplate[MAX_TEMPLATEBUFFER];
-
-
-MENURUN_ERROR menufunc_report(int argc, char *argv[], GenSettingMenu *menu)
-{
- if (argc < 1) {
- eprintf("argc : %d\n", argc);
- printf("Please give a path of file with report template\n > setting-cmd report [ template file ]\n\n");
- return MENURUN_ERR_NORMAL;
- }
-
- FILE *pfile = fopen(argv[0],"rb");
- if (pfile == NULL) {
- eprintf("fopen failed : %s !\n", argv[0]);
- return MENURUN_ERR_NORMAL;
- }
- fseek(pfile, 0, SEEK_END);
- int fsize = ftell(pfile);
- fseek(pfile, 0, SEEK_SET);
-
- eprintf("fsize : %d\n", fsize);
- int numread = fread(reportTemplate, sizeof(char), fsize, pfile);
- if (numread != fsize) {
- eprintf("numread != fsize : %d\n", numread);
- fclose(pfile);
- return MENURUN_ERR_NORMAL;
- }
- fclose(pfile);
- printf("\n\n*************** Template Start *******************\n");
- printf(reportTemplate);
- printf("\n*************** Template End *******************\n\n");
- string reportString;
- MENURUN_ERROR result = getReportString(reportString, reportTemplate, argc, argv);
- if (result == MENURUN_ERR_NONE) {
- printf("\n\n*************** Report Start *******************\n");
- printf(reportString.c_str());
- printf("\n*************** Report End *******************\n\n");
- return MENURUN_ERR_NONE;
- }
- return MENURUN_ERR_NORMAL;
-}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SCREPORTMENU_H_
+#define __SCREPORTMENU_H_
+
+#include <SettingMenu.h>
+
+#include <string>
+
+class SCReportMenu : public SettingMenu
+{
+public:
+ SCReportMenu();
+
+public:
+ bool create();
+
+ MENURUN_ERROR execute(std::string &title, int argc, char *argv[]);
+
+ bool isImplemented() { return true; }
+ const char *opt() { return "report"; }
+ const char *name() { return "Report"; }
+
+private:
+ std::string getString(std::string& commandstr, SettingMenu *rootmenu, int argc, char *argv[]);
+ bool isSeperator(char ch);
+ MENURUN_ERROR getReportString(std::string &reportStr, const std::string &templateStr, int argc, char *argv[]);
+};
+
+#endif //__SCREPORTMENU_H_
-#include "sc_common.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <SCUtil.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <string.h>
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __SCUTIL_H_
+#define __SCUTIL_H_
+
+enum profile {
+ MOBILE_PROFILE = 1,
+ WEARABLE_PROFILE,
+ TV_PROFILE,
+ COMMON_PROFILE,
+ MAX_PROFILE
+};
+
+
+int getProfile();
+#endif /* __SCUTIL_H_ */
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include "SettingCommand.h"
-#include <sc-debug.h>
+#include <SCDebug.h>
#include <sstream>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#ifndef __SETTINGCOMMAND_H__
#define __SETTINGCOMMAND_H__
int curPos;
};
-
#endif // __SETTINGCOMMAND_H__
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include "SettingMenu.h"
-#include <sc-debug.h>
+#include <SCDebug.h>
#include <algorithm>
#include <list>
}
}
-MENURUN_ERROR SettingMenu::func(string &title, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::execute(string &title, int argc, char *argv[])
{
- eprintf("func() of %s\n", name());
+ eprintf("execute() of %s\n", name());
return MENURUN_ERR_NONE;
}
-MENURUN_ERROR SettingMenu::getstring(string &resultstr, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::value(string &resultstr, int argc, char *argv[])
{
- eprintf("getstring() of %s\n", name());
+ eprintf("value() of %s\n", name());
resultstr = string("[N/A]");
return MENURUN_ERR_NONE;
}
eprintf("run() of %s\n", name());
title += string(" - ") + name();
- MENURUN_ERROR result = func(title, argc, argv);
+ MENURUN_ERROR result = execute(title, argc, argv);
if (result != MENURUN_ERR_NONE) return result;
if (subMenus.empty()) return MENURUN_ERR_NONE;
return result;
}
-MENURUN_ERROR SettingMenu::get(string &resultstr, SettingCommand &settingcmds, int argc, char *argv[])
+MENURUN_ERROR SettingMenu::query(string &resultstr, SettingCommand &settingcmds, int argc, char *argv[])
{
- eprintf("get() of %s\n", name());
+ eprintf("query() of %s\n", name());
if (subMenus.empty()) {
- MENURUN_ERROR result = getstring(resultstr, argc, argv);
+ MENURUN_ERROR result = value(resultstr, argc, argv);
if (result != MENURUN_ERR_NONE) return result;
return MENURUN_ERR_NONE;
}
eprintf("command %s is founded.\n", curcmd.c_str());
- MENURUN_ERROR result = ((*it)->get)(resultstr, settingcmds, argc, argv);
+ MENURUN_ERROR result = ((*it)->query)(resultstr, settingcmds, argc, argv);
settingcmds.prev();
return result;
}
void SettingMenu::printUsage(SettingCommand &settingcmds)
{
const char *notimplemented_str = "[Not implemented]";
-
- printf("Usage : %s/[opt]\n", settingcmds.curCommands().c_str());
+
+ if (settingcmds.count() <= 1) {
+ printf("Usage : %s [opt]\n", settingcmds.curCommands().c_str());
+ }
+ else {
+ printf("Usage : %s/[opt]\n", settingcmds.curCommands().c_str());
+ }
printf("\t[opt] : [Functionality]\n");
for_each(subMenus.begin(), subMenus.end(),
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#ifndef __SETTINGMENU_H_
#define __SETTINGMENU_H_
virtual bool create();
virtual void destroy();
- virtual MENURUN_ERROR func(std::string &title, int argc, char *argv[]);
- virtual MENURUN_ERROR getstring(std::string &resultstr, int argc, char *argv[]);
-
virtual MENURUN_ERROR run(SettingCommand &settingcmds, std::string &title, int argc, char *argv[]);
- virtual MENURUN_ERROR get(std::string &resultstr, SettingCommand &settingcmds, int argc, char *argv[]);
+ virtual MENURUN_ERROR query(std::string &resultstr, SettingCommand &settingcmds, int argc, char *argv[]);
+
+ virtual MENURUN_ERROR execute(std::string &title, int argc, char *argv[]);
+ virtual MENURUN_ERROR value(std::string &resultstr, int argc, char *argv[]);
virtual bool isImplemented() { return false; }
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <GenSettingMenu.h>
-#include "settings/sc_common.h"
-#include "settings/sc_aboutdevice.h"
-#include "settings/sc_sound.h"
-#include "settings/sc_display.h"
-#include "settings/sc_apps.h"
-#include "settings/sc_datetime.h"
-#include "settings/sc_wifi.h"
-#include "settings/sc_bluetooth.h"
-#include "settings/sc_airplane.h"
-#include "settings/sc_storage.h"
-#include "settings/sc_datausage.h"
-#include "settings/sc_battery.h"
-#include "report/sc_report.h"
+#include <SCDebug.h>
+
+
+#include <SCUtil.h>
+
+#include <settings/sc_aboutdevice.h>
+#include <settings/sc_sound.h>
+#include <settings/sc_display.h>
+#include <settings/sc_apps.h>
+#include <settings/sc_datetime.h>
+#include <settings/sc_wifi.h>
+#include <settings/sc_bluetooth.h>
+#include <settings/sc_airplane.h>
+#include <settings/sc_storage.h>
+#include <settings/sc_datausage.h>
+#include <settings/sc_battery.h>
+
+#include <SCReportMenu.h>
#include <stdio.h>
#include <string>
-
+#include <sstream>
using namespace std;
int main(int argc, char *argv[])
{
- GenSettingMenu mainMenu("setting-cmd", "Main Menu", nullptr, nullptr, MainMemu_Precreate);
+ string execstr(argv[0]);
+ string token = execstr;
+ stringstream ss_exec(execstr);
+ while (getline(ss_exec, token, '/')) {}
+ execstr = token;
- mainMenu.addSubmenu("report", "Report", nullptr, menufunc_report);
+ string commandstr;
+ if (argc >= 2)
+ commandstr = argv[1];
+ SettingCommand settingcommands(execstr, commandstr);
+
+ GenSettingMenu mainMenu(execstr.c_str(), "Main Menu", nullptr, nullptr, MainMemu_Precreate);
+ mainMenu.subMenus.push_back(new SCReportMenu());
if (!mainMenu.create()) {
eprintf("Main Menu failed to create\n");
return 0;
}
- string execstr(argv[0]);
- string commandstr;
- if (argc >= 2)
- commandstr = argv[1];
-
- SettingCommand settingcommands(execstr, commandstr);
-
string title = "\nSeting Command\n";
-
MENURUN_ERROR result = mainMenu.run(settingcommands, title, argc - 2, &argv[2]);
if (result != MENURUN_ERR_NONE) {
SettingMenu::printError(result);
+++ /dev/null
-#ifndef __SC_REPORT_H_
-#define __SC_REPORT_H_
-
-#include <GenSettingMenu.h>
-
-MENURUN_ERROR menufunc_report(int argc, char *argv[], GenSettingMenu *menu);
-
-#endif /* __SC_REPORT_H_ */
-#include "sc_aboutdevice.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <telephony.h>
#include <bluetooth.h>
#include <wifi-manager.h>
-
#include <storage.h>
-#include <sc-debug.h>
-
using namespace std;
+++ /dev/null
-#ifndef __SC_ABOUTDEVICE_H_
-#define __SC_ABOUTDEVICE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_ad(GenSettingMenu *menu);
-
-#endif /* __SC_ABOUTDEVICE_H_ */
-#include "sc_airplane.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_AIRPLANE_H_
-#define __SC_AIRPLANE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_am(GenSettingMenu *menu);
-
-#endif /* __SC_AIRPLANE_H_ */
-#include "sc_apps.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_APPS_H_
-#define __SC_APPS_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_apps(GenSettingMenu *menu);
-
-#endif /* __SC_APPS_H_ */
-#include "sc_battery.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_BATTERY_H_
-#define __SC_BATTERY_H_
-
-#include <GenSettingMenu.h>
-
-MENURUN_ERROR menufunc_ba(int argc, char *argv[], GenSettingMenu *menu);
-
-#endif /* __SC_BATTERY_H_ */
-#include "sc_bluetooth.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_BLUETOOTH_H_
-#define __SC_BLUETOOTH_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_bt(GenSettingMenu *menu);
-
-#endif /* __SC_BLUETOOTH_H_ */
+++ /dev/null
-#ifndef __SC_COMMON_H_
-#define __SC_COMMON_H_
-
-enum profile {
- MOBILE_PROFILE = 1,
- WEARABLE_PROFILE,
- TV_PROFILE,
- COMMON_PROFILE,
- MAX_PROFILE
-};
-
-
-int getProfile();
-#endif /* __SC_COMMON_H_ */
-#include "sc_datausage.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
#include <app_preference.h>
#include <stc_internal.h>
-#include <sc-debug.h>
#define TH_POSTFIX_IDX 0
char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
- for (int i = 0; i < tel_h_list.count ; i++) {
+ for (int i = 0; i < (int)tel_h_list.count ; i++) {
ret = telephony_sim_get_state(tel_h_list.handle[i], &sim_state);
if (TELEPHONY_ERROR_NONE == ret &&
TELEPHONY_SIM_STATE_AVAILABLE == sim_state) {
char *subscriber_id[2]; /* Subscriber ID numbers of sim cards*/
- for (int i = 0; i < tel_h_list.count; i++) {
+ for (int i = 0; i < (int)tel_h_list.count; i++) {
ret = telephony_sim_get_state(tel_h_list.handle[i], &sim_state);
if (TELEPHONY_ERROR_NONE == ret &&
TELEPHONY_SIM_STATE_AVAILABLE == sim_state) {
+++ /dev/null
-#ifndef __SC_DATEUSAGE_H_
-#define __SC_DATEUSAGE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_du(GenSettingMenu *menu);
-
-#endif /* __SC_DATEUSAGE_H_ */
-#include "sc_datetime.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_DATETIME_H_
-#define __SC_DATETIME_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_dt(GenSettingMenu *menu);
-
-#endif /* __SC_DATETIME_H_ */
-#include "sc_display.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_DISPLAY_H_
-#define __SC_DISPLAY_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_di(GenSettingMenu *menu);
-
-#endif /* __SC_DISPLAY_H_ */
-#include "sc_sound.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_SOUND_H_
-#define __SC_SOUND_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_so(GenSettingMenu *menu);
-
-#endif /* __SC_SOUND_H_ */
-#include "sc_wifi.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_STORAGE_H_
-#define __SC_STORAGE_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_st(GenSettingMenu *menu);
-
-#endif /* __SC_STORAGE_H_ */
-#include "sc_wifi.h"
-#include <sc-debug.h>
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <GenSettingMenu.h>
+#include <SCDebug.h>
#include <stdio.h>
#include <stdlib.h>
+++ /dev/null
-#ifndef __SC_WIFI_H_
-#define __SC_WIFI_H_
-
-#include <GenSettingMenu.h>
-
-void precreate_wf(GenSettingMenu *menu);
-
-#endif /* __SC_WIFI_H_ */