+
+
+;;; Large objects support (MB)
+
+(defconstant +INV_ARCHIVE+ 65536) ; fe-lobj.c
+(defconstant +INV_WRITE+ 131072)
+(defconstant +INV_READ+ 262144)
+
+(declaim (inline lo-creat))
+(uffi:def-function ("lo_creat" lo-create)
+ ((conn pgsql-conn)
+ (mode :int))
+ :module "postgresql"
+ :returning pgsql-oid)
+
+(declaim (inline lo-open))
+(uffi:def-function ("lo_open" lo-open)
+ ((conn pgsql-conn)
+ (oid pgsql-oid)
+ (mode :int))
+ :module "postgresql"
+ :returning :int)
+
+(declaim (inline lo-write))
+(uffi:def-function ("lo_write" lo-write)
+ ((conn pgsql-conn)
+ (fd :int)
+ (data :cstring)
+ (size :int))
+ :module "postgresql"
+ :returning :int)
+
+(declaim (inline lo-read))
+(uffi:def-function ("lo_read" lo-read)
+ ((conn pgsql-conn)
+ (fd :int)
+ (data (* :unsigned-char))
+ (size :int))
+ :module "postgresql"
+ :returning :int)
+
+(declaim (inline lo-lseek))
+(uffi:def-function ("lo_lseek" lo-lseek)
+ ((conn pgsql-conn)
+ (fd :int)
+ (offset :int)
+ (whence :int))
+ :module "postgresql"
+ :returning :int)
+
+(declaim (inline lo-close))
+(uffi:def-function ("lo_close" lo-close)
+ ((conn pgsql-conn)
+ (fd :int))
+ :module "postgresql"
+ :returning :int)
+
+(declaim (inline lo-unlink))
+(uffi:def-function ("lo_unlink" lo-unlink)
+ ((conn pgsql-conn)
+ (oid pgsql-oid))
+ :module "postgresql"
+ :returning :int)