>From a582da6cf337a6c636603103647ec158ed5763af Mon Sep 17 00:00:00 2001 From: Alexander Cherepanov Date: Sat, 11 May 2013 18:18:12 +0400 Subject: [PATCH 5/5] Don't export various symbols in rules.[ch]. --- src/rules.c | 25 ++++++++++++++++++++++--- src/rules.h | 25 ------------------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/rules.c b/src/rules.c index dc3ac6e..251cceb 100644 --- a/src/rules.c +++ b/src/rules.c @@ -17,7 +17,10 @@ #include "rpp.h" #include "rules.h" -char *rules_errors[] = { +/* + * Error names. + */ +static char *rules_errors[] = { NULL, /* No error */ "Unexpected end of rule", "Unknown command", @@ -27,7 +30,16 @@ char *rules_errors[] = { "Unknown rule reject flag" }; -int rules_errno, rules_line; +/* + * Last error code. + */ +static int rules_errno; + +/* + * Configuration file line number, only set after a rules_check() call if + * rules_errno indicates an error. + */ +static int rules_line; static int rules_max_length = 0; @@ -956,7 +968,14 @@ out_ERROR_UNALLOWED: goto out_NULL; } -int rules_check(struct rpp_context *start, int split) +/* + * Checks if all the rules for context are valid. Returns the number of rules, + * or returns zero and sets rules_errno on error. + * + * split == 0 "single crack" mode rules allowed + * split < 0 "single crack" mode rules are invalid + */ +static int rules_check(struct rpp_context *start, int split) { struct rpp_context ctx; char *rule; diff --git a/src/rules.h b/src/rules.h index 309724b..f2d9d8e 100644 --- a/src/rules.h +++ b/src/rules.h @@ -25,22 +25,6 @@ #define RULES_ERROR_REJECT 6 /* - * Error names. - */ -extern char *rules_errors[]; - -/* - * Last error code. - */ -extern int rules_errno; - -/* - * Configuration file line number, only set after a rules_check() call if - * rules_errno indicates an error. - */ -extern int rules_line; - -/* * Initializes the rules support. */ extern void rules_init(int max_length); @@ -76,15 +60,6 @@ extern char *rules_reject(char *rule, int split, char *last, extern char *rules_apply(char *word, char *rule, int split, char *last); /* - * Checks if all the rules for context are valid. Returns the number of rules, - * or returns zero and sets rules_errno on error. - * - * split == 0 "single crack" mode rules allowed - * split < 0 "single crack" mode rules are invalid - */ -extern int rules_check(struct rpp_context *start, int split); - -/* * Similar to rules_check(), but displays a message and does not return on * error. */ -- 1.7.2.5