~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/sys_var.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-21 16:39:40 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20101221163940-c1pfo1jjvx7909xq
Tags: 2010.12.06-0ubuntu1
* New upstream release.
* Added libaio-dev build depend for InnoDB.
* Removed libpcre patch - applied upstream.

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) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
36
36
{
37
37
 
38
38
class sys_var;
39
 
class sys_var_pluginvar; /* opaque */
40
39
class Time_zone;
41
40
typedef struct my_locale_st MY_LOCALE;
42
41
 
90
89
{
91
90
protected:
92
91
  std::string name; /**< The name of the variable */
 
92
  sys_check_func check_func;
93
93
  sys_after_update_func after_update; /**< Function pointer triggered after the variable's value is updated */
94
94
  struct option *option_limits; /**< Updated by by sys_var_init() */
95
95
  bool m_allow_empty_value; /**< Does variable allow an empty value? */
96
96
public:
97
 
  sys_var(const std::string &name_arg, sys_after_update_func func= NULL)
 
97
  sys_var(const std::string &name_arg,
 
98
          sys_after_update_func func= NULL,
 
99
          sys_check_func check_func_arg= NULL)
98
100
    :
99
101
    name(name_arg),
 
102
    check_func(check_func_arg),
100
103
    after_update(func),
101
104
    option_limits(NULL),
102
105
    m_allow_empty_value(true)
180
183
  {
181
184
    return 0;
182
185
  }
183
 
  virtual sys_var_pluginvar *cast_pluginvar()
184
 
  {
185
 
    return 0;
186
 
  }
187
186
};
188
187
 
189
188
/**
360
359
public:
361
360
  char *value;                                  // Pointer to allocated string
362
361
  uint32_t value_length;
363
 
  sys_check_func check_func;
364
362
  sys_update_func update_func;
365
363
  sys_set_default_func set_default_func;
366
364
  sys_var_str(const char *name_arg,
367
365
              sys_check_func check_func_arg,
368
366
              sys_update_func update_func_arg,
369
367
              sys_set_default_func set_default_func_arg,
370
 
              char *value_arg)
371
 
    :sys_var(name_arg), value(value_arg), check_func(check_func_arg),
372
 
    update_func(update_func_arg),set_default_func(set_default_func_arg)
 
368
              char *value_arg) :
 
369
    sys_var(name_arg, NULL, check_func_arg),
 
370
    value(value_arg),
 
371
    update_func(update_func_arg),
 
372
    set_default_func(set_default_func_arg)
373
373
  {  }
374
374
  bool check(Session *session, set_var *var);
375
375
  bool update(Session *session, set_var *var)
450
450
    default_value(value_arg.get())
451
451
  { }
452
452
 
 
453
  sys_var_constrained_value(const char *name_arg,
 
454
                            constrained_value<T> &value_arg,
 
455
                            sys_check_func check_func_arg) :
 
456
    sys_var(name_arg, NULL, check_func_arg),
 
457
    value(value_arg),
 
458
    default_value(value_arg.get())
 
459
  { }
453
460
 
454
461
public:
455
462
  bool is_readonly() const
1150
1157
*/
1151
1158
 
1152
1159
drizzle_show_var* enumerate_sys_vars(Session *session);
1153
 
void drizzle_add_plugin_sysvar(sys_var_pluginvar *var);
1154
 
void drizzle_del_plugin_sysvar();
1155
1160
void add_sys_var_to_list(sys_var *var, struct option *long_options);
1156
1161
void add_sys_var_to_list(sys_var *var);
1157
1162
sys_var *find_sys_var(const char *str, uint32_t length=0);