~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/ha_archive.h

  • Committer: Monty Taylor
  • Date: 2010-08-03 18:21:58 UTC
  • mto: (1680.2.6 build)
  • mto: This revision was merged to the branch mainline in revision 1683.
  • Revision ID: mordred@inaugust.com-20100803182158-nkmgnlohodud4290
Made existence of intltool and gettext optional.

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
16
#ifndef PLUGIN_ARCHIVE_HA_ARCHIVE_H
17
17
#define PLUGIN_ARCHIVE_HA_ARCHIVE_H
22
22
  ha_example.h.
23
23
*/
24
24
 
 
25
typedef struct st_archive_record_buffer {
 
26
  unsigned char *buffer;
 
27
  uint32_t length;
 
28
} archive_record_buffer;
 
29
 
 
30
 
25
31
class ArchiveShare {
26
32
public:
27
33
  ArchiveShare();
31
37
  bool prime(uint64_t *auto_increment);
32
38
 
33
39
  std::string table_name;
34
 
  std::string data_file_name;
 
40
  char data_file_name[FN_REFLEN];
35
41
  uint32_t use_count;
36
 
  pthread_mutex_t _mutex;
37
 
  drizzled::THR_LOCK _lock;
 
42
  pthread_mutex_t mutex;
 
43
  drizzled::THR_LOCK lock;
38
44
  azio_stream archive_write;     /* Archive file we are working with */
39
45
  bool archive_write_open;
40
46
  bool dirty;               /* Flag for if a flush should occur */
44
50
  uint64_t  version;
45
51
  drizzled::ha_rows rows_recorded;    /* Number of rows in tables */
46
52
  drizzled::ha_rows version_rows;
47
 
 
48
 
  pthread_mutex_t &mutex()
49
 
  {
50
 
    return _mutex;
51
 
  }
52
53
};
53
54
 
54
55
/*
74
75
  const unsigned char *current_key;
75
76
  uint32_t current_key_len;
76
77
  uint32_t current_k_offset;
77
 
  std::vector <unsigned char> record_buffer;
 
78
  archive_record_buffer *record_buffer;
78
79
  bool archive_reader_open;
79
80
 
 
81
  archive_record_buffer *create_record_buffer(unsigned int length);
 
82
  void destroy_record_buffer(archive_record_buffer *r);
 
83
 
80
84
public:
81
85
  ha_archive(drizzled::plugin::StorageEngine &engine_arg,
82
 
             drizzled::Table &table_arg);
 
86
             drizzled::TableShare &table_arg);
83
87
  ~ha_archive()
84
88
  { }
85
89
 
93
97
                         uint32_t key_len,
94
98
                         drizzled::ha_rkey_function find_flag);
95
99
  int index_next(unsigned char * buf);
96
 
  int doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked);
 
100
  int doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked);
97
101
  int open(const char *name, int mode, uint32_t test_if_locked);
98
102
  int close(void);
99
103
  int doInsertRecord(unsigned char * buf);