1
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
// % Project : GUSI - Grand Unified Socket Interface
3
// % File : GUSIFSWrappers.nw - Pseudo-synchronous file calls
4
// % Author : Matthias Neeracher
7
// % $Log: GUSIFSWrappers.h,v $
8
// % Revision 1.1 2001/03/11 22:35:14 sgehani%netscape.com
11
// % Revision 1.7 2001/01/17 08:45:49 neeri
12
// % Make open calls synchronous
14
// % Revision 1.6 2000/05/23 06:58:04 neeri
15
// % Improve formatting
17
// % Revision 1.5 2000/01/17 01:41:52 neeri
18
// % Handle special cases in FSMoveRename
20
// % Revision 1.4 1999/08/26 05:45:01 neeri
21
// % Fixes for literate edition of source code
23
// % Revision 1.3 1999/07/19 06:21:02 neeri
24
// % Add mkdir/rmdir, fix various file manager related bugs
26
// % Revision 1.2 1999/05/30 02:16:54 neeri
27
// % Cleaner definition of GUSICatInfo
29
// % Revision 1.1 1998/10/11 16:45:14 neeri
30
// % Ready to release 2.0a2
32
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34
// \chapter{Pseudo-synchronous File System Calls}
36
// MacOS offers a wide variety of file system APIs, but the most convenient
37
// of them--the [[FSpXXX]] calls only works synchronously. The routines defined
38
// here offer a version of these calls, executed asynchronously and embedded
39
// into the [[GUSIContext]] switching model.
41
// <GUSIFSWrappers.h>=
42
#ifndef _GUSIFSWrappers_
43
#define _GUSIFSWrappers_
49
#include <sys/cdefs.h>
51
#include "GUSIFileSpec.h"
54
// <Declarations of C [[GUSIFSWrappers]]>=
55
OSErr GUSIFSOpenDriver(StringPtr name, short * refNum);
56
// <Declarations of C [[GUSIFSWrappers]]>=
57
OSErr GUSIFSGetFInfo(const FSSpec * spec, FInfo * info);
58
OSErr GUSIFSSetFInfo(const FSSpec * spec, const FInfo * info);
59
// <Declarations of C [[GUSIFSWrappers]]>=
60
OSErr GUSIFSOpenDF(const FSSpec * spec, char permission, short * refNum);
61
OSErr GUSIFSOpenRF(const FSSpec * spec, char permission, short * refNum);
62
// <Declarations of C [[GUSIFSWrappers]]>=
63
OSErr GUSIFSGetVolParms(short vRefNum, GetVolParmsInfoBuffer * volParms);
64
// <Declarations of C [[GUSIFSWrappers]]>=
65
OSErr GUSIFSCreate(const FSSpec * spec, OSType creator, OSType type, ScriptCode script);
66
// <Declarations of C [[GUSIFSWrappers]]>=
67
OSErr GUSIFSDelete(const FSSpec * spec);
68
// <Declarations of C [[GUSIFSWrappers]]>=
69
OSErr GUSIFSDirCreate(const FSSpec * spec);
70
// <Declarations of C [[GUSIFSWrappers]]>=
71
OSErr GUSIFSSetFLock(const FSSpec * spec);
72
OSErr GUSIFSRstFLock(const FSSpec * spec);
73
// <Declarations of C [[GUSIFSWrappers]]>=
74
OSErr GUSIFSRename(const FSSpec * spec, ConstStr255Param newname);
75
// <Declarations of C [[GUSIFSWrappers]]>=
76
OSErr GUSIFSCatMove(const FSSpec * spec, const FSSpec * dest);
77
// <Declarations of C [[GUSIFSWrappers]]>=
78
OSErr GUSIFSMoveRename(const FSSpec * spec, const FSSpec * dest);
81
// <Declarations of C++ [[GUSIFSWrappers]]>=
82
OSErr GUSIFSGetCatInfo(GUSIIOPBWrapper<GUSICatInfo> * info);
83
OSErr GUSIFSSetCatInfo(GUSIIOPBWrapper<GUSICatInfo> * info);
84
// <Declarations of C++ [[GUSIFSWrappers]]>=
85
OSErr GUSIFSGetFCBInfo(GUSIIOPBWrapper<FCBPBRec> * fcb);
86
// <Declarations of C++ [[GUSIFSWrappers]]>=
87
OSErr GUSIFSGetVInfo(GUSIIOPBWrapper<ParamBlockRec> * pb);
88
OSErr GUSIFSHGetVInfo(GUSIIOPBWrapper<HParamBlockRec> * pb);
89
// According to Andreas Grosam, [[PBOpenAsync]] may cause the file not to be closed properly when the
90
// process quits, so we call that call synchronously.
92
// <Declarations of C++ [[GUSIFSWrappers]]>=
93
OSErr GUSIFSOpen(GUSIIOPBWrapper<ParamBlockRec> * pb);
94
// <Declarations of C++ [[GUSIFSWrappers]]>=
95
OSErr GUSIFSHGetFInfo(GUSIIOPBWrapper<HParamBlockRec> * pb);
96
OSErr GUSIFSHSetFInfo(GUSIIOPBWrapper<HParamBlockRec> * pb);
97
// <Declarations of C++ [[GUSIFSWrappers]]>=
98
OSErr GUSIFSHGetVolParms(GUSIIOPBWrapper<HParamBlockRec> * pb);
99
// <Declarations of C++ [[GUSIFSWrappers]]>=
100
OSErr GUSIFSCreate(const FSSpec * spec);
101
// <Declarations of C++ [[GUSIFSWrappers]]>=
102
OSErr GUSIFSCatMove(const FSSpec * spec, long dest);
105
#endif /* GUSI_SOURCE */
107
#endif /* GUSIFSWrappers */