From e7114fd1536562beeec98b5e50f951a28be5dd2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Sun, 26 Nov 2000 19:16:21 +0100
Subject: [PATCH] * src/parse.c (parse_rest): New function.

Rev: src/parse.c:1.32
Rev: src/parse.h:1.24
---
 src/parse.c | 12 ++++++++++++
 src/parse.h |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/src/parse.c b/src/parse.c
index 59e62ed8a..1ed38ca06 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -306,6 +306,18 @@ parse_atom_list(struct simple_buffer *buffer, unsigned limit)
   return parse_atoms(&sub_buffer, limit);
 }
 
+struct lsh_string *
+parse_rest(struct simple_buffer *buffer)
+{
+  UINT32 length = LEFT;
+  struct lsh_string *s = ssh_format("%ls", length, HERE);
+
+  ADVANCE(length);
+  assert(!LEFT);
+
+  return s;
+}
+
 /* Returns success (i.e. 1) iff there is no data left */
 int
 parse_eod(struct simple_buffer *buffer)
diff --git a/src/parse.h b/src/parse.h
index 302732359..d377fcd61 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -83,6 +83,10 @@ struct int_list *parse_atoms(struct simple_buffer *buffer, unsigned limit);
  * read. Returns a NULL pointer on error. */
 struct int_list *parse_atom_list(struct simple_buffer *buffer, unsigned limit);
 
+/* Copies the rest of the buffer into a string. */
+struct lsh_string *
+parse_rest(struct simple_buffer *buffer);
+
 /* Returns success (i.e. 1) iff there is no data left */
 int parse_eod(struct simple_buffer *buffer);
 
-- 
GitLab