aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-14 22:04:49 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-15 05:07:57 +0000
commit96c72df2dfe9c84bc2716352ebe1876ddd8ceaf4 (patch)
treebf92321caa198a0d4c8441077b041538fc05e365 /tools
parentc64ab9d355a5e9308a268ca2bc20218fb8fe23ab (diff)
Make the set of static routines match that in the current tip SQLite.
This reduces the differences between our lemon.c and SQLite's. Change-Id: Ie672fa564a43ffe2fae271968accfed2a864bb63 Reviewed-on: https://code.wireshark.org/review/21107 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools')
-rw-r--r--tools/lemon/lemon.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c
index 68f7071adc..6b7f1781b4 100644
--- a/tools/lemon/lemon.c
+++ b/tools/lemon/lemon.c
@@ -42,8 +42,8 @@ extern int access(const char *path, int mode);
#include <unistd.h>
#endif
-#define PRIVATE static
-/* #define PRIVATE */
+/* #define PRIVATE static */
+#define PRIVATE
#ifdef TEST
#define MAXRHS 5 /* Set low to exercise exception code */
@@ -530,7 +530,7 @@ static struct action *Action_sort(
return ap;
}
-PRIVATE void Action_add(
+void Action_add(
struct action **app,
enum e_action type,
struct symbol *sp,
@@ -602,16 +602,14 @@ struct acttab {
#define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead)
/* Free all memory associated with the given acttab */
-#if 0
-PRIVATE void acttab_free(acttab *p){
+void acttab_free(acttab *p){
free( p->aAction );
free( p->aLookahead );
free( p );
}
-#endif
/* Allocate a new acttab structure */
-PRIVATE acttab *acttab_alloc(void){
+acttab *acttab_alloc(void){
acttab *p = (acttab *) calloc( 1, sizeof(*p) );
if( p==0 ){
fprintf(stderr,"Unable to allocate memory for a new acttab.");
@@ -626,7 +624,7 @@ PRIVATE acttab *acttab_alloc(void){
** This routine is called once for each lookahead for a particular
** state.
*/
-PRIVATE void acttab_action(acttab *p, int lookahead, int action){
+void acttab_action(acttab *p, int lookahead, int action){
if( p->nLookahead>=p->nLookaheadAlloc ){
p->nLookaheadAlloc += 25;
p->aLookahead = (struct lookahead_action *) realloc( p->aLookahead,
@@ -656,7 +654,7 @@ PRIVATE void acttab_action(acttab *p, int lookahead, int action){
**
** Return the offset into the action table of the new transaction.
*/
-PRIVATE int acttab_insert(acttab *p){
+int acttab_insert(acttab *p){
int i, j, k, n;
assert( p->nLookahead>0 );
@@ -958,7 +956,7 @@ PRIVATE struct state *getstate(struct lemon *lemp)
/*
** Return true if two symbols are the same.
*/
-PRIVATE int same_symbol(struct symbol *a, struct symbol *b)
+int same_symbol(struct symbol *a, struct symbol *b)
{
int i;
if( a==b ) return 1;
@@ -1872,7 +1870,7 @@ static char *merge(
** The "next" pointers for elements in list are changed.
*/
#define LISTSIZE 30
-PRIVATE char *msort(
+static char *msort(
char *list,
char **next,
int (*cmp)(const char*,const char*)
@@ -3111,7 +3109,7 @@ void Reprint(struct lemon *lemp)
/* Print a single rule.
*/
-PRIVATE void RulePrint(FILE *fp, struct rule *rp, int iCursor){
+void RulePrint(FILE *fp, struct rule *rp, int iCursor){
struct symbol *sp;
int i, j;
fprintf(fp,"%s ::=",rp->lhs->name);
@@ -3132,7 +3130,7 @@ PRIVATE void RulePrint(FILE *fp, struct rule *rp, int iCursor){
/* Print the rule for a configuration.
*/
-PRIVATE void ConfigPrint(FILE *fp, struct config *cfp){
+void ConfigPrint(FILE *fp, struct config *cfp){
RulePrint(fp, cfp->rp, cfp->dot);
}
@@ -3175,7 +3173,7 @@ char *tag;
/* Print an action to the given file descriptor. Return FALSE if
** nothing was actually printed.
*/
-PRIVATE int PrintAction(
+int PrintAction(
struct action *ap, /* The action to print */
FILE *fp, /* Print the action here */
int indent /* Indent by this amount */
@@ -3502,7 +3500,7 @@ PRIVATE void tplt_print(FILE *out, struct lemon *lemp, char *str, int *lineno)
** The following routine emits code for the destructor for the
** symbol sp
*/
-PRIVATE void emit_destructor_code(
+void emit_destructor_code(
FILE *out,
struct symbol *sp,
struct lemon *lemp,
@@ -3548,7 +3546,7 @@ PRIVATE void emit_destructor_code(
/*
** Return TRUE (non-zero) if the given symbol has a destructor.
*/
-PRIVATE int has_destructor(struct symbol *sp, struct lemon *lemp)
+int has_destructor(struct symbol *sp, struct lemon *lemp)
{
int ret;
if( sp->type==TERMINAL ){
@@ -3866,7 +3864,7 @@ PRIVATE void emit_code(
** union, also set the ".dtnum" field of every terminal and nonterminal
** symbol.
*/
-PRIVATE void print_stack_union(
+void print_stack_union(
FILE *out, /* The output stream */
struct lemon *lemp, /* The main info structure for this parser */
int *plineno, /* Pointer to the line number */