aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-10-10 15:41:35 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-10-10 15:41:35 +0200
commit689cd10444ae2e6d666ebe58f87bb8f4ddb856b5 (patch)
tree76bad1d91c448ddf5805fbdc1edea878470014f8
parente88bb56e6fb2a4df3048922d6cf8e96ba9651417 (diff)
downloadpacrunner-689cd10444ae2e6d666ebe58f87bb8f4ddb856b5.tar.gz
Use clear function names for Javascript configuration
-rw-r--r--src/manager.c7
-rw-r--r--src/mozjs.c4
-rw-r--r--src/pacrunner.h4
-rw-r--r--unit/test-mozjs.c8
4 files changed, 12 insertions, 11 deletions
diff --git a/src/manager.c b/src/manager.c
index ac30075..2493445 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -125,11 +125,12 @@ static struct proxy_config *create_config(DBusConnection *conn,
return config;
if (config->script != NULL) {
- if (__pacrunner_mozjs_set(config->interface,
- config->script) < 0)
+ if (__pacrunner_mozjs_set_script(config->interface,
+ config->script) < 0)
pacrunner_error("Failed to set PAC script");
} else if (config->url != NULL) {
- if (__pacrunner_mozjs_load(config->interface, config->url) < 0)
+ if (__pacrunner_mozjs_load_url(config->interface,
+ config->url) < 0)
pacrunner_error("Failed to load PAC");
}
diff --git a/src/mozjs.c b/src/mozjs.c
index 3e6e5eb..2cc526a 100644
--- a/src/mozjs.c
+++ b/src/mozjs.c
@@ -205,7 +205,7 @@ int __pacrunner_mozjs_set_server(const char *interface, const char *server)
return 0;
}
-int __pacrunner_mozjs_set(const char *interface, const char *script)
+int __pacrunner_mozjs_set_script(const char *interface, const char *script)
{
if (script == NULL)
return -EINVAL;
@@ -228,7 +228,7 @@ int __pacrunner_mozjs_set(const char *interface, const char *script)
return 0;
}
-int __pacrunner_mozjs_load(const char *interface, const char *url)
+int __pacrunner_mozjs_load_url(const char *interface, const char *url)
{
const char *filename;
struct stat st;
diff --git a/src/pacrunner.h b/src/pacrunner.h
index ae5612f..4e5288c 100644
--- a/src/pacrunner.h
+++ b/src/pacrunner.h
@@ -74,7 +74,7 @@ void __pacrunner_client_cleanup();
int __pacrunner_mozjs_init(void);
void __pacrunner_mozjs_cleanup(void);
int __pacrunner_mozjs_set_server(const char *interface, const char *server);
-int __pacrunner_mozjs_set(const char *interface, const char *script);
-int __pacrunner_mozjs_load(const char *interface, const char *url);
+int __pacrunner_mozjs_set_script(const char *interface, const char *script);
+int __pacrunner_mozjs_load_url(const char *interface, const char *url);
void __pacrunner_mozjs_clear(void);
const char *__pacrunner_mozjs_execute(const char *url, const char *host);
diff --git a/unit/test-mozjs.c b/unit/test-mozjs.c
index 220bd7e..aa3070c 100644
--- a/unit/test-mozjs.c
+++ b/unit/test-mozjs.c
@@ -111,7 +111,7 @@ static void test_single_execute_with_direct_pac(void)
g_assert(__pacrunner_mozjs_init() == 0);
- g_assert(__pacrunner_mozjs_set(NULL, DIRECT_PAC) == 0);
+ g_assert(__pacrunner_mozjs_set_script(NULL, DIRECT_PAC) == 0);
result = __pacrunner_mozjs_execute(EXAMPLE_URL, EXAMPLE_HOST);
g_test_message("result: %s\n", result);
@@ -128,7 +128,7 @@ static void test_multiple_execute_with_direct_pac(void)
__pacrunner_mozjs_init();
- g_assert(__pacrunner_mozjs_set(NULL, DIRECT_PAC) == 0);
+ g_assert(__pacrunner_mozjs_set_script(NULL, DIRECT_PAC) == 0);
for (i = 0; i < MULTIPLE_COUNT; i++) {
result = __pacrunner_mozjs_execute(EXAMPLE_URL, EXAMPLE_HOST);
@@ -147,7 +147,7 @@ static void test_massive_execute_with_direct_pac(void)
__pacrunner_mozjs_init();
- g_assert(__pacrunner_mozjs_set(NULL, DIRECT_PAC) == 0);
+ g_assert(__pacrunner_mozjs_set_script(NULL, DIRECT_PAC) == 0);
for (i = 0; i < MASSIVE_COUNT; i++) {
result = __pacrunner_mozjs_execute(EXAMPLE_URL, EXAMPLE_HOST);
@@ -166,7 +166,7 @@ static void test_multiple_execute_with_example_pac(void)
__pacrunner_mozjs_init();
- g_assert(__pacrunner_mozjs_set(NULL, EXAMPLE_PAC) == 0);
+ g_assert(__pacrunner_mozjs_set_script(NULL, EXAMPLE_PAC) == 0);
for (i = 0; i < MULTIPLE_COUNT; i++) {
result = __pacrunner_mozjs_execute(EXAMPLE_URL, EXAMPLE_HOST);