From aed9c0080375ced7ffcfd60a617c6e088bc04723 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Sun, 12 Jan 2003 15:15:45 +0100
Subject: [PATCH] * tools/sexp-conv.c (sexp_convert_string): Deleted function.
 (sexp_skip_token): Likewise.

* tools/sexp-conv.c (enum sexp_token): New constant SEXP_DISPLAY.
Start constants from 1, to keep 0 free for special uses.
(struct sexp_parse_state): New struct for keeping track of parser
state.
(sexp_parse_init): New function.
(sexp_check_token): New function, replacing sexp_skip_token.
(sexp_parse): New function.
(sexp_convert_item): Simplified by using sexp_parse.
(sexp_convert_list): Use sexp_parse.
(main): Likewise.

Rev: src/nettle/tools/sexp-conv.c:1.8
---
 tools/sexp-conv.c | 37 -------------------------------------
 1 file changed, 37 deletions(-)

diff --git a/tools/sexp-conv.c b/tools/sexp-conv.c
index 0a9786c9..6dccb605 100644
--- a/tools/sexp-conv.c
+++ b/tools/sexp-conv.c
@@ -968,36 +968,12 @@ sexp_put_digest(struct sexp_output *output)
 
 /* Conversion functions. */
 
-#if 0
-static void
-sexp_convert_string(struct sexp_input *input, enum sexp_mode mode_in,
-		    struct sexp_output *output, enum sexp_mode mode_out)
-{
-  sexp_get_token(input, mode_in);
-  if (input->token == SEXP_STRING)
-    sexp_put_string(output, mode_out, &input->string);
-  else
-    die("Invalid string.\n");
-}
-#endif
 
 static void
 sexp_convert_list(struct sexp_input *input, struct sexp_parse_state *parser,
 		  struct sexp_output *output, enum sexp_mode mode_out,
 		  unsigned indent);
 
-#if 0
-static void
-sexp_skip_token(struct sexp_input *input, enum sexp_mode mode,
-		enum sexp_token token)
-{
-  sexp_get_token(input, mode);
-
-  if (input->token != token)
-    die("Syntax error.\n");
-}
-#endif
-
 /* Should be called with input->token being the first token of the
  * expression, to be converted, and return with input->token being the
  * last token of the expression. */
@@ -1040,19 +1016,6 @@ sexp_convert_item(struct sexp_input *input, struct sexp_parse_state *parser,
       sexp_put_string(output, mode_out, &input->string);      
       break;
 
-#if 0
-    case SEXP_TRANSPORT_START:
-      if (mode_in == SEXP_CANONICAL)
-	die("Base64 not allowed in canonical mode.\n");
-      else
-	{
-	  sexp_get_token(input, SEXP_CANONICAL);
-	  sexp_convert_item(input, SEXP_CANONICAL, output, mode_out, indent);
-	  sexp_skip_token(input, SEXP_CANONICAL, SEXP_CODING_END);
-	  
-	  break;
-	}
-#endif
     default:
       /* Internal error */
       abort();
-- 
GitLab