1 /*-------------------------------------------------------------------------
2  *
3  * be-fsstubs.h
4  *
5  *
6  *
7  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/libpq/be-fsstubs.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef BE_FSSTUBS_H
15 #define BE_FSSTUBS_H
16 
17 #include "fmgr.h"
18 
19 /*
20  * LO functions available via pg_proc entries
21  */
22 extern Datum lo_import(PG_FUNCTION_ARGS);
23 extern Datum lo_import_with_oid(PG_FUNCTION_ARGS);
24 extern Datum lo_export(PG_FUNCTION_ARGS);
25 
26 extern Datum lo_creat(PG_FUNCTION_ARGS);
27 extern Datum lo_create(PG_FUNCTION_ARGS);
28 extern Datum lo_from_bytea(PG_FUNCTION_ARGS);
29 
30 extern Datum lo_open(PG_FUNCTION_ARGS);
31 extern Datum lo_close(PG_FUNCTION_ARGS);
32 
33 extern Datum loread(PG_FUNCTION_ARGS);
34 extern Datum lowrite(PG_FUNCTION_ARGS);
35 
36 extern Datum lo_get(PG_FUNCTION_ARGS);
37 extern Datum lo_get_fragment(PG_FUNCTION_ARGS);
38 extern Datum lo_put(PG_FUNCTION_ARGS);
39 
40 extern Datum lo_lseek(PG_FUNCTION_ARGS);
41 extern Datum lo_tell(PG_FUNCTION_ARGS);
42 extern Datum lo_lseek64(PG_FUNCTION_ARGS);
43 extern Datum lo_tell64(PG_FUNCTION_ARGS);
44 extern Datum lo_unlink(PG_FUNCTION_ARGS);
45 extern Datum lo_truncate(PG_FUNCTION_ARGS);
46 extern Datum lo_truncate64(PG_FUNCTION_ARGS);
47 
48 /*
49  * compatibility option for access control
50  */
51 extern bool lo_compat_privileges;
52 
53 /*
54  * These are not fmgr-callable, but are available to C code.
55  * Probably these should have had the underscore-free names,
56  * but too late now...
57  */
58 extern int	lo_read(int fd, char *buf, int len);
59 extern int	lo_write(int fd, const char *buf, int len);
60 
61 /*
62  * Cleanup LOs at xact commit/abort
63  */
64 extern void AtEOXact_LargeObject(bool isCommit);
65 extern void AtEOSubXact_LargeObject(bool isCommit, SubTransactionId mySubid,
66 						SubTransactionId parentSubid);
67 
68 #endif   /* BE_FSSTUBS_H */
69