~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/option.cc

  • Committer: Mark Atwood
  • Date: 2010-06-24 03:15:21 UTC
  • mto: (1637.2.4 build)
  • mto: This revision was merged to the branch mainline in revision 1639.
  • Revision ID: me@mark.atwood.name-20100624031521-gafmppfbf5afm68w
new syslog module, with plugins for query log, error message, and SYSLOG() function

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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>
24
 
#include <drizzled/typelib.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"
25
24
 
26
25
#include <stdio.h>
27
26
#include <stdlib.h>
563
562
  {
564
563
    char *ptr, *end;
565
564
 
566
 
    ptr= NULL; //Options with '.' are now supported.
 
565
    ptr= strrchr(cur_arg + 1, '.'); /* Skip the first character */
567
566
    end= strrchr(cur_arg, '=');
568
567
 
569
568
    /*
644
643
            return EXIT_OUT_OF_MEMORY;
645
644
          break;
646
645
        case GET_ENUM:
647
 
          if (((*(int*)result_pos)= opts->typelib->find_type(argument, 2) - 1) < 0)
 
646
          if (((*(int*)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0)
648
647
            return EXIT_ARGUMENT_INVALID;
649
648
          break;
650
649
        case GET_SET:
651
 
          *((uint64_t*)result_pos)= opts->typelib->find_typeset(argument, &err);
 
650
          *((uint64_t*)result_pos)= find_typeset(argument, opts->typelib, &err);
652
651
          if (err)
653
652
            return EXIT_ARGUMENT_INVALID;
654
653
          break;
724
723
2.) Returns -1 if strings differ, 0 if they are equal
725
724
   */
726
725
 
727
 
  bool getopt_compare_strings(const char *s, const char *t,
 
726
  bool getopt_compare_strings(register const char *s, register const char *t,
728
727
      uint32_t length)
729
728
  {
730
729
    char const *end= s + length;
1235
1234
                if (!(bit & llvalue))
1236
1235
                  continue;
1237
1236
                llvalue&= ~bit;
1238
 
                printf( llvalue ? "%s," : "%s\n", optp->typelib->get_type(nr));
 
1237
                printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr));
1239
1238
              }
1240
1239
            break;
1241
1240
          case GET_ENUM:
1242
 
            printf("%s\n", optp->typelib->get_type(*(uint*) value));
 
1241
            printf("%s\n", get_type(optp->typelib, *(uint*) value));
1243
1242
            break;
1244
1243
          case GET_STR:
1245
1244
          case GET_STR_ALLOC:                    /* fall through */