/*
 * 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.
 */

/* 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 (struct blob *);
char * intern_blobaspchar (struct blob *, int);
char * blobleft (struct blob *, int *);
char * blobmid (struct blob *, int *, int *);
char * r_blobmid (struct blob *, int *, int *);
char * blobright (struct blob *, int *);
int * blobsize (struct blob *);
struct blob *strblob (char *, struct blob *);
struct blob *blobcat (struct blob *, struct blob *, struct blob *);
struct blob *blobcatstr (struct blob *, char *, struct blob *);
char *excelblob (struct blob *b);
struct blob *blobreplacestring (struct blob *b, char *subs, char *replby, int *all, int *case_insensitive, struct blob *result);
int * blobsegmentcount (struct blob*);
int * blobmaxsegmentlength (struct blob*);
char * blobline (struct blob *, int*);
int * bloblinecount (struct blob *);
int * blobcompare (struct blob *,struct blob *);
int * b_strcmp (struct blob *,struct blob *);
int * blobsubstr (struct blob *,char *);
int * b_strpos (char *, struct blob *);
int * b_textpos (char *, struct blob *);
int * blobwordcount (struct blob *);
