~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/include/storage/buffile.h

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * buffile.h
 
4
 *        Management of large buffered files, primarily temporary files.
 
5
 *
 
6
 * The BufFile routines provide a partial replacement for stdio atop
 
7
 * virtual file descriptors managed by fd.c.  Currently they only support
 
8
 * buffered access to a virtual file, without any of stdio's formatting
 
9
 * features.  That's enough for immediate needs, but the set of facilities
 
10
 * could be expanded if necessary.
 
11
 *
 
12
 * BufFile also supports working with temporary files that exceed the OS
 
13
 * file size limit and/or the largest offset representable in an int.
 
14
 * It might be better to split that out as a separately accessible module,
 
15
 * but currently we have no need for oversize temp files without buffered
 
16
 * access.
 
17
 *
 
18
 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
 
19
 * Portions Copyright (c) 1994, Regents of the University of California
 
20
 *
 
21
 * $PostgreSQL: pgsql/src/include/storage/buffile.h,v 1.18 2004-12-31 22:03:42 pgsql Exp $
 
22
 *
 
23
 *-------------------------------------------------------------------------
 
24
 */
 
25
 
 
26
#ifndef BUFFILE_H
 
27
#define BUFFILE_H
 
28
 
 
29
/* BufFile is an opaque type whose details are not known outside buffile.c. */
 
30
 
 
31
typedef struct BufFile BufFile;
 
32
 
 
33
/*
 
34
 * prototypes for functions in buffile.c
 
35
 */
 
36
 
 
37
extern BufFile *BufFileCreateTemp(bool interXact);
 
38
extern void BufFileClose(BufFile *file);
 
39
extern size_t BufFileRead(BufFile *file, void *ptr, size_t size);
 
40
extern size_t BufFileWrite(BufFile *file, void *ptr, size_t size);
 
41
extern int      BufFileSeek(BufFile *file, int fileno, long offset, int whence);
 
42
extern void BufFileTell(BufFile *file, int *fileno, long *offset);
 
43
extern int      BufFileSeekBlock(BufFile *file, long blknum);
 
44
 
 
45
#endif   /* BUFFILE_H */