pgpool2.git / summary / log / commit / refs
commit 627ace7bb60ef21347dad8ff4e89041578b9c31c
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Tue Nov 05 02:21:03 2024 +0000
Refactor pool_config.l.
There were unnecessary function exporting. This commit fixes them.
Also fixes indentations that did not follow our standards.
Since this is not a bug fix, appied to only master branch.
src/config/pool_config.l | 23 +++++++++++++++++------
src/include/pool_config.h | 4 ----
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/src/config/pool_config.l b/src/config/pool_config.l
index b681e8a38..b16130293 100644
--- a/src/config/pool_config.l
+++ b/src/config/pool_config.l
@@ -63,6 +63,10 @@ static void FreeConfigVariable(ConfigVariable *item);
static bool ParseConfigFile(const char *config_file, const char *calling_file,
int depth, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p);
+static int growFunctionPatternArray(RegPattern item);
+static int growMemqcacheTablePatternArray(RegPattern item);
+static int growQueryPatternArray(RegPattern item);
+
%}
%option 8bit
@@ -162,13 +166,17 @@ int add_regex_pattern(const char *type, char *s)
if required to prevent partial matching. It also allow backward
compatibility.
*/
- if (strncmp(s, "^", 1) != 0) {
+ if (strncmp(s, "^", 1) != 0)
+ {
strncpy(currItem.pattern, "^", 2);
strncat(currItem.pattern, s, pattern_len - 2);
- } else {
+ }
+ else
+ {
strncpy(currItem.pattern, s, pattern_len);
}
- if (s[strlen(s)-1] != '$') {
+ if (s[strlen(s)-1] != '$')
+ {
strncat(currItem.pattern, "$", 2);
}
ereport(DEBUG1,
@@ -213,7 +221,8 @@ int add_regex_pattern(const char *type, char *s)
* The array start with PATTERN_ARR_SIZE storage place, if required
* it will grow of PATTERN_ARR_SIZE more each time.
*/
-int growFunctionPatternArray(RegPattern item)
+static int
+growFunctionPatternArray(RegPattern item)
{
void *_tmp = NULL;
if (pool_config->pattc == pool_config->current_pattern_size)
@@ -234,7 +243,8 @@ int growFunctionPatternArray(RegPattern item)
return(pool_config->pattc);
}
-int growMemqcacheTablePatternArray(RegPattern item)
+static int
+growMemqcacheTablePatternArray(RegPattern item)
{
void *_tmp = NULL;
if (pool_config->memqcache_table_pattc == pool_config->current_memqcache_table_pattern_size)
@@ -255,7 +265,8 @@ int growMemqcacheTablePatternArray(RegPattern item)
return(pool_config->memqcache_table_pattc);
}
-int growQueryPatternArray(RegPattern item)
+static int
+growQueryPatternArray(RegPattern item)
{
void *_tmp = NULL;
if (pool_config->query_pattc == pool_config->current_query_pattern_size)
diff --git a/src/include/pool_config.h b/src/include/pool_config.h
index 7782d50c4..626c2ffa9 100644
--- a/src/include/pool_config.h
+++ b/src/include/pool_config.h
@@ -663,7 +663,6 @@ typedef struct ConfigVariable
struct ConfigVariable *next;
} ConfigVariable;
-
extern int pool_init_config(void);
extern bool pool_get_config(const char *config_file, ConfigContext context);
extern int eval_logical(const char *str);
@@ -672,8 +671,5 @@ extern char *backend_status_to_str(BackendInfo * bi);
/* methods used for regexp support */
extern int add_regex_pattern(const char *type, char *s);
-extern int growFunctionPatternArray(RegPattern item);
-extern int growMemqcacheTablePatternArray(RegPattern item);
-extern int growQueryPatternArray(RegPattern item);
#endif /* POOL_CONFIG_H */
[parent: ec6740f7259f]