~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to extra/my_print_defaults.c

  • Committer: Monty Taylor
  • Date: 2008-07-22 05:48:51 UTC
  • mto: (202.1.3 toru)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: monty@inaugust.com-20080722054851-airxt73370725p7x
Re-enabled optimizations for the normal build, and added back the --with-debug option to turn them off. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
**  Written by Monty
21
21
*/
22
22
 
23
 
#include <drizzled/global.h>
24
 
#include <mysys/my_sys.h>
25
 
#include <mystrings/m_string.h>
26
 
#include <mysys/my_getopt.h>
 
23
#include <my_global.h>
 
24
#include <my_sys.h>
 
25
#include <m_string.h>
 
26
#include <my_getopt.h>
27
27
 
28
28
 
29
29
const char *config_file="my";                   /* Default config file */
74
74
  {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
75
75
};
76
76
 
77
 
static void usage(bool version)
 
77
 
 
78
 
 
79
#include <help_start.h>
 
80
 
 
81
static void usage(my_bool version)
78
82
{
79
83
  printf("%s  Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
80
84
         MACHINE_TYPE);
89
93
  printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
90
94
}
91
95
 
 
96
#include <help_end.h>
 
97
 
 
98
 
92
99
static bool
93
100
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
94
101
               char *argument __attribute__((unused)))
145
152
  /* Copy defaults-xxx arguments & program name */
146
153
  count=args_used+1;
147
154
  arguments= tmp_arguments;
148
 
  memcpy(arguments, org_argv, count * sizeof(*org_argv));
 
155
  memcpy((char*) arguments, (char*) org_argv, count * sizeof(*org_argv));
149
156
  arguments[count]= 0;
150
157
 
151
158
  /* Check out the args */
154
161
    exit(1);
155
162
  if (get_options(&argc,&argv))
156
163
    exit(1);
157
 
  memcpy(load_default_groups, argv, (argc + 1) * sizeof(*argv));
 
164
  memcpy((char*) load_default_groups, (char*) argv, (argc + 1) * sizeof(*argv));
158
165
 
159
166
  if ((error= load_defaults(config_file, (const char **) load_default_groups,
160
167
                           &count, &arguments)))
174
181
 
175
182
  for (argument= arguments+1 ; *argument ; argument++)
176
183
    puts(*argument);
177
 
  free((char*) load_default_groups);
 
184
  my_free((char*) load_default_groups,MYF(0));
178
185
  free_defaults(arguments);
179
186
 
180
187
  exit(error);