| 1 | /* |
| 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | * |
| 6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
| 7 | */ |
| 8 | |
| 9 | #ifndef BAT_UTILS_H |
| 10 | #define BAT_UTILS_H |
| 11 | |
| 12 | #include "sql_storage.h" |
| 13 | #include "gdk_logger.h" |
| 14 | |
| 15 | /* when returning a log_bid, errors are reported using BID_NIL */ |
| 16 | #define BID_NIL 0 |
| 17 | |
| 18 | #define bat_set_access(b,access) b->batRestricted = access |
| 19 | |
| 20 | extern BAT *temp_descriptor(log_bid b); |
| 21 | extern BAT *quick_descriptor(log_bid b); |
| 22 | extern void temp_destroy(log_bid b); |
| 23 | extern void temp_dup(log_bid b); |
| 24 | extern log_bid temp_create(BAT *b); |
| 25 | extern log_bid temp_copy(log_bid b, int temp); |
| 26 | |
| 27 | extern void bat_destroy(BAT *b); |
| 28 | extern BAT *bat_new(int tt, BUN size, role_t role); |
| 29 | extern void bat_clear(BAT *b); |
| 30 | |
| 31 | extern BUN append_inserted(BAT *b, BAT *i ); |
| 32 | |
| 33 | extern BAT *ebats[MAXATOMS]; |
| 34 | |
| 35 | #define isEbat(b) (ebats[b->ttype] && ebats[b->ttype] == b) |
| 36 | |
| 37 | extern log_bid ebat2real(log_bid b, oid ibase); |
| 38 | extern log_bid e_bat(int type); |
| 39 | extern BAT *e_BAT(int type); |
| 40 | extern log_bid ebat_copy(log_bid b, oid ibase, int temp); |
| 41 | extern int bat_utils_init(void); |
| 42 | |
| 43 | extern sql_table * tr_find_table( sql_trans *tr, sql_table *t); |
| 44 | extern sql_column * tr_find_column( sql_trans *tr, sql_column *c); |
| 45 | extern sql_idx * tr_find_idx( sql_trans *tr, sql_idx *i); |
| 46 | |
| 47 | |
| 48 | #endif /* BAT_UTILS_H */ |
| 49 | |