1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* large_object.h--
|
1997-09-07 07:04:48 +02:00
|
|
|
* file of info for Postgres large objects. POSTGRES 4.2 supports
|
|
|
|
* zillions of large objects (internal, external, jaquith, inversion).
|
|
|
|
* Now we only support inversion.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1997-09-08 04:41:22 +02:00
|
|
|
* $Id: large_object.h,v 1.6 1997/09/08 02:39:03 momjian Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef LARGE_OBJECT_H
|
|
|
|
#define LARGE_OBJECT_H
|
1996-08-28 03:59:28 +02:00
|
|
|
|
1996-11-05 07:11:08 +01:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <access/relscan.h>
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This structure will eventually have lots more stuff associated with it.
|
|
|
|
*/
|
|
|
|
typedef struct LargeObjectDesc
|
|
|
|
{
|
1997-09-08 04:41:22 +02:00
|
|
|
Relation heap_r; /* heap relation */
|
|
|
|
Relation index_r; /* index relation on seqno attribute */
|
|
|
|
IndexScanDesc iscan; /* index scan we're using */
|
|
|
|
TupleDesc hdesc; /* heap relation tuple desc */
|
|
|
|
TupleDesc idesc; /* index relation tuple desc */
|
|
|
|
uint32 lowbyte; /* low byte on the current page */
|
|
|
|
uint32 highbyte; /* high byte on the current page */
|
|
|
|
uint32 offset; /* current seek pointer */
|
1997-09-07 07:04:48 +02:00
|
|
|
ItemPointerData htid; /* tid of current heap tuple */
|
|
|
|
|
|
|
|
#define IFS_RDLOCK (1 << 0)
|
|
|
|
#define IFS_WRLOCK (1 << 1)
|
|
|
|
#define IFS_ATEOF (1 << 2)
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
u_long flags; /* locking info, etc */
|
|
|
|
} LargeObjectDesc;
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Function definitions...
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* inversion stuff in inv_api.c */
|
|
|
|
extern LargeObjectDesc *inv_create(int flags);
|
|
|
|
extern LargeObjectDesc *inv_open(Oid lobjId, int flags);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void inv_close(LargeObjectDesc * obj_desc);
|
|
|
|
extern int inv_destroy(Oid lobjId);
|
|
|
|
extern int inv_seek(LargeObjectDesc * obj_desc, int offset, int whence);
|
|
|
|
extern int inv_tell(LargeObjectDesc * obj_desc);
|
|
|
|
extern int inv_read(LargeObjectDesc * obj_desc, char *buf, int nbytes);
|
|
|
|
extern int inv_write(LargeObjectDesc * obj_desc, char *buf, int nbytes);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
#endif /* LARGE_OBJECT_H */
|