chiark
/
gitweb
/
~ianmdlvl
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
site: Change return value of decrypt_msg0
[secnet.git]
/
conffile.y
diff --git
a/conffile.y
b/conffile.y
index b6b246c91fbb2dfa09adde21cd3723dcfb26d772..9f32cfdaf5c6ba53d4f37397449043351b97dc51 100644
(file)
--- a/
conffile.y
+++ b/
conffile.y
@@
-8,8
+8,15
@@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+/* Bison stupidly redeclares malloc/free unless they are #defined
+ * (or a bunch of madder conditions) */
+#ifndef malloc
+# define malloc malloc
+# define free free
+#endif
#include "secnet.h"
#include "conffile_internal.h"
#include "secnet.h"
#include "conffile_internal.h"
+#include "conffile.yy.h"
#include "util.h"
#define YYERROR_VERBOSE
#include "util.h"
#define YYERROR_VERBOSE
@@
-17,13
+24,13
@@
static struct p_node *node(uint32_t type, struct p_node *l, struct p_node *r);
static struct p_node *result;
static struct p_node *result;
-static void yyerror(char *s);
+static void yyerror(c
onst c
har *s);
%}
%%
%}
%%
-input: assignments { result = $1; }
+input: assignments { result = $1;
$$=result;
}
;
assignments: assignments assignment { $$=node(T_ALIST, $2, $1); }
;
assignments: assignments assignment { $$=node(T_ALIST, $2, $1); }
@@
-73,7
+80,7
@@
item: TOK_STRING
%%
%%
-static void yyerror(char *s)
+static void yyerror(c
onst c
har *s)
{
Message(M_FATAL,"config file %s line %d: %s\n",config_file,
config_lineno,s);
{
Message(M_FATAL,"config file %s line %d: %s\n",config_file,
config_lineno,s);
@@
-96,7
+103,7
@@
static struct p_node *node(uint32_t type, struct p_node *l, struct p_node *r)
{
struct p_node *rv;
{
struct p_node *rv;
-
rv=safe_malloc(sizeof(*rv),"p_node"
);
+
NEW(rv
);
rv->type=type;
rv->loc.file=config_file;
rv->loc.line=config_lineno;
rv->type=type;
rv->loc.file=config_file;
rv->loc.line=config_lineno;