diff options
author | Patrick Steinhardt <ps@pks.im> | 2022-12-21 15:18:25 +0100 |
---|---|---|
committer | Rafael Marçalo <raroma09@gmail.com> | 2023-01-03 15:08:55 +0000 |
commit | de6a197bf500e9e329e21e7209cc8764ec4456e5 (patch) | |
tree | 25cc6a9c1d6882348bc3aa7c287b9cd98f8dd2e1 | |
parent | e3d87e8e0c703369226947a91ce0cd1fe1ef26d1 (diff) |
js.c: Remove unused function
Remove the unused code contained in "js.c" and its header file. The
functionality has been replaced by utility functions in "util.c".
-rw-r--r-- | src/js.c | 52 | ||||
-rw-r--r-- | src/js.h | 27 | ||||
-rw-r--r-- | src/main.c | 1 |
3 files changed, 0 insertions, 80 deletions
diff --git a/src/js.c b/src/js.c deleted file mode 100644 index 4251f03..0000000 --- a/src/js.c +++ /dev/null @@ -1,52 +0,0 @@ -/** - * vimb - a webkit based vim like browser. - * - * Copyright (C) 2012-2018 Daniel Carl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - */ - -#include <JavaScriptCore/JavaScript.h> -#include <glib.h> -#include <webkit2/webkit2.h> - -#include "js.h" -#include "config.h" - -/** - * Returns a new allocates string for given value javascript result. - * String must be freed if not used anymore. - */ -char *js_result_as_string(WebKitJavascriptResult *res) -{ - JSGlobalContextRef cr; - JSStringRef jsstring; - JSValueRef jsvalue; - gsize max; - - g_return_val_if_fail(res != NULL, NULL); - - jsvalue = webkit_javascript_result_get_value(res); - cr = webkit_javascript_result_get_global_context(res); - jsstring = JSValueToStringCopy(cr, jsvalue, NULL); - max = JSStringGetMaximumUTF8CStringSize(jsstring); - if (max > 0) { - char *string = g_new(char, max); - JSStringGetUTF8CString(jsstring, string, max); - - return string; - } - return NULL; -} - diff --git a/src/js.h b/src/js.h deleted file mode 100644 index 419b9c5..0000000 --- a/src/js.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * vimb - a webkit based vim like browser. - * - * Copyright (C) 2012-2018 Daniel Carl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - */ - -#ifndef _JS_H -#define _JS_H - -#include <webkit2/webkit2.h> - -char *js_result_as_string(WebKitJavascriptResult *res); - -#endif @@ -39,7 +39,6 @@ #include "ext-proxy.h" #include "handler.h" #include "input.h" -#include "js.h" #include "main.h" #include "map.h" #include "normal.h" |