Refactor pool_config.l.
authorTatsuo Ishii <ishii@postgresql.org>
Tue, 5 Nov 2024 02:21:03 +0000 (11:21 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Tue, 5 Nov 2024 02:21:03 +0000 (11:21 +0900)
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
src/include/pool_config.h

index b681e8a38661474782f829e0b5e7a285338a7899..b1613029351be5a6a11cf5706b2ab169b0ee3744 100644 (file)
@@ -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)
index 7782d50c428943fe7e1c15a5f9bf247ecd2fc067..626c2ffa928d6bfe625b6cb4db609443e5ed4501 100644 (file)
@@ -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 */