<div dir="ltr">Hi Ishii-San<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 19, 2018 at 9:12 AM, Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Usama,<br>
<br>
Is there any reason we need to build configuration groups by hand?<br>
<br>
static void build_variable_groups(void)<br>
{<br>
/* we build these by hand */<br>
/* group 1. Backend config vars */<br>
:<br>
:<br>
<br>
It seems we could build configuration groups automaticaly since the<br>
configuration group info is already in config_generic struct.<br>
(config_group)<br>
<br>
struct config_generic<br>
{<br>
/* constant fields, must be set correctly in initial value: */<br>
const char *name; /* name of variable - MUST BE FIRST */<br>
ConfigContext context; /* context required to set the variable */<br>
config_group group; /* to help organize variables by function */<br>
const char *description; /* short desc. of this variable's purpose */<br>
config_type vartype; /* type of variable (set only at startup) */<br>
bool dynamic_array_var; /* true if the variable name contains index postfix */<br>
int flags; /* flags */<br>
int max_elements; /* number of maximum elements, only valid for array type configs */<br>
int status; /* status bits, see below */<br>
int sourceline; /* line in source file */<br>
:<br>
:<br>
<br>
If we could do this, we would have much more groups than today since<br>
there are many more groups actually defined in the struct.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
typedef enum<br>
{<br>
CONNECTION_CONFIG,<br>
CONNECTION_POOL_CONFIG,<br>
LOGING_CONFIG,<br>
HEALTH_CHECK_CONFIG,<br>
FILE_LOCATION_CONFIG,<br>
LOAD_BALANCE_CONFIG,<br>
REPLICATION_CONFIG,<br>
STREAMING_REPLICATION_CONFIG,<br>
MASTER_SLAVE_CONFIG,<br>
WATCHDOG_CONFIG,<br>
SSL_CONFIG,<br>
FAILOVER_CONFIG,<br>
RECOVERY_CONFIG,<br>
WATCHDOG_LIFECHECK,<br>
GENERAL_CONFIG,<br>
CACHE_CONFIG<br>
} config_group;<br>
<br></blockquote><div><br></div><div>I think its a good idea. And I don't see problem with doing that but I just can't remember why I didn't do that in first place</div><div>I will take a look into this one.</div><div><br></div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
</blockquote></div><br></div></div>