/*
 * FreeAdhocUDF - copyright (c) 2004 adhoc dataservice GmbH Peter Mandrella
 * based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 * altered 2001 by ADITO Software GmbH Robert Loipfinger
 *
 *  pm = added by Peter Mandrella
 *
 *   blob_functions.h
 *     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
 */

/* Blob passing structure */

#if defined(IB_FIREBIRDSQL)
typedef BLOBCALLBACK BLOB;
#else
typedef 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 * 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 *));

