1 |
|
---|
2 | #ifndef util_class_psi3_libpsio_psio_gbl_
|
---|
3 | #define util_class_psi3_libpsio_psio_gbl_
|
---|
4 |
|
---|
5 | namespace psi3 {
|
---|
6 | namespace libpsio {
|
---|
7 |
|
---|
8 | #define PSIO_KEYLEN 80
|
---|
9 | #define PSIO_MAXVOL 8
|
---|
10 | #define PSIO_MAXUNIT 300
|
---|
11 | #define PSIO_MAXSTR 512
|
---|
12 | #define PSIO_PAGELEN 65536
|
---|
13 |
|
---|
14 | typedef unsigned long int ULI; /* For convenience */
|
---|
15 |
|
---|
16 | typedef struct {
|
---|
17 | ULI page; /* First page of entry */
|
---|
18 | ULI offset; /* Starting byte offset on fpage */
|
---|
19 | } psio_address;
|
---|
20 |
|
---|
21 | struct psio_entry {
|
---|
22 | char key[PSIO_KEYLEN];
|
---|
23 | psio_address sadd;
|
---|
24 | psio_address eadd;
|
---|
25 | struct psio_entry *next;
|
---|
26 | struct psio_entry *last;
|
---|
27 | };
|
---|
28 |
|
---|
29 | typedef struct psio_entry psio_tocentry;
|
---|
30 |
|
---|
31 | typedef struct {
|
---|
32 | char *path;
|
---|
33 | int stream;
|
---|
34 | } psio_vol;
|
---|
35 |
|
---|
36 | typedef struct {
|
---|
37 | ULI numvols;
|
---|
38 | psio_vol vol[PSIO_MAXVOL];
|
---|
39 | psio_address tocaddress;
|
---|
40 | ULI toclen;
|
---|
41 | psio_tocentry *toc;
|
---|
42 | } psio_ud;
|
---|
43 |
|
---|
44 | extern psio_ud *psio_unit;
|
---|
45 |
|
---|
46 | #define PSIO_ERROR_INIT 1
|
---|
47 | #define PSIO_ERROR_DONE 2
|
---|
48 | #define PSIO_ERROR_MAXVOL 3
|
---|
49 | #define PSIO_ERROR_NOVOLPATH 4
|
---|
50 | #define PSIO_ERROR_OPEN 5
|
---|
51 | #define PSIO_ERROR_REOPEN 6
|
---|
52 | #define PSIO_ERROR_CLOSE 7
|
---|
53 | #define PSIO_ERROR_RECLOSE 8
|
---|
54 | #define PSIO_ERROR_OSTAT 9
|
---|
55 | #define PSIO_ERROR_LSEEK 10
|
---|
56 | #define PSIO_ERROR_READ 11
|
---|
57 | #define PSIO_ERROR_WRITE 12
|
---|
58 | #define PSIO_ERROR_NOTOCENT 13
|
---|
59 | #define PSIO_ERROR_TOCENTSZ 14
|
---|
60 | #define PSIO_ERROR_KEYLEN 15
|
---|
61 | #define PSIO_ERROR_BLKSIZ 16
|
---|
62 | #define PSIO_ERROR_BLKSTART 17
|
---|
63 | #define PSIO_ERROR_BLKEND 18
|
---|
64 | #define PSIO_ERROR_IDENTVOLPATH 19
|
---|
65 |
|
---|
66 | #define PSIO_OPEN_NEW 0
|
---|
67 | #define PSIO_OPEN_OLD 1
|
---|
68 |
|
---|
69 | }
|
---|
70 | }
|
---|
71 |
|
---|
72 | #endif /* #ifndef PSIO_GBL */
|
---|