summaryrefslogtreecommitdiff
path: root/src/include/storage/large_object.h
blob: 77990c56335a88714efaaa24a37f990d35640535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*-------------------------------------------------------------------------
 *
 * large_object.h
 *	  file of info for Postgres large objects. POSTGRES 4.2 supports
 *	  zillions of large objects (internal, external, jaquith, inversion).
 *	  Now we only support inversion.
 *
 * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * $Id: large_object.h,v 1.16 2000/10/21 15:55:29 momjian Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef LARGE_OBJECT_H
#define LARGE_OBJECT_H

#include <sys/types.h>

#include "access/relscan.h"

/*
 * This structure will eventually have lots more stuff associated with it.
 */
typedef struct LargeObjectDesc {
	Relation	heap_r;
	Relation	index_r;
	uint32		offset;			/* current seek pointer */
	Oid		id;

#define IFS_RDLOCK		(1 << 0)
#define IFS_WRLOCK		(1 << 1)
#define IFS_ATEOF		(1 << 2)

	u_long		flags;			/* locking info, etc */
} LargeObjectDesc;

/*
 * Function definitions...
 */

/* inversion stuff in inv_api.c */
extern LargeObjectDesc *inv_create(int flags);
extern LargeObjectDesc *inv_open(Oid lobjId, int flags);
extern void inv_close(LargeObjectDesc *obj_desc);
extern int	inv_drop(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);

#endif	 /* LARGE_OBJECT_H */