~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin.h

  • Committer: Patrick Crews
  • Date: 2010-07-19 22:50:20 UTC
  • mto: (1663.1.2 rollup)
  • mto: This revision was merged to the branch mainline in revision 1664.
  • Revision ID: gleebix@gmail.com-20100719225020-6lhrjnkq3k9lyq0f
Fix of optimizer.test - needed cleanup at the end + updated .result file

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_PLUGIN_H
21
21
#define DRIZZLED_PLUGIN_H
22
22
 
23
 
#include <drizzled/lex_string.h>
24
 
#include <drizzled/xid.h>
25
 
#include <drizzled/plugin/manifest.h>
26
 
#include <drizzled/plugin/module.h>
 
23
#include "drizzled/module/manifest.h"
 
24
#include "drizzled/module/module.h"
27
25
#include "drizzled/plugin/version.h"
 
26
#include "drizzled/module/context.h"
28
27
#include "drizzled/definitions.h"
29
 
#include "drizzled/plugin/context.h"
30
28
 
 
29
#include "drizzled/lex_string.h"
 
30
#include "drizzled/xid.h"
 
31
#include <boost/program_options.hpp>
31
32
 
32
33
namespace drizzled
33
34
{
56
57
/*
57
58
  Macros for beginning and ending plugin declarations. Between
58
59
  DRIZZLE_DECLARE_PLUGIN and DRIZZLE_DECLARE_PLUGIN_END there should
59
 
  be a plugin::Manifest for each plugin to be declared.
 
60
  be a module::Manifest for each plugin to be declared.
60
61
*/
61
62
 
62
63
 
63
64
#define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
64
65
#define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
65
66
#define DRIZZLE_DECLARE_PLUGIN \
66
 
  ::drizzled::plugin::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)= 
 
67
  ::drizzled::module::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)= 
67
68
 
68
69
 
69
70
#define DRIZZLE_DECLARE_PLUGIN_END
70
 
#define DRIZZLE_PLUGIN(init,system) \
 
71
#define DRIZZLE_PLUGIN(init,system,options) \
71
72
  DRIZZLE_DECLARE_PLUGIN \
72
73
  { \
73
74
    DRIZZLE_VERSION_ID, \
76
77
    STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
77
78
    STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
78
79
    PANDORA_MODULE_LICENSE, \
79
 
    init, system, NULL \
 
80
    init, system, options \
80
81
  } 
81
82
 
82
83
 
188
189
  mysql_var_check_func check;   \
189
190
  mysql_var_update_func update
190
191
 
191
 
#define DRIZZLE_SYSVAR_NAME(name) mysql_sysvar_ ## name
 
192
#define DRIZZLE_SYSVAR_NAME(name) drizzle_sysvar_ ## name
192
193
#define DRIZZLE_SYSVAR(name) \
193
194
  ((drizzle_sys_var *)(&(DRIZZLE_SYSVAR_NAME(name))))
194
195
 
371
372
  Miscellaneous functions for plugin implementors
372
373
*/
373
374
 
374
 
#ifdef __cplusplus
375
 
extern "C" {
376
 
#endif
377
 
 
378
 
extern bool plugin_init(plugin::Registry &registry,
 
375
extern bool plugin_init(module::Registry &registry,
379
376
                        int *argc, char **argv,
380
 
                        bool skip_init);
381
 
extern void plugin_shutdown(plugin::Registry &plugins);
382
 
extern void my_print_help_inc_plugins(option *options);
 
377
                        bool skip_init,
 
378
                        boost::program_options::options_description &long_options);
 
379
extern void my_print_help_inc_plugins(option *options,
 
380
                                      boost::program_options::options_description &long_options);
383
381
extern bool plugin_is_ready(const LEX_STRING *name, int type);
384
382
extern void plugin_sessionvar_init(Session *session);
385
383
extern void plugin_sessionvar_cleanup(Session *session);
426
424
int session_killed(const Session *session);
427
425
 
428
426
 
429
 
/**
430
 
  Return the thread id of a user thread
431
 
 
432
 
  @param session  user thread connection handle
433
 
  @return  thread id
434
 
*/
435
 
unsigned long session_get_thread_id(const Session *session);
436
 
 
437
427
const charset_info_st *session_charset(Session *session);
438
 
int session_non_transactional_update(const Session *session);
439
 
void session_mark_transaction_to_rollback(Session *session, bool all);
440
 
 
441
 
 
442
 
/**
443
 
  Allocate memory in the connection's local memory pool
444
 
 
445
 
  @details
446
 
  When properly used in place of @c malloc(), this can significantly
447
 
  improve concurrency. Don't use this or related functions to allocate
448
 
  large chunks of memory. Use for temporary storage only. The memory
449
 
  will be freed automatically at the end of the statement; no explicit
450
 
  code is required to prevent memory leaks.
451
 
 
452
 
  @see alloc_root()
453
 
*/
454
 
void *session_alloc(Session *session, unsigned int size);
455
 
/**
456
 
  @see session_alloc()
457
 
*/
458
 
void *session_calloc(Session *session, unsigned int size);
459
 
/**
460
 
  @see session_alloc()
461
 
*/
462
 
char *session_strdup(Session *session, const char *str);
463
 
/**
464
 
  @see session_alloc()
465
 
*/
466
 
char *session_strmake(Session *session, const char *str, unsigned int size);
467
 
/**
468
 
  @see session_alloc()
469
 
*/
470
 
void *session_memdup(Session *session, const void* str, unsigned int size);
471
 
 
472
 
/**
473
 
  Get the XID for this connection's transaction
474
 
 
475
 
  @param session  user thread connection handle
476
 
  @param xid  location where identifier is stored
477
 
*/
478
 
void session_get_xid(const Session *session, DRIZZLE_XID *xid);
479
428
 
480
429
/**
481
430
  Invalidate the query cache for a given table.
489
438
                                   const char *key, unsigned int key_length,
490
439
                                   int using_trx);
491
440
 
492
 
#ifdef __cplusplus
493
 
}
494
 
#endif
495
 
 
496
441
} /* namespace drizzled */
497
442
 
498
443
#endif /* DRIZZLED_PLUGIN_H */