~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_qcache.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-21 01:02:23 UTC
  • mto: (960.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 961.
  • Revision ID: osullivan.padraig@gmail.com-20090321010223-j8cph7eeyt1u3xol
Fixed function object to ensure it correctly returns a boolean type since
memcmp returns an integer. Added some more comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
3
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
4
 
 
5
 *  Definitions required for Query Cache plugin
 
6
 
 
7
 *  Copyright (C) 2008 Mark Atwood, Toru Maesaka
 
8
 *
 
9
 *  This program is free software; you can redistribute it and/or modify
 
10
 *  it under the terms of the GNU General Public License as published by
 
11
 *  the Free Software Foundation; version 2 of the License.
 
12
 *
 
13
 *  This program is distributed in the hope that it will be useful,
 
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 *  GNU General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU General Public License
 
19
 *  along with this program; if not, write to the Free Software
 
20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
 */
 
22
 
 
23
#ifndef DRIZZLED_PLUGIN_QCACHE_H
 
24
#define DRIZZLED_PLUGIN_QCACHE_H
 
25
 
 
26
/* 
 
27
  This is the API that a qcache plugin must implement.
 
28
  it should implement each of these function pointers.
 
29
  if a function pointer is NULL (not loaded), that's ok.
 
30
 
 
31
  Return:
 
32
    false = success
 
33
    true  = failure
 
34
*/
 
35
typedef struct qcache_st
 
36
{
 
37
  /* Lookup the cache and transmit the data back to the client */
 
38
  bool (*qcache_try_fetch_and_send)(Session *session, bool transactional);
 
39
 
 
40
  bool (*qcache_set)(Session *session, bool transactional);
 
41
  bool (*qcache_invalidate_table)(Session *session, bool transactional);
 
42
  bool (*qcache_invalidate_db)(Session *session, const char *db_name,
 
43
                               bool transactional);
 
44
  bool (*qcache_flush)(Session *session);
 
45
} qcache_t;
 
46
 
 
47
#endif /* DRIZZLED_PLUGIN_QCACHE_H */