~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/option.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
17
 
#include "drizzled/internal/my_sys.h"
 
16
#include <config.h>
 
17
#include <drizzled/internal/my_sys.h>
18
18
#include <drizzled/gettext.h>
19
19
 
20
 
#include "drizzled/internal/m_string.h"
21
 
#include "drizzled/internal/my_sys.h"
22
 
#include "drizzled/error.h"
23
 
#include "drizzled/option.h"
 
20
#include <drizzled/internal/m_string.h>
 
21
#include <drizzled/internal/my_sys.h>
 
22
#include <drizzled/error.h>
 
23
#include <drizzled/option.h>
 
24
#include <drizzled/typelib.h>
24
25
 
25
26
#include <stdio.h>
26
27
#include <stdlib.h>
643
644
            return EXIT_OUT_OF_MEMORY;
644
645
          break;
645
646
        case GET_ENUM:
646
 
          if (((*(int*)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0)
 
647
          if (((*(int*)result_pos)= opts->typelib->find_type(argument, 2) - 1) < 0)
647
648
            return EXIT_ARGUMENT_INVALID;
648
649
          break;
649
650
        case GET_SET:
650
 
          *((uint64_t*)result_pos)= find_typeset(argument, opts->typelib, &err);
 
651
          *((uint64_t*)result_pos)= opts->typelib->find_typeset(argument, &err);
651
652
          if (err)
652
653
            return EXIT_ARGUMENT_INVALID;
653
654
          break;
723
724
2.) Returns -1 if strings differ, 0 if they are equal
724
725
   */
725
726
 
726
 
  bool getopt_compare_strings(register const char *s, register const char *t,
 
727
  bool getopt_compare_strings(const char *s, const char *t,
727
728
      uint32_t length)
728
729
  {
729
730
    char const *end= s + length;
1234
1235
                if (!(bit & llvalue))
1235
1236
                  continue;
1236
1237
                llvalue&= ~bit;
1237
 
                printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr));
 
1238
                printf( llvalue ? "%s," : "%s\n", optp->typelib->get_type(nr));
1238
1239
              }
1239
1240
            break;
1240
1241
          case GET_ENUM:
1241
 
            printf("%s\n", get_type(optp->typelib, *(uint*) value));
 
1242
            printf("%s\n", optp->typelib->get_type(*(uint*) value));
1242
1243
            break;
1243
1244
          case GET_STR:
1244
1245
          case GET_STR_ALLOC:                    /* fall through */