/*
 * FreeAdhocUDF - copyright (c) 2004 -2006 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.
 *
 *  pm = added by Peter Mandrella
 *  gh = added by Georg Horn
 *
 * BLOb routines declarations:
 *
 *  pm   blobaspchar - convert blob to string
 *  pm   blobleft - get left substring of blob
 *  pm   blobmid - get substring of blob
 *  pm   blobright - get righ substring of blob
 *  pm   strblob - convert string to blob
 *  gh   blobcat - concatenate two blobs
 *  gh   blobcatstr - concatenate a string to a blob
 *  gh   excelblob - convert a blob to a tring suitable for importing in excel
 *  gh   blobreplacestring - replace strings within a blob
 */

/* Blob passing structure */

#if defined(IB_FIREBIRDSQL)
typedef BLOBCALLBACK BLOB;
#else
struct blob {
    short	(*get_segment)(
    			isc_blob_handle *blob_handle,
			void *buffer,
			long bytes_to_read,
			long *bytes_read);
    isc_blob_handle *blob_handle;
    long	blob_number_segments;
    long	blob_max_segment;
    long	blob_total_length;
    void	(*put_segment)(
    			isc_blob_handle *blob_handle,
			void *buffer,
			long bytes_to_write);
    long	(*seek)();
};
#endif // defined(IB_FIREBIRDSQL)

char * blobaspchar PROTO_LIST ((struct blob *));
char * intern_blobaspchar PROTO_LIST ((struct blob *, int));
char * blobleft PROTO_LIST ((struct blob *, int *));
char * blobmid PROTO_LIST ((struct blob *, int *, int *));
char * blobright PROTO_LIST ((struct blob *, int *));
int blobsize PROTO_LIST ((struct blob *));
struct blob *strblob PROTO_LIST ((char *, struct blob *));
struct blob *blobcat PROTO_LIST ((struct blob *, struct blob *, struct blob *));
struct blob *blobcatstr PROTO_LIST ((struct blob *, char *, struct blob *));
char *excelblob PROTO_LIST ((struct blob *b));
struct blob *blobreplacestring PROTO_LIST((struct blob *b, char *subs,
    char *replby, int *all, int *case_insensitive, struct blob *result));
int blobsegmentcount PROTO_LIST ((struct blob*));
int blobmaxsegmentlength PROTO_LIST ((struct blob*));
char * blobline PROTO_LIST ((struct blob *, int*));
int bloblinecount PROTO_LIST ((struct blob *));
int blobcompare PROTO_LIST ((struct blob *,struct blob *));
int blobsubstr PROTO_LIST ((struct blob *,char *));

// Integer-Parameter sind Zeiger !!!


