/*
 * FreeAdhocUDF - copyright (c) 2004 - 2007 adhoc dataservice GmbH
 * Christoph Theuring / Peter Mandrella / Georg Horn
 * based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 *
 * File Name:	blob_functions.h
 * Description: This header contains the prototype definitions
 *
 * Software distributed under the License is distributed on an
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
 * or implied. See the License for the specific language governing
 * rights and limitations under the License.
 */

/* 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);
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);
