Commit | Line | Data |
76e3520e |
1 | /* |
2 | |
f7a92b15 |
3 | ipdir.h |
4 | Interface for perl directory functions |
76e3520e |
5 | |
6 | */ |
7 | |
3dfd1da1 |
8 | |
9 | /* |
10 | PerlXXX_YYY explained - DickH and DougL @ ActiveState.com |
11 | |
12 | XXX := functional group |
13 | YYY := stdlib/OS function name |
14 | |
15 | Continuing with the theme of PerlIO, all OS functionality was |
16 | encapsulated into one of several interfaces. |
17 | |
18 | PerlIO - stdio |
19 | PerlLIO - low level I/O |
20 | PerlMem - malloc, realloc, free |
21 | PerlDir - directory related |
22 | PerlEnv - process environment handling |
23 | PerlProc - process control |
24 | PerlSock - socket functions |
25 | |
26 | |
27 | The features of this are: |
28 | 1. 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) |
30 | 2. The Perl Host (see perl.h for description) can provide a new and |
31 | improved interface to OS functionality if required. |
32 | 3. Developers can easily hook into the OS calls for instrumentation |
33 | or diagnostic purposes. |
34 | |
35 | What was changed to do this: |
36 | 1. All calls to OS functions were replaced with PerlXXX_YYY |
37 | |
38 | */ |
39 | |
40 | |
41 | |
76e3520e |
42 | #ifndef __Inc__IPerlDir___ |
43 | #define __Inc__IPerlDir___ |
44 | |
45 | class IPerlDir |
46 | { |
47 | public: |
f7a92b15 |
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 |
57 | }; |
58 | |
59 | #endif /* __Inc__IPerlDir___ */ |
60 | |