~jaypipes/drizzle/transaction_log

« back to all changes in this revision

Viewing changes to drizzled/plugin.h

  • Committer: Jay Pipes
  • Date: 2009-12-22 03:07:38 UTC
  • mfrom: (1143.14.85 build)
  • Revision ID: jpipes@serialcoder-20091222030738-gnb0vyg77fmkt4cj
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/xid.h>
25
25
#include <drizzled/plugin/manifest.h>
26
26
#include <drizzled/plugin/module.h>
 
27
#include "drizzled/configmake.h"
 
28
 
27
29
 
28
30
class Session;
29
31
class Item;
52
54
*/
53
55
 
54
56
 
55
 
#if defined(PANDORA_DYNAMIC_PLUGIN)
56
 
# define DRIZZLE_DECLARE_PLUGIN \
57
 
    drizzled::plugin::Manifest _drizzled_plugin_declaration_[]= {
58
 
#else
59
 
# define PANDORA_BUILTIN_NAME(x) builtin_ ## x ## _plugin
60
 
# define PANDORA_NAME(x) PANDORA_BUILTIN_NAME(x)
61
 
# define DRIZZLE_DECLARE_PLUGIN \
62
 
           drizzled::plugin::Manifest PANDORA_NAME(PANDORA_MODULE_NAME)[]= {
63
 
#endif
64
 
 
65
 
 
66
 
#define DRIZZLE_DECLARE_PLUGIN_END ,{0,0,0,0,PLUGIN_LICENSE_GPL,0,0,0,0,0}}
67
 
 
68
 
 
69
 
 
70
 
/*
71
 
  the following flags are valid for plugin_init()
72
 
*/
73
 
#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1
74
 
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE    2
75
 
#define PLUGIN_INIT_SKIP_INITIALIZATION  4
76
 
 
77
 
#define INITIAL_LEX_PLUGIN_LIST_SIZE    16
 
57
#define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
 
58
#define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
 
59
#define DRIZZLE_DECLARE_PLUGIN \
 
60
           drizzled::plugin::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)= 
 
61
 
 
62
 
 
63
#define DRIZZLE_DECLARE_PLUGIN_END
 
64
#define DRIZZLE_PLUGIN(init,deinit,status,system) \
 
65
  DRIZZLE_DECLARE_PLUGIN \
 
66
  { \
 
67
    DRIZZLE_VERSION_ID, \
 
68
    STRINGIFY_ARG(PANDORA_MODULE_NAME), \
 
69
    STRINGIFY_ARG(PANDORA_MODULE_VERSION), \
 
70
    STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
 
71
    STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
 
72
    PANDORA_MODULE_LICENSE, \
 
73
    init, deinit, status, system, NULL \
 
74
  } 
 
75
 
78
76
 
79
77
/*
80
78
  declarations for SHOW STATUS support in plugins
390
388
extern "C" {
391
389
#endif
392
390
 
393
 
extern int plugin_init(drizzled::plugin::Registry &plugins,
394
 
                       int *argc, char **argv, int init_flags);
 
391
extern bool plugin_init(drizzled::plugin::Registry &registry,
 
392
                        int *argc, char **argv,
 
393
                        bool skip_init);
395
394
extern void plugin_shutdown(drizzled::plugin::Registry &plugins);
396
395
extern void my_print_help_inc_plugins(my_option *options);
397
396
extern bool plugin_is_ready(const LEX_STRING *name, int type);
398
 
extern bool mysql_install_plugin(Session *session, const LEX_STRING *name,
399
 
                                 const LEX_STRING *dl);
400
 
extern bool mysql_uninstall_plugin(Session *session, const LEX_STRING *name);
401
397
extern void plugin_sessionvar_init(Session *session);
402
398
extern void plugin_sessionvar_cleanup(Session *session);
403
399
extern sys_var *intern_find_sys_var(const char *str, uint32_t, bool no_error);
408
404
const char *get_session_proc_info(Session *session);
409
405
int64_t session_test_options(const Session *session, int64_t test_options);
410
406
int session_sql_command(const Session *session);
411
 
void **session_ha_data(const Session *session, const drizzled::plugin::StorageEngine *engine);
412
407
int session_tx_isolation(const Session *session);
413
408
 
414
 
LEX_STRING *session_make_lex_string(Session *session, LEX_STRING *lex_str,
415
 
                                    const char *str, unsigned int size,
416
 
                                    int allocate_lex_string);
417
 
 
418
409
 
419
410
 
420
411
/**
516
507
}
517
508
#endif
518
509
 
519
 
#ifdef __cplusplus
520
 
/**
521
 
  Provide a handler data getter to simplify coding
522
 
*/
523
 
inline
524
 
void *
525
 
session_get_ha_data(const Session *session, const drizzled::plugin::StorageEngine *engine)
526
 
{
527
 
  return *session_ha_data(session, engine);
528
 
}
529
 
 
530
 
/**
531
 
  Provide a handler data setter to simplify coding
532
 
*/
533
 
inline
534
 
void
535
 
session_set_ha_data(const Session *session, const drizzled::plugin::StorageEngine *engine,
536
 
                const void *ha_data)
537
 
{
538
 
  *session_ha_data(session, engine)= (void*) ha_data;
539
 
}
540
 
#endif
541
 
 
542
510
#endif /* DRIZZLED_PLUGIN_H */
543
511