diff --git a/examples/dns.c b/examples/dns.c index ce1e9ed..f3903c4 100644 --- a/examples/dns.c +++ b/examples/dns.c @@ -1,5 +1,6 @@ #include "../src/hammer.h" #include "dns_common.h" +#include "dns.h" #define false 0 #define true 1 @@ -32,6 +33,8 @@ bool validate_dns(parse_result_t *p) { return true; } +const parsed_token_t* pack_dns_struct(const parse_result_t *p); + const parser_t* init_parser() { static parser_t *dns_message = NULL; if (dns_message) diff --git a/src/hammer.c b/src/hammer.c index 19d2db2..55a2fdc 100644 --- a/src/hammer.c +++ b/src/hammer.c @@ -1123,7 +1123,7 @@ static void test_whitespace(void) { #include -const parsed_token_t* upcase(parse_result_t *p) { +const parsed_token_t* upcase(const parse_result_t *p) { switch(p->ast->token_type) { case TT_SEQUENCE: { diff --git a/src/hammer.h b/src/hammer.h index b3bd412..b724773 100644 --- a/src/hammer.h +++ b/src/hammer.h @@ -90,7 +90,7 @@ typedef struct parse_result { * say, structs) and stuff values for them into the void* in the * tagged union in parsed_token_t. */ -typedef const parsed_token_t* (*action_t)(parse_result_t *p); +typedef const parsed_token_t* (*action_t)(const parse_result_t *p); /** * Type of a boolean attribute-checking function, used in the