action is all const all the time. Now to write the dns action.
This commit is contained in:
parent
034b3a717f
commit
8959d6db07
3 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include "../src/hammer.h"
|
#include "../src/hammer.h"
|
||||||
#include "dns_common.h"
|
#include "dns_common.h"
|
||||||
|
#include "dns.h"
|
||||||
|
|
||||||
#define false 0
|
#define false 0
|
||||||
#define true 1
|
#define true 1
|
||||||
|
|
@ -32,6 +33,8 @@ bool validate_dns(parse_result_t *p) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const parsed_token_t* pack_dns_struct(const parse_result_t *p);
|
||||||
|
|
||||||
const parser_t* init_parser() {
|
const parser_t* init_parser() {
|
||||||
static parser_t *dns_message = NULL;
|
static parser_t *dns_message = NULL;
|
||||||
if (dns_message)
|
if (dns_message)
|
||||||
|
|
|
||||||
|
|
@ -1123,7 +1123,7 @@ static void test_whitespace(void) {
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
const parsed_token_t* upcase(parse_result_t *p) {
|
const parsed_token_t* upcase(const parse_result_t *p) {
|
||||||
switch(p->ast->token_type) {
|
switch(p->ast->token_type) {
|
||||||
case TT_SEQUENCE:
|
case TT_SEQUENCE:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ typedef struct parse_result {
|
||||||
* say, structs) and stuff values for them into the void* in the
|
* say, structs) and stuff values for them into the void* in the
|
||||||
* tagged union in parsed_token_t.
|
* 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
|
* Type of a boolean attribute-checking function, used in the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue