1/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
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 */
15
16#ifndef DISCOVER_INCLUDED
17#define DISCOVER_INCLUDED
18
19int extension_based_table_discovery(MY_DIR *dirp, const char *ext,
20 handlerton::discovered_list *tl);
21
22#ifdef MYSQL_SERVER
23int readfrm(const char *name, const uchar **data, size_t *length);
24int writefrm(const char *path, const char *db, const char *table,
25 bool tmp_table, const uchar *frmdata, size_t len);
26
27/* a helper to delete an frm file, given a path w/o .frm extension */
28inline void deletefrm(const char *path)
29{
30 char frm_name[FN_REFLEN];
31 strxmov(frm_name, path, reg_ext, NullS);
32 mysql_file_delete(key_file_frm, frm_name, MYF(0));
33}
34
35int ext_table_discovery_simple(MY_DIR *dirp,
36 handlerton::discovered_list *result);
37#endif
38
39#endif /* DISCOVER_INCLUDED */
40