/*****************************************************************************
 * FreeAdhocUDF - copyright (c) 2004 - 2007 adhoc dataservice GmbH
 * Christoph Theuring / Peter Mandrella / Georg Horn
 * <http://www.udf.adhoc-data.de> eMail <udf@adhoc-data.de>
 * based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 *
 * File Name:	blob_functions.h
 * Description: This header contains the prototype definitions
 *
 * This file is part of FreeAdhocUDF.
 * FreeAdhocUDF is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * FreeAdhocUDF is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with FreeAdhocUDF.  If not, see <http://www.gnu.org/licenses/>. 
*****************************************************************************/

/* Blob passing structure */
// InterBase uses follows, FireBird uses from ibase.h
#ifndef FB_API_VER
typedef struct blobcallback {
    short (*blob_get_segment) (void *hnd, void *buffer, long buf_size, long *result_len);
    isc_blob_handle *blob_handle;
    ISC_LONG blob_number_segments;
    ISC_LONG blob_max_segment;
    ISC_LONG blob_total_length;
    void (*blob_put_segment) (void *hnd, const void *buffer, ISC_USHORT buf_size);
    ISC_LONG(*blob_lseek) (void *hnd, ISC_USHORT mode, ISC_LONG offset);
} *BLOBCALLBACK;
#endif

char * blobaspchar (BLOBCALLBACK);
char * intern_blobaspchar (BLOBCALLBACK, int);
char * blobleft (BLOBCALLBACK, int *);
char * blobmid (BLOBCALLBACK, ISC_LONG *, int *);
char * r_blobmid (BLOBCALLBACK, int *, int *);
char * blobright (BLOBCALLBACK, int *);
ISC_LONG * blobsize (BLOBCALLBACK);
BLOBCALLBACK strblob (char *, BLOBCALLBACK);
BLOBCALLBACK blobcat (BLOBCALLBACK, BLOBCALLBACK, BLOBCALLBACK);
BLOBCALLBACK blobcatstr (BLOBCALLBACK, char *, BLOBCALLBACK);
char * excelblob (BLOBCALLBACK);
BLOBCALLBACK blobreplacestring (BLOBCALLBACK, char *, char *, int *,
    int *, BLOBCALLBACK);
ISC_LONG * blobsegmentcount (BLOBCALLBACK);
ISC_LONG * blobmaxsegmentlength (BLOBCALLBACK);
char * blobline (BLOBCALLBACK, int*);
int * bloblinecount (BLOBCALLBACK);
int * blobcompare (BLOBCALLBACK,BLOBCALLBACK);
int * b_strcmp (BLOBCALLBACK,BLOBCALLBACK);
int * blobsubstr (BLOBCALLBACK,char *);
int * b_strpos (char *, BLOBCALLBACK);
int * b_textpos (char *, BLOBCALLBACK);
int * blobwordcount (BLOBCALLBACK);
