summaryrefslogtreecommitdiff
path: root/lib/db-ctl-base.h
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2015-07-17 16:56:02 -0700
committerAndy Zhou <azhou@nicira.com>2015-07-23 13:31:55 -0700
commitd33340a56b2dbeff00a2503e5d3afb11c226e6b4 (patch)
tree601aaf66f0b066e0cd9c9f21527012c516d7e121 /lib/db-ctl-base.h
parent6530be3ba04e4679824709c922eb501bcb77806e (diff)
downloadopenvswitch-d33340a56b2dbeff00a2503e5d3afb11c226e6b4.tar.gz
db-ctl-base: make cmd_show_table private
Instead of requiring user to declare a global variable, pass the value via ctl_init(). Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/db-ctl-base.h')
-rw-r--r--lib/db-ctl-base.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/db-ctl-base.h b/lib/db-ctl-base.h
index aff242bf9..00e86f8b8 100644
--- a/lib/db-ctl-base.h
+++ b/lib/db-ctl-base.h
@@ -33,8 +33,6 @@ struct table;
* (structs, commands and functions). To utilize this module, user must
* define the following:
*
- * - the 'cmd_show_tables'. (See 'struct cmd_show_table' for more info).
- *
* - the command syntaxes for each command. (See 'struct ctl_command_syntax'
* for more info) and regiters them using ctl_register_commands().
*
@@ -47,8 +45,10 @@ struct table;
#define ovs_fatal please_use_ctl_fatal_instead_of_ovs_fatal
struct ctl_table_class;
+struct cmd_show_table;
void ctl_init(const struct ctl_table_class *tables,
- void (*ctl_exit_func)(int status));
+ const struct cmd_show_table *cmd_show_tables,
+ void (*ctl_exit_func)(int status));
char *ctl_default_db(void);
OVS_NO_RETURN void ctl_fatal(const char *, ...) OVS_PRINTF_FORMAT(1, 2);
@@ -164,17 +164,6 @@ struct cmd_show_table {
const struct ovsdb_idl_column *columns[3]; /* Seems like a good number. */
};
-/* This array defines the 'show' command output format. User can check the
- * definition in utilities/ovs-vsctl.c as reference.
- *
- * Particularly, if an element in 'columns[]' represents a reference to
- * another table, the referred table must also be defined as an entry in
- * in 'cmd_show_tables[]'.
- *
- * The definition must end with an all-NULL entry.
- * */
-extern struct cmd_show_table cmd_show_tables[];
-
/* The base context struct for conducting the common database
* operations (commands listed in 'db_ctl_commands'). User should