1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Changed mysql, mysqladmin, mysqlshow, mysqldump, mysqlimport,

mysqlcheck and myisamchk to use new my_getopt struct.
This commit is contained in:
jani@hynda.mysql.fi
2002-04-02 20:29:53 +03:00
parent 697978b5bf
commit c143f01dd1
13 changed files with 1356 additions and 1447 deletions

View File

@ -14,28 +14,21 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
struct my_optarg
{
char *arg; /* option argument */
int pos; /* next element in ARGV */
int verbose; /* 0 = inhibit warnings of unrecognized options */
int unrecognized; /* position of the unrecognized option */
};
C_MODE_START
enum get_opt_var_type { GET_NO_ARG, GET_LONG, GET_LL, GET_STR };
enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_LONG, GET_LL, GET_STR };
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct my_option
{
const char *name; /* Name of the option */
int id; /* unique id or short option */
const char *comment; /* option comment, for autom. --help */
gptr *value; /* The variable value */
gptr *u_max_value; /* The user def. max variable value */
const char **str_values; /* Pointer to possible values */
enum get_opt_var_type var_type;
enum get_opt_arg_type arg_type;
int id; /* unique id or short option */
longlong def_value; /* Default value */
longlong min_value; /* Min allowed value */
longlong max_value; /* Max allowed value */
@ -44,6 +37,8 @@ struct my_option
int app_type; /* To be used by an application */
};
extern char *disabled_my_option;
extern int handle_options (int *argc, char ***argv,
const struct my_option *longopts,
my_bool (*get_one_option)(int,
@ -51,3 +46,5 @@ extern int handle_options (int *argc, char ***argv,
char *));
extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options);
C_MODE_END