]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Change EOF to END_OF_FILE in tokenizer for enum compatibility.
authorTed Lemon <source@isc.org>
Thu, 1 Mar 2001 18:17:09 +0000 (18:17 +0000)
committerTed Lemon <source@isc.org>
Thu, 1 Mar 2001 18:17:09 +0000 (18:17 +0000)
client/clparse.c
common/conflex.c
common/parse.c
common/resolv.c
dhcpctl/omshell.c
includes/dhctoken.h
server/confpars.c

index 8f54209cc2ab93b35784cea05bf5877cf80fce27..0cde199e2f931aa53122b7807844b76ef6a0e20c 100644 (file)
@@ -3,7 +3,7 @@
    Parser for dhclient config and lease files... */
 
 /*
- * Copyright (c) 1996-2000 Internet Software Consortium.
+ * Copyright (c) 1996-2001 Internet Software Consortium.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: clparse.c,v 1.56 2001/02/26 22:21:02 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: clparse.c,v 1.57 2001/03/01 18:16:57 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -65,7 +65,7 @@ u_int32_t default_requested_options [] = {
        0
 };
 
-/* client-conf-file :== client-declarations EOF
+/* client-conf-file :== client-declarations END_OF_FILE
    client-declarations :== <nil>
                         | client-declaration
                         | client-declarations client-declaration */
@@ -114,7 +114,7 @@ isc_result_t read_client_conf ()
 
                do {
                        token = peek_token (&val, cfile);
-                       if (token == EOF)
+                       if (token == END_OF_FILE)
                                break;
                        parse_client_statement (cfile,
                                                (struct interface_info *)0,
@@ -157,7 +157,7 @@ isc_result_t read_client_conf ()
        return status;
 }
 
-/* lease-file :== client-lease-statements EOF
+/* lease-file :== client-lease-statements END_OF_FILE
    client-lease-statements :== <nil>
                     | client-lease-statements LEASE client-lease-statement */
 
@@ -177,7 +177,7 @@ void read_client_leases ()
 
        do {
                token = next_token (&val, cfile);
-               if (token == EOF)
+               if (token == END_OF_FILE)
                        break;
                if (token != LEASE) {
                        log_error ("Corrupt lease file - possible data loss!");
@@ -666,7 +666,7 @@ void parse_interface_declaration (cfile, outer_config, name)
 
        do {
                token = peek_token (&val, cfile);
-               if (token == EOF) {
+               if (token == END_OF_FILE) {
                        parse_warn (cfile,
                                    "unterminated interface declaration.");
                        return;
@@ -788,7 +788,7 @@ void parse_client_lease_statement (cfile, is_static)
 
        do {
                token = peek_token (&val, cfile);
-               if (token == EOF) {
+               if (token == END_OF_FILE) {
                        parse_warn (cfile, "unterminated lease declaration.");
                        return;
                }
index ba22e32b340d7ebc212d801ee9e9870ebb301809..51b06c102ed742afa70bc71122fc70ecb33a9914 100644 (file)
@@ -3,7 +3,7 @@
    Lexical scanner for dhcpd config file... */
 
 /*
- * Copyright (c) 1995-2000 Internet Software Consortium.
+ * Copyright (c) 1995-2001 Internet Software Consortium.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: conflex.c,v 1.88 2001/02/27 01:15:36 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: conflex.c,v 1.89 2001/03/01 18:16:59 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -208,6 +208,9 @@ static enum dhcp_token get_token (cfile)
                        cfile -> lexchar = p;
                        ttok = read_num_or_name (c, cfile);
                        break;
+               } else if (c == EOF) {
+                       ttok = END_OF_FILE;
+                       break;
                } else {
                        cfile -> lexline = l;
                        cfile -> lexchar = p;
index dbe263a7ddf20e14a2f7142c8a98b3027f021ef7..b3909e9c65e01c8c97c91935b66c40f7a6966d48 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: parse.c,v 1.100 2001/02/12 19:44:54 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: parse.c,v 1.101 2001/03/01 18:17:00 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -139,7 +139,7 @@ void skip_to_rbrace (cfile, brace_count)
                        return;
                }
                token = next_token (&val, cfile);
-       } while (token != EOF);
+       } while (token != END_OF_FILE);
 }
 
 int parse_semi (cfile)
@@ -461,7 +461,7 @@ unsigned char *parse_numeric_aggregate (cfile, buf,
                }
                token = next_token (&val, cfile);
 
-               if (token == EOF) {
+               if (token == END_OF_FILE) {
                        parse_warn (cfile, "unexpected end of file");
                        break;
                }
@@ -2333,7 +2333,7 @@ int parse_on_statement (result, cfile, lose)
                        /* Try to even things up. */
                        do {
                                token = next_token (&val, cfile);
-                       } while (token != EOF && token != RBRACE);
+                       } while (token != END_OF_FILE && token != RBRACE);
                        executable_statement_dereference (result, MDL);
                        return 0;
                }
@@ -2525,7 +2525,7 @@ int parse_if_statement (result, cfile, lose)
                        /* Try to even things up. */
                        do {
                                token = next_token (&val, cfile);
-                       } while (token != EOF && token != RBRACE);
+                       } while (token != END_OF_FILE && token != RBRACE);
                        executable_statement_dereference (result, MDL);
                        return 0;
                }
index 4c302bb266cdfa3443ad073d327b7bfb11943319..051a672b129647a4c0c58a6d20ca6b79d1640419 100644 (file)
@@ -3,7 +3,7 @@
    Parser for /etc/resolv.conf file. */
 
 /*
- * Copyright (c) 1996-2000 Internet Software Consortium.
+ * Copyright (c) 1996-2001 Internet Software Consortium.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: resolv.c,v 1.13 2000/03/17 03:59:02 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: resolv.c,v 1.14 2001/03/01 18:17:02 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -75,7 +75,7 @@ void read_resolv_conf (parse_time)
 
        do {
                token = next_token (&val, cfile);
-               if (token == EOF)
+               if (token == END_OF_FILE)
                        break;
                else if (token == EOL)
                        continue;
index 4fb47d4f995ea8a1c80709d904994cbe96fb44d1..24a85cb8d6315e105d0dd04fdd4bbf487268f129 100644 (file)
@@ -1,4 +1,4 @@
-/* omapictl.c
+/* omshell.c
 
    Examine and modify omapi objects. */
 
@@ -224,7 +224,7 @@ int main (int argc, char **argv, char **envp)
                        parse_warn (cfile, "unknown token: %s", val);
                        break;
 
-                     case EOF:
+                     case END_OF_FILE:
                        break;
 
                      case TOKEN_HELP:
@@ -239,7 +239,7 @@ int main (int argc, char **argv, char **envp)
                      case TOKEN_NEW:
                        token = next_token (&val, cfile);
                        if ((!is_identifier (token) && token != STRING) ||
-                           next_token (NULL, cfile) != EOF)
+                           next_token (NULL, cfile) != END_OF_FILE)
                        {
                                printf ("usage: new <object-type>\n");
                                break;
@@ -260,7 +260,7 @@ int main (int argc, char **argv, char **envp)
                        break;
 
                      case TOKEN_CLOSE:
-                       if (next_token (NULL, cfile) != EOF) {
+                       if (next_token (NULL, cfile) != END_OF_FILE) {
                                printf ("usage: close\n");
                        }
 
@@ -304,7 +304,7 @@ int main (int argc, char **argv, char **envp)
 
                      case TOKEN_CREATE:
                      case TOKEN_OPEN:
-                       if (next_token (NULL, cfile) != EOF) {
+                       if (next_token (NULL, cfile) != END_OF_FILE) {
                                printf ("usage: %s\n", val);
                        }
 
@@ -327,7 +327,7 @@ int main (int argc, char **argv, char **envp)
                        break;
 
                      case UPDATE:
-                       if (next_token (NULL, cfile) != EOF) {
+                       if (next_token (NULL, cfile) != END_OF_FILE) {
                                printf ("usage: %s\n", val);
                        }
 
index cd94c02c4b02421f66cb43269d9dd13d4dc328b9..7fb9c753849880e6d417efd6b21a5012b2a678b7 100644 (file)
@@ -308,7 +308,8 @@ enum dhcp_token {
        TOKEN_CLOSE = 603,
        TOKEN_CREATE = 604,
        TOKEN_OPEN = 605,
-       TOKEN_HELP = 606
+       TOKEN_HELP = 606,
+       END_OF_FILE = 607
 };
 
 #define is_identifier(x)       ((x) >= FIRST_TOKEN &&  \
index ed2d025758c0ef16f6068256f2b2a6919429ca86..86e5555ca18c33fc015570bee9be8e425d41f99a 100644 (file)
@@ -3,7 +3,7 @@
    Parser for dhcpd config file... */
 
 /*
- * Copyright (c) 1995-2000 Internet Software Consortium.
+ * Copyright (c) 1995-2001 Internet Software Consortium.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.133 2001/02/12 21:59:30 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.134 2001/03/01 18:17:07 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -65,7 +65,7 @@ void parse_trace_setup ()
 }
 #endif
 
-/* conf-file :== parameters declarations EOF
+/* conf-file :== parameters declarations END_OF_FILE
    parameters :== <nil> | parameter | parameters parameter
    declarations :== <nil> | declaration | declarations declaration */
 
@@ -225,7 +225,7 @@ void trace_conf_input (trace_type_t *ttype, unsigned len, char *data)
 void trace_conf_stop (trace_type_t *ttype) { }
 #endif
 
-/* conf-file :== parameters declarations EOF
+/* conf-file :== parameters declarations END_OF_FILE
    parameters :== <nil> | parameter | parameters parameter
    declarations :== <nil> | declaration | declarations declaration */
 
@@ -239,7 +239,7 @@ isc_result_t conf_file_subparse (struct parse *cfile, struct group *group,
 
        do {
                token = peek_token (&val, cfile);
-               if (token == EOF)
+               if (token == END_OF_FILE)
                        break;
                declaration = parse_statement (cfile, group, group_type,
                                               (struct host_decl *)0,
@@ -251,7 +251,7 @@ isc_result_t conf_file_subparse (struct parse *cfile, struct group *group,
        return status;
 }
 
-/* lease-file :== lease-declarations EOF
+/* lease-file :== lease-declarations END_OF_FILE
    lease-statments :== <nil>
                     | lease-declaration
                     | lease-declarations lease-declaration */
@@ -264,7 +264,7 @@ isc_result_t lease_file_subparse (struct parse *cfile)
 
        do {
                token = next_token (&val, cfile);
-               if (token == EOF)
+               if (token == END_OF_FILE)
                        break;
                if (token == LEASE) {
                        struct lease *lease = (struct lease *)0;
@@ -1496,7 +1496,7 @@ void parse_host_declaration (cfile, group)
                        token = next_token (&val, cfile);
                        break;
                }
-               if (token == EOF) {
+               if (token == END_OF_FILE) {
                        token = next_token (&val, cfile);
                        parse_warn (cfile, "unexpected end of file");
                        break;
@@ -1838,7 +1838,7 @@ int parse_class_declaration (cp, cfile, group, type)
                if (token == RBRACE) {
                        token = next_token (&val, cfile);
                        break;
-               } else if (token == EOF) {
+               } else if (token == END_OF_FILE) {
                        token = next_token (&val, cfile);
                        parse_warn (cfile, "unexpected end of file");
                        break;
@@ -2028,7 +2028,7 @@ void parse_shared_net_declaration (cfile, group)
                                enter_shared_network (share);
                        shared_network_dereference (&share, MDL);
                        return;
-               } else if (token == EOF) {
+               } else if (token == END_OF_FILE) {
                        token = next_token (&val, cfile);
                        parse_warn (cfile, "unexpected end of file");
                        break;
@@ -2123,7 +2123,7 @@ void parse_subnet_declaration (cfile, share)
                if (token == RBRACE) {
                        token = next_token (&val, cfile);
                        break;
-               } else if (token == EOF) {
+               } else if (token == END_OF_FILE) {
                        token = next_token (&val, cfile);
                        parse_warn (cfile, "unexpected end of file");
                        break;
@@ -2213,7 +2213,7 @@ void parse_group_declaration (cfile, group)
                if (token == RBRACE) {
                        token = next_token (&val, cfile);
                        break;
-               } else if (token == EOF) {
+               } else if (token == END_OF_FILE) {
                        token = next_token (&val, cfile);
                        parse_warn (cfile, "unexpected end of file");
                        break;
@@ -2387,7 +2387,7 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
                token = next_token (&val, cfile);
                if (token == RBRACE)
                        break;
-               else if (token == EOF) {
+               else if (token == END_OF_FILE) {
                        parse_warn (cfile, "unexpected end of file");
                        break;
                }