| 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 | /* In your own module, replace "UDF" & "udf" by your module's name */ |
| 10 | |
| 11 | #ifndef _SQL_UDF_H_ |
| 12 | #define _SQL_UDF_H_ |
| 13 | #include "sql.h" |
| 14 | #include <string.h> |
| 15 | |
| 16 | /* This is required as-is (except from renaming "UDF" & "udf" as suggested |
| 17 | * above) for all modules for correctly exporting function on Unix-like and |
| 18 | * Windows systems. */ |
| 19 | |
| 20 | #ifdef WIN32 |
| 21 | #ifndef LIBUDF |
| 22 | #define udf_export extern __declspec(dllimport) |
| 23 | #else |
| 24 | #define udf_export extern __declspec(dllexport) |
| 25 | #endif |
| 26 | #else |
| 27 | #define udf_export extern |
| 28 | #endif |
| 29 | |
| 30 | /* export MAL wrapper functions */ |
| 31 | |
| 32 | udf_export char * UDFreverse(char **ret, const char **arg); |
| 33 | udf_export char * UDFBATreverse(bat *ret, const bat *arg); |
| 34 | |
| 35 | /* using C macro for convenient type-expansion */ |
| 36 | #define UDFfuse_scalar_decl(in,out) \ |
| 37 | udf_export char * UDFfuse_##in##_##out(out *ret, const in *one, const in *two) |
| 38 | UDFfuse_scalar_decl(bte, sht); |
| 39 | UDFfuse_scalar_decl(sht, int); |
| 40 | UDFfuse_scalar_decl(int, lng); |
| 41 | #ifdef HAVE_HGE |
| 42 | UDFfuse_scalar_decl(lng, hge); |
| 43 | #endif |
| 44 | |
| 45 | udf_export char * UDFBATfuse(bat *ret, const bat *one, const bat *two); |
| 46 | |
| 47 | #endif /* _SQL_UDF_H_ */ |
| 48 | |