1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01: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
|
|
|
*
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2000-10-21 17:55:29 +02:00
|
|
|
* $Id: large_object.h,v 1.16 2000/10/21 15:55:29 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>
|
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "access/relscan.h"
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This structure will eventually have lots more stuff associated with it.
|
|
|
|
*/
|
2000-10-21 17:55:29 +02:00
|
|
|
typedef struct LargeObjectDesc {
|
|
|
|
Relation heap_r;
|
|
|
|
Relation index_r;
|
1997-09-08 04:41:22 +02:00
|
|
|
uint32 offset; /* current seek pointer */
|
2000-10-21 17:55:29 +02:00
|
|
|
Oid id;
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
#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 */
|
1997-09-08 23:56:23 +02:00
|
|
|
} 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 23:56:23 +02:00
|
|
|
extern void inv_close(LargeObjectDesc *obj_desc);
|
1999-12-10 04:56:14 +01:00
|
|
|
extern int inv_drop(Oid lobjId);
|
1997-09-08 23:56:23 +02:00
|
|
|
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
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* LARGE_OBJECT_H */
|