- /*
- * For "char *" references
- */
- case OUTPUT_STRING:
- {
- char *option = *((char **) info_table[i].option);
-
- sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
- get_id(&me, source_p), RPL_INFO,
- get_id(source_p, source_p),
- info_table[i].name,
- option ? option : "NONE",
- info_table[i].desc ? info_table[i].desc : "<none>");
-
- break;
- }
- /*
- * For "char foo[]" references
- */
- case OUTPUT_STRING_PTR:
- {
- char *option = (char *) info_table[i].option;
-
- sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
- get_id(&me, source_p), RPL_INFO,
- get_id(source_p, source_p),
- info_table[i].name,
- EmptyString(option) ? "NONE" : option,
- info_table[i].desc ? info_table[i].desc : "<none>");
-
- break;
- }
- /*
- * Output info_table[i].option as a decimal value.
- */
- case OUTPUT_DECIMAL:
- {
- int option = *((int *) info_table[i].option);
-
- sendto_one(source_p, ":%s %d %s :%-30s %-16d [%s]",
- get_id(&me, source_p), RPL_INFO,
- get_id(source_p, source_p),
- info_table[i].name,
- option,
- info_table[i].desc ? info_table[i].desc : "<none>");
-
- break;
- }
-
- /*
- * Output info_table[i].option as "ON" or "OFF"
- */
- case OUTPUT_BOOLEAN:
- {
- int option = *((int *) info_table[i].option);
-
- sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
- get_id(&me, source_p), RPL_INFO,
- get_id(source_p, source_p),
- info_table[i].name,
- option ? "ON" : "OFF",
- info_table[i].desc ? info_table[i].desc : "<none>");
-
- break;
- }
- /*
- * Output info_table[i].option as "YES" or "NO"
- */
- case OUTPUT_BOOLEAN_YN:
- {
- int option = *((int *) info_table[i].option);
-
- sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
- get_id(&me, source_p), RPL_INFO,
- get_id(source_p, source_p),
- info_table[i].name,
- option ? "YES" : "NO",
- info_table[i].desc ? info_table[i].desc : "<none>");
-
- break;
- }
-
- case OUTPUT_BOOLEAN2:
- {
- int option = *((int *) info_table[i].option);
-
- sendto_one(source_p, ":%s %d %s :%-30s %-16s [%s]",
- me.name, RPL_INFO, source_p->name,
- info_table[i].name,
- option ? ((option == 1) ? "MASK" : "YES") : "NO",
- info_table[i].desc ? info_table[i].desc : "<none>");
- } /* switch (info_table[i].output_type) */
+ case OUTPUT_STRING:
+ {
+ const char *option = *info_table[i].option.string_p;
+ opt_value = option != NULL ? option : "NONE";
+ break;
+ }
+ case OUTPUT_STRING_PTR:
+ {
+ const char *option = info_table[i].option.string;
+ opt_value = option != NULL ? option : "NONE";
+ break;
+ }
+ case OUTPUT_DECIMAL:
+ {
+ int option = *info_table[i].option.int_;
+ snprintf(opt_buf, sizeof opt_buf, "%d", option);
+ break;
+ }
+ case OUTPUT_BOOLEAN:
+ {
+ bool option = *info_table[i].option.bool_;
+ opt_value = option ? "ON" : "OFF";
+ break;