~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/resolve_stack_dump.cc

Moved the last of the libdrizzleclient calls into Protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
   versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <cstdio>
23
 
#include <cerrno>
24
 
 
25
 
#include "drizzled/charset_info.h"
26
 
#include "drizzled/internal/my_sys.h"
27
 
#include "drizzled/internal/m_string.h"
28
 
#include "drizzled/option.h"
29
 
 
30
 
using namespace drizzled;
 
20
#include <drizzled/global.h>
 
21
#include <mystrings/m_ctype.h>
 
22
#include <mysys/my_sys.h>
 
23
#include <mystrings/m_string.h>
 
24
#include <errno.h>
 
25
#include <mysys/my_getopt.h>
 
26
#include <stdio.h>
31
27
 
32
28
#define INIT_SYM_TABLE  4096
33
29
#define INC_SYM_TABLE  4096
35
31
#define DUMP_VERSION "1.4"
36
32
#define HEX_INVALID  (unsigned char)255
37
33
 
 
34
 
38
35
typedef struct sym_entry
39
36
{
40
37
  char symbol[MAX_SYM_SIZE];
46
43
static DYNAMIC_ARRAY sym_table; /* how do you like this , static DYNAMIC ? */
47
44
static FILE* fp_dump, *fp_sym = 0, *fp_out;
48
45
 
49
 
static struct option my_long_options[] =
 
46
static struct my_option my_long_options[] =
50
47
{
51
48
  {"help", 'h', "Display this help and exit.",
52
49
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
65
62
 
66
63
static void print_version(void)
67
64
{
68
 
  printf("%s  Ver %s Distrib %s, for %s-%s (%s)\n",internal::my_progname,DUMP_VERSION,
69
 
         VERSION,HOST_VENDOR,HOST_OS,HOST_CPU);
 
65
  printf("%s  Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
 
66
         VERSION,SYSTEM_TYPE,MACHINE_TYPE);
70
67
}
71
68
 
72
69
 
77
74
  printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
78
75
  printf("Resolve numeric stack strace dump into symbols.\n\n");
79
76
  printf("Usage: %s [OPTIONS] symbols-file [numeric-dump-file]\n",
80
 
         internal::my_progname);
 
77
         my_progname);
81
78
  my_print_help(my_long_options);
82
79
  my_print_variables(my_long_options);
83
80
  printf("\n\
90
87
{
91
88
  va_list args;
92
89
  va_start(args, fmt);
93
 
  fprintf(stderr, "%s: ", internal::my_progname);
 
90
  fprintf(stderr, "%s: ", my_progname);
94
91
  vfprintf(stderr, fmt, args);
95
92
  fprintf(stderr, "\n");
96
93
  va_end(args);
98
95
}
99
96
 
100
97
 
101
 
static int get_one_option(int optid, const struct option *, char *)
 
98
extern "C"
 
99
bool get_one_option(int optid, const struct my_option *, char *)
102
100
{
103
101
  switch(optid) {
104
102
  case 'V':