This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH 5.004_66] REG_INFTY patch corrected
[perl5.git] / ipdir.h
CommitLineData
76e3520e
GS
1/*
2
f7a92b15
DL
3 ipdir.h
4 Interface for perl directory functions
76e3520e
GS
5
6*/
7
3dfd1da1
GS
8
9/*
10 PerlXXX_YYY explained - DickH and DougL @ ActiveState.com
11
12XXX := functional group
13YYY := stdlib/OS function name
14
15Continuing with the theme of PerlIO, all OS functionality was
16encapsulated into one of several interfaces.
17
18PerlIO - stdio
19PerlLIO - low level I/O
20PerlMem - malloc, realloc, free
21PerlDir - directory related
22PerlEnv - process environment handling
23PerlProc - process control
24PerlSock - socket functions
25
26
27The features of this are:
281. All OS dependant code is in the Perl Host and not the Perl Core.
29 (At least this is the holy grail goal of this work)
302. The Perl Host (see perl.h for description) can provide a new and
31 improved interface to OS functionality if required.
323. Developers can easily hook into the OS calls for instrumentation
33 or diagnostic purposes.
34
35What was changed to do this:
361. All calls to OS functions were replaced with PerlXXX_YYY
37
38*/
39
40
41
76e3520e
GS
42#ifndef __Inc__IPerlDir___
43#define __Inc__IPerlDir___
44
45class IPerlDir
46{
47public:
f7a92b15
DL
48 virtual int Makedir(const char *dirname, int mode, int &err) = 0;
49 virtual int Chdir(const char *dirname, int &err) = 0;
50 virtual int Rmdir(const char *dirname, int &err) = 0;
51 virtual int Close(DIR *dirp, int &err) = 0;
52 virtual DIR *Open(char *filename, int &err) = 0;
53 virtual struct direct *Read(DIR *dirp, int &err) = 0;
54 virtual void Rewind(DIR *dirp, int &err) = 0;
55 virtual void Seek(DIR *dirp, long loc, int &err) = 0;
56 virtual long Tell(DIR *dirp, int &err) = 0;
76e3520e
GS
57};
58
59#endif /* __Inc__IPerlDir___ */
60