~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/archive_reader.cc

  • Committer: lbieber
  • Date: 2010-10-01 12:16:18 UTC
  • mfrom: (1802.1.1 fix-bug-651256)
  • Revision ID: lbieber@orisndriz08-20101001121618-uqcboygpjwbiglem
Merge Vijay - fix bug 651256 - Remove --help-extended

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2006 MySQL AB
5
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (c) 2006 MySQL AB
 
5
 *  Copyright (c) 2009 Sun Microsystems, Inc.
6
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
8
8
 *  it under the terms of the GNU General Public License as published by
25
25
#include <drizzled/configmake.h>
26
26
using namespace std;
27
27
#include <boost/program_options.hpp>
28
 
#include <boost/scoped_ptr.hpp>
29
28
namespace po= boost::program_options;
30
29
#include "azio.h"
31
30
#include <string.h>
33
32
#include <stdio.h>
34
33
#include <stdarg.h>
35
34
#include <fcntl.h>
36
 
#include <memory>
37
35
#include "drizzled/charset_info.h"
38
36
#include "drizzled/internal/m_string.h"
39
37
 
87
85
  ;
88
86
 
89
87
  unsigned int ret;
90
 
  boost::scoped_ptr<azio_stream> reader_handle_ap(new azio_stream);
91
 
  azio_stream &reader_handle= *reader_handle_ap.get();
 
88
  azio_stream reader_handle;
92
89
 
93
90
  std::string system_config_dir_archive_reader(SYSCONFDIR); 
94
91
  system_config_dir_archive_reader.append("/drizzle/archive_reader.cnf");
95
92
 
96
93
  std::string user_config_dir((getenv("XDG_CONFIG_HOME")? getenv("XDG_CONFIG_HOME"):"~/.config"));
97
 
 
98
 
  if (user_config_dir.compare(0, 2, "~/") == 0)
99
 
  {
100
 
    char *homedir;
101
 
    homedir= getenv("HOME");
102
 
    if (homedir != NULL)
103
 
      user_config_dir.replace(0, 1, homedir);
104
 
  }
105
94
  
106
95
  po::options_description long_options("Allowed Options");
107
96
  long_options.add(commandline_options).add(archive_reader_options);
166
155
 
167
156
  if (opt_autoincrement)
168
157
  {
169
 
    boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
170
 
    azio_stream &writer_handle= *writer_handle_ap.get();
 
158
    azio_stream writer_handle;
171
159
 
172
160
    if (new_auto_increment_value)
173
161
    {
264
252
    uint64_t row_count= 0;
265
253
    char *buffer;
266
254
 
267
 
    boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
268
 
    azio_stream &writer_handle= *writer_handle_ap.get();
 
255
    azio_stream writer_handle;
269
256
 
270
257
    buffer= (char *)malloc(reader_handle.longest_row);
271
258
    if (buffer == NULL)