writemaphtml_url -> html_url (generic).
authorPekka Riikonen <priikone@silcnet.org>
Thu, 14 Aug 2003 20:24:39 +0000 (20:24 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 14 Aug 2003 20:24:39 +0000 (20:24 +0000)
apps/silcmap/silcmap.c
apps/silcmap/silcmap.conf
apps/silcmap/silcmap.h
apps/silcmap/silcmap_command.c
apps/silcmap/silcmap_html.c

index b3506e3d87996aa9b2d19b22c11350adb3d16f85..3a8f52d089cd4dbca554d8e435e12f2eea20f7d8 100644 (file)
@@ -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);
index 9c878b7f116bef6b8b07472e401627378c5d192a..a91557175dced065f9c8b4c79048aba4e2adc307 100644 (file)
@@ -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 <cut_lat>
 #               and <cut_lon> are specified if the <image> 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;
index e0996ddf05515d7625c2de1b364e608ce0de1a48..61259ffb0f450488385af5e87e8545ea8bfb3e0d 100644 (file)
@@ -99,7 +99,7 @@ typedef struct {
   char *admin;
   char *description;
   int connect_timeout;
-  char *writemaphtml_url;
+  char *html_url;
 
   /* Flags */
   unsigned int connect        : 1;
index 39242bae6b2d2514988b8493e213e7d35a9b8ad9..72f1fcbbcf9d2c2ade3653598140657f95d0d60a 100644 (file)
@@ -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")) {
index e7ac8042bf2fef89e0e5d70817b3d140f1738151..27e279c539d78a607fe5e2611d2cce61a51106db 100644 (file)
@@ -335,7 +335,8 @@ bool silc_map_writehtml_index(SilcMap map)
            "<td align = \"center\" class=\"%s\">&nbsp;%d</td>\n"
            "<td align = \"center\" class=\"%s\">&nbsp;%s</td>\n"
            "<td align = \"center\" class=\"%s\">&nbsp;%s</td>\n"
-           "</tr>\n", class, hostname, mapconn->port,
+           "</tr>\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);