summaryrefslogtreecommitdiff
path: root/sexp.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2003-02-10 17:26:01 +0100
committerNiels Möller <nisse@lysator.liu.se>2003-02-10 17:26:01 +0100
commite01516ec4686430168045b058984e39adc58c4a6 (patch)
tree9e88079b6c83ea69e5c686118b19cede6edec357 /sexp.h
parent790e9669d6d2f7b0f202be8299671a200bbb621f (diff)
downloadnettle-e01516ec4686430168045b058984e39adc58c4a6.tar.gz
(format_string): New function.
(sexp_vformat): Implemented support for literals in the format string. Rev: src/nettle/sexp-format.c:1.6 Rev: src/nettle/sexp.h:1.12
Diffstat (limited to 'sexp.h')
-rw-r--r--sexp.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sexp.h b/sexp.h
index aa86db24..1849988b 100644
--- a/sexp.h
+++ b/sexp.h
@@ -134,7 +134,8 @@ struct nettle_buffer;
/* Returns the number of output characters, or 0 on out of memory. If
* buffer == NULL, just compute length.
*
- * Format strings can contained matched parentheses, and the following
+ * Format strings can contained matched parentheses, tokens ("foo" in
+ * the format string is formatted as "3:foo"), and the following
* formatting specifiers:
*
* %s String represented as unsigned length, const uint8_t *data.
@@ -157,8 +158,7 @@ struct nettle_buffer;
* instead the string is NUL-terminated, and there's only one
* const uint8_t * argument.
*
- * FIXME: Allow literals, like "(x%b)". Allow "%(" for unbalanced
- * parenthesis. */
+ * FIXME: Allow "%(" for unbalanced parenthesis. */
unsigned
sexp_format(struct nettle_buffer *buffer,
@@ -179,4 +179,10 @@ unsigned
sexp_transport_vformat(struct nettle_buffer *buffer,
const char *format, va_list args);
+/* Classification for advanced syntax. */
+extern const char
+sexp_token_chars[0x80];
+
+#define TOKEN_CHAR(c) ((c) < 0x80 && sexp_token_chars[(c)])
+
#endif /* NETTLE_SEXP_H_INCLUDED */