Cleaned up the code and documented fucntions.

This commit is contained in:
Markus Makela
2014-12-18 19:51:24 +02:00
parent 1e43102eea
commit d41d16a1f3

View File

@ -68,6 +68,7 @@
#include <session.h>
#include <plugin.h>
#include <skygw_types.h>
#include <skygw_debug.h>
#include <time.h>
#include <assert.h>
#include <regex.h>
@ -118,13 +119,13 @@ typedef enum {
}ruletype_t;
const char* rule_names[] = {
"RT_UNDEFINED",
"RT_COLUMN",
"RT_THROTTLE",
"RT_PERMISSION",
"RT_WILDCARD",
"RT_REGEX",
"RT_CLAUSE"
"UNDEFINED",
"COLUMN",
"THROTTLE",
"PERMISSION",
"WILDCARD",
"REGEX",
"CLAUSE"
};
@ -299,9 +300,9 @@ static void* hrulefree(void* fval)
/**
* Replace all non-essential characters with whitespace from a null-terminated string.
* Strips the single or double quotes from a string.
* This function modifies the passed string.
* @param str String to purify
* @param str String to parse
* @return Pointer to the modified string
*/
char* strip_tags(char* str)
@ -435,9 +436,14 @@ bool check_time(char* str)
return numbers == 12 && colons == 4 && dashes == 1;
}
#define CHK_TIMES(t)(assert(t->tm_sec > -1 && t->tm_sec < 62 \
#ifdef SS_DEBUG
#define CHK_TIMES(t)(ss_dassert(t->tm_sec > -1 && t->tm_sec < 62 \
&& t->tm_min > -1 && t->tm_min < 60 \
&& t->tm_hour > -1 && t->tm_hour < 24))
#else
#define CHK_TIMES(t)
#endif
#define IS_RVRS_TIME(tr) (mktime(&tr->end) < mktime(&tr->start))
/**
@ -543,9 +549,9 @@ version()
}
/**
* The module initialisation routine, called when the module
* is first loaded.
*/
* The module initialisation routine, called when the module
* is first loaded.
*/
void
ModuleInit()
{