]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix 'arbtext' wierdnesses
authorwessels <>
Wed, 5 Nov 1997 06:21:12 +0000 (06:21 +0000)
committerwessels <>
Wed, 5 Nov 1997 06:21:12 +0000 (06:21 +0000)
src/cf.data.pre
src/cf_gen.cc

index b101c0968a480882d4e1917ebe3586517af5c6ce..fd1e2d59d04f08657442193f27d0ebff020c00bf 100644 (file)
@@ -1,27 +1,18 @@
-#
-# If you use the NAME arbtext AND the LOC arbtext, you can use teh
-# DOC_START function to insert text into the generated squid.conf file
-# for headings and the like - oskar
-#
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
-        WELCOME TO SQUID 1.2
-        --------------------
+COMMENT_START
+       WELCOME TO SQUID 1.2
+       --------------------
 
-        This is the default squid configuration file. You may wish
-        to look at http://cache.is.co.za/squid/ for documentation,
-        or the squid home page (http://squid.nlanr.net/) for the FAQ
+       This is the default squid configuration file. You may wish
+       to look at http://cache.is.co.za/squid/ for documentation,
+       or the squid home page (http://squid.nlanr.net/) for the FAQ
 
-DOC_END
+COMMENT_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  NETWORK OPTIONS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: http_port ascii_port
 TYPE: ushortlist
@@ -129,12 +120,10 @@ udp_incoming_address 0.0.0.0
 udp_outgoing_address 0.0.0.0
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  OPTIONS WHICH AFFECT THE NEIGHBOR SELECTION ALGORITHM
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: cache_peer
 TYPE: peer
@@ -386,12 +375,10 @@ cache_stoplist_pattern
 DOC_END
 
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  OPTIONS WHICH AFFECT THE CACHE SIZE
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: cache_mem
 COMMENT: (bytes)
@@ -513,12 +500,10 @@ ipcache_low  90
 ipcache_high 95
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  LOGFILE PATHNAMES AND CACHE DIRECTORIES
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: cache_dir
 TYPE: cachedir
@@ -715,12 +700,10 @@ client_netmask 255.255.255.255
 DOC_END
 
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  OPTIONS FOR EXTERNAL SUPPORT PROGRAMS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 #  TAG: ftpget_program
 #      Where to find the 'ftpget' program that retrieves FTP data (HTTP
@@ -859,12 +842,10 @@ DOC_START
 redirect_children 5
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  OPTIONS FOR TUNING THE CACHE
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: wais_relay_host
 TYPE: string
@@ -1040,12 +1021,10 @@ DOC_START
 negative_dns_ttl 5 minutes
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  TIMEOUTS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: connect_timeout
 COMMENT: time-units
@@ -1142,12 +1121,10 @@ DOC_START
 shutdown_lifetime 30 seconds
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  ACCESS CONTROLS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: acl
 TYPE: acl
@@ -1297,12 +1274,10 @@ DOC_START
                * There are no defaults.
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  ADMINISTRATIVE PARAMETERS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: cache_mgr
 TYPE: string
@@ -1348,9 +1323,7 @@ DOC_START
 visible_hostname www-cache.foo.org
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  OPTIONS FOR THE CACHE REGISTRATION SERVICE
  -----------------------------------------------------------------------------
 
@@ -1372,7 +1345,7 @@ DOC_START
 
        All current information is processed regularly and made
        available on the Web at http://www.nlanr.net/Cache/Tracker/.
-DOC_END
+COMMENT_END
 
 NAME: announce_period
 TYPE: time_t
@@ -1418,12 +1391,10 @@ DEFAULT: /dev/null
 LOC: Config.Announce.file
 DOC_NONE
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  HTTPD-ACCELERATOR OPTIONS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: httpd_accel_host
 TYPE: string
@@ -1476,12 +1447,10 @@ DOC_START
 httpd_accel_uses_host_header off
 DOC_END
 
-NAME: arbtext
-LOC: arbtext
-DOC_START
+COMMENT_START
  MISCELLANEOUS
  -----------------------------------------------------------------------------
-DOC_END
+COMMENT_END
 
 NAME: dns_testnames
 TYPE: wordlist
index 0459a077e904139118a802b125836683f4b08f5b..1720f63b8800ed1b3236a2b8c4af421087cb5f34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cf_gen.cc,v 1.13 1997/10/26 02:35:28 wessels Exp $
+ * $Id: cf_gen.cc,v 1.14 1997/11/04 23:21:12 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Max Okumoto
@@ -120,10 +120,8 @@ main(int argc, char *argv[])
        case sSTART:
            if ((strlen(buff) == 0) || (!strncmp(buff, "#", 1))) {
                /* ignore empty and comment lines */
-
            } else if (!strncmp(buff, "NAME:", 5)) {
                char *name;
-
                if ((name = strtok(buff + 5, WS)) == NULL) {
                    printf("Error in input file\n");
                    exit(1);
@@ -131,10 +129,13 @@ main(int argc, char *argv[])
                curr = calloc(1, sizeof(Entry));
                curr->name = strdup(name);
                state = s1;
-
            } else if (!strcmp(buff, "EOF")) {
                state = sEXIT;
-
+           } else if (!strcmp(buff, "COMMENT_START")) {
+               curr = calloc(1, sizeof(Entry));
+               curr->name = strdup("comment");
+               curr->loc = strdup("none");
+               state = sDOC;
            } else {
                printf("Error on line %d\n", linenum);
                exit(1);
@@ -185,10 +186,9 @@ main(int argc, char *argv[])
            break;
 
        case sDOC:
-           if (!strcmp(buff, "DOC_END")) {
+           if (!strcmp(buff, "DOC_END") || !strcmp(buff, "COMMENT_END")) {
                Line *head = NULL;
                Line *line = curr->doc;
-
                /* reverse order of doc lines */
                while (line != NULL) {
                    Line *tmp;
@@ -198,15 +198,12 @@ main(int argc, char *argv[])
                    line = tmp;
                }
                curr->doc = head;
-
                /* add to list of entries */
                curr->next = entries;
                entries = curr;
-
                state = sSTART;
            } else {
                Line *line = calloc(1, sizeof(Line));
-
                line->data = strdup(buff);
                line->next = curr->doc;
                curr->doc = line;
@@ -304,7 +301,7 @@ gen_default(Entry * head, FILE * fp)
     for (entry = head; entry != NULL; entry = entry->next) {
        assert(entry->name);
 
-       if (!strcmp(entry->name, "arbtext"))
+       if (!strcmp(entry->name, "comment"))
            continue;
        if (entry->loc == NULL) {
            fprintf(stderr, "NO LOCATION FOR %s\n", entry->name);
@@ -372,6 +369,8 @@ gen_parse(Entry * head, FILE * fp)
        );
 
     for (entry = head; entry != NULL; entry = entry->next) {
+       if (strcmp(entry->name, "comment") == 0)
+           continue;
        fprintf(fp,
            "\t} else if (!strcmp(token, \"%s\")) {\n",
            entry->name
@@ -382,7 +381,7 @@ gen_parse(Entry * head, FILE * fp)
                "\t\tparse_%s();\n",
                entry->type
                );
-       } else if (strcmp(entry->loc, "arbtext")) {
+       } else {
            fprintf(fp,
                "\t\tparse_%s(&%s);\n",
                entry->type, entry->loc
@@ -412,7 +411,7 @@ gen_dump(Entry * head, FILE * fp)
        assert(entry->loc);
        if (strcmp(entry->loc, "none") == 0)
            continue;
-       if (strcmp(entry->name, "arbtext") == 0)
+       if (strcmp(entry->name, "comment") == 0)
            continue;
        fprintf(fp, "\tdump_%s(entry, \"%s\", %s);\n",
            entry->type,
@@ -435,7 +434,7 @@ gen_free(Entry * head, FILE * fp)
        assert(entry->loc);
        if (strcmp(entry->loc, "none") == 0)
            continue;
-       if (strcmp(entry->name, "arbtext") == 0)
+       if (strcmp(entry->name, "comment") == 0)
            continue;
        fprintf(fp, "\tfree_%s(&%s);\n", entry->type, entry->loc);
     }
@@ -450,7 +449,7 @@ gen_conf(Entry * head, FILE * fp)
     for (entry = head; entry != NULL; entry = entry->next) {
        Line *line;
 
-       if (strcmp(entry->name, "arbtext"))
+       if (strcmp(entry->name, "comment"))
            fprintf(fp, "#  TAG: %s", entry->name);
        if (entry->comment)
            fprintf(fp, "\t%s", entry->comment);