~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to extra/my_print_defaults.cc

  • Committer: Brian Aker
  • Date: 2009-09-26 04:00:11 UTC
  • mfrom: (1126.12.1 trunk-nodebug)
  • Revision ID: brian@gaz-20090926040011-2qzxdcbpm1ibpkhl
Merge Lee

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <mystrings/m_string.h>
26
26
#include <mysys/my_getopt.h>
27
27
 
28
 
 
29
 
const char *config_file="my";                   /* Default config file */
30
 
uint verbose= 0, opt_defaults_file_used= 0;
 
28
#include <stdio.h>
 
29
 
 
30
extern "C"
 
31
bool get_one_option(int optid, const struct my_option *, char *);
 
32
 
 
33
const char *config_file="drizzle";              /* Default config file */
 
34
uint32_t verbose= 0, opt_defaults_file_used= 0;
31
35
 
32
36
static struct my_option my_long_options[] =
33
37
{
76
80
 
77
81
static void usage(bool version)
78
82
{
79
 
  printf("%s  Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
80
 
         MACHINE_TYPE);
 
83
  printf("%s  Ver 1.6 for %s-%s at %s\n",my_progname,HOST_VENDOR,HOST_OS,
 
84
         HOST_CPU);
81
85
  if (version)
82
86
    return;
83
87
  puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
89
93
  printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
90
94
}
91
95
 
92
 
static bool
93
 
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
94
 
               char *argument __attribute__((unused)))
 
96
bool get_one_option(int optid, const struct my_option *, char *)
95
97
{
96
98
  switch (optid) {
97
99
    case 'c':
149
151
  arguments[count]= 0;
150
152
 
151
153
  /* Check out the args */
152
 
  if (!(load_default_groups=(char**) my_malloc((argc+1)*sizeof(char*),
153
 
                                               MYF(MY_WME))))
 
154
  if (!(load_default_groups=(char**) malloc((argc+1)*sizeof(char*))))
154
155
    exit(1);
155
156
  if (get_options(&argc,&argv))
156
157
    exit(1);
177
178
  free((char*) load_default_groups);
178
179
  free_defaults(arguments);
179
180
 
180
 
  exit(error);
 
181
  return error;
181
182
}