From 62ae30f483973aa4966ca89e544ed0d700f63909 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Thu, 14 Aug 2003 20:24:39 +0000 Subject: [PATCH] writemaphtml_url -> html_url (generic). --- apps/silcmap/silcmap.c | 2 +- apps/silcmap/silcmap.conf | 5 ++++- apps/silcmap/silcmap.h | 2 +- apps/silcmap/silcmap_command.c | 6 +++--- apps/silcmap/silcmap_html.c | 9 +++++---- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/silcmap/silcmap.c b/apps/silcmap/silcmap.c index b3506e3d..3a8f52d0 100644 --- a/apps/silcmap/silcmap.c +++ b/apps/silcmap/silcmap.c @@ -116,7 +116,7 @@ void silc_map_free(SilcMap map) silc_free(mapconn->city); silc_free(mapconn->admin); silc_free(mapconn->description); - silc_free(mapconn->writemaphtml_url); + silc_free(mapconn->html_url); silc_free(mapconn->up_color); silc_free(mapconn->up_text_color); silc_free(mapconn->down_color); diff --git a/apps/silcmap/silcmap.conf b/apps/silcmap/silcmap.conf index 9c878b7f..a9155717 100644 --- a/apps/silcmap/silcmap.conf +++ b/apps/silcmap/silcmap.conf @@ -20,7 +20,7 @@ # Example : writemaphtml { filename = "htmlmap.map"; image = "map.jpg"; }; # Description : Write the gathered information as as HTML map page. This # allows the user to click the specified points of URLs. -# The writemaphtml_url parameter in server will specify the +# The html_url parameter in server will specify the # URL that will be used in the HTML map. If omitted the # filename created by writehml command is used. The # and are specified if the is a portion of @@ -107,6 +107,9 @@ server { connect = false; connect_timeout = "30"; + # URL used in writemaphtml and writehtml, instead of hostname + #html_url = ""; + # Statistics to fetch starttime = true; uptime = true; diff --git a/apps/silcmap/silcmap.h b/apps/silcmap/silcmap.h index e0996ddf..61259ffb 100644 --- a/apps/silcmap/silcmap.h +++ b/apps/silcmap/silcmap.h @@ -99,7 +99,7 @@ typedef struct { char *admin; char *description; int connect_timeout; - char *writemaphtml_url; + char *html_url; /* Flags */ unsigned int connect : 1; diff --git a/apps/silcmap/silcmap_command.c b/apps/silcmap/silcmap_command.c index 39242bae..72f1fcbb 100644 --- a/apps/silcmap/silcmap_command.c +++ b/apps/silcmap/silcmap_command.c @@ -118,7 +118,7 @@ static const SilcConfigTable silc_map_table_server[] = { "city", SILC_CONFIG_ARG_STR, silc_map_cmd_server, NULL }, { "admin", SILC_CONFIG_ARG_STR, silc_map_cmd_server, NULL }, { "description", SILC_CONFIG_ARG_STRE, silc_map_cmd_server, NULL }, - { "writemaphtml_url", SILC_CONFIG_ARG_STRE, silc_map_cmd_server, NULL }, + { "html_url", SILC_CONFIG_ARG_STRE, silc_map_cmd_server, NULL }, /* Connect params */ { "connect", SILC_CONFIG_ARG_TOGGLE, silc_map_cmd_server, NULL }, @@ -280,8 +280,8 @@ SILC_CONFIG_CALLBACK(silc_map_cmd_server) curr_conn->admin = strdup((char *)val); } else if (!strcmp(name, "description")) { curr_conn->description = strdup((char *)val); - } else if (!strcmp(name, "writemaphtml_url")) { - curr_conn->writemaphtml_url = strdup((char *)val); + } else if (!strcmp(name, "html_url")) { + curr_conn->html_url = strdup((char *)val); } else if (!strcmp(name, "connect")) { curr_conn->connect = (bool)*(int *)val; } else if (!strcmp(name, "connect_timeout")) { diff --git a/apps/silcmap/silcmap_html.c b/apps/silcmap/silcmap_html.c index e7ac8042..27e279c5 100644 --- a/apps/silcmap/silcmap_html.c +++ b/apps/silcmap/silcmap_html.c @@ -335,7 +335,8 @@ bool silc_map_writehtml_index(SilcMap map) " %d\n" " %s\n" " %s\n" - "\n", class, hostname, mapconn->port, + "\n", class, + mapconn->html_url ? mapconn->html_url : hostname, mapconn->port, hostname, class, ip, class, mapconn->port, class, mapconn->country, class, mapconn->admin); } @@ -380,9 +381,9 @@ bool silc_map_writemaphtml(SilcMap map) silc_dlist_start(map->conns); while ((mapconn = silc_dlist_get(map->conns)) != SILC_LIST_END) { - if (mapconn->writemaphtml_url && mapconn->writemaphtml_url[0]) { - silc_strncat(url, sizeof(url), mapconn->writemaphtml_url, - strlen(mapconn->writemaphtml_url)); + if (mapconn->html_url && mapconn->html_url[0]) { + silc_strncat(url, sizeof(url), mapconn->html_url, + strlen(mapconn->html_url)); } else { silc_dlist_start(mapconn->hostnames); hostname = silc_dlist_get(mapconn->hostnames); -- 2.24.0