| 1 | /* Copyright (c) 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 Foundation, |
| 14 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ |
| 15 | |
| 16 | |
| 17 | #ifndef SQL_BOOTSTRAP_H |
| 18 | #define SQL_BOOTSTRAP_H |
| 19 | |
| 20 | /** |
| 21 | The maximum size of a bootstrap query. |
| 22 | Increase this size if parsing a longer query during bootstrap is necessary. |
| 23 | The longest query in use depends on the documentation content, |
| 24 | see the file fill_help_tables.sql |
| 25 | */ |
| 26 | #define MAX_BOOTSTRAP_QUERY_SIZE 20000 |
| 27 | /** |
| 28 | The maximum size of a bootstrap query, expressed in a single line. |
| 29 | Do not increase this size, use the multiline syntax instead. |
| 30 | */ |
| 31 | #define MAX_BOOTSTRAP_LINE_SIZE 20000 |
| 32 | #define MAX_BOOTSTRAP_ERROR_LEN 256 |
| 33 | |
| 34 | #define READ_BOOTSTRAP_SUCCESS 0 |
| 35 | #define READ_BOOTSTRAP_EOF 1 |
| 36 | #define READ_BOOTSTRAP_ERROR 2 |
| 37 | #define READ_BOOTSTRAP_QUERY_SIZE 3 |
| 38 | |
| 39 | typedef void *fgets_input_t; |
| 40 | typedef char * (*fgets_fn_t)(char *, size_t, fgets_input_t, int *error); |
| 41 | |
| 42 | int read_bootstrap_query(char *query, int *query_length, |
| 43 | fgets_input_t input, fgets_fn_t fgets_fn, int *error); |
| 44 | |
| 45 | #endif |
| 46 | |
| 47 | |
| 48 | |