FORM
v5.0.0-35-g6318119
sources
minos.h
Go to the documentation of this file.
1
#ifndef __MANAGE_H__
2
3
#define __MANAGE_H__
4
17
/* #[ License : */
18
/*
19
* Copyright (C) 1984-2026 J.A.M. Vermaseren
20
* When using this file you are requested to refer to the publication
21
* J.A.M.Vermaseren "New features of FORM" math-ph/0010025
22
* This is considered a matter of courtesy as the development was paid
23
* for by FOM the Dutch physics granting agency and we would like to
24
* be able to track its scientific use to convince FOM of its value
25
* for the community.
26
*
27
* This file is part of FORM.
28
*
29
* FORM is free software: you can redistribute it and/or modify it under the
30
* terms of the GNU General Public License as published by the Free Software
31
* Foundation, either version 3 of the License, or (at your option) any later
32
* version.
33
*
34
* FORM is distributed in the hope that it will be useful, but WITHOUT ANY
35
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
36
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
37
* details.
38
*
39
* You should have received a copy of the GNU General Public License along
40
* with FORM. If not, see <http://www.gnu.org/licenses/>.
41
*/
42
/* #] License : */
43
44
#include <stdio.h>
45
#include <stdlib.h>
46
#include <ctype.h>
47
#include <string.h>
48
#include <time.h>
49
50
/*
51
The following typedef has been moved to form3.h where all the sizes
52
are defined for the various memory models.
53
We want MLONG to have a more or less fixed size.
54
In form3.h we try to fix it at 8 bytes.
55
This should make files exchangeable
56
between various 32-bits and 64-bits systems. At 4 bytes it might have
57
problems with files of more than 2 Gbytes.
58
59
typedef long MLONG;
60
*/
61
62
#if BITSINWORD == 32
63
#define NUMOBJECTS 1024
64
#define MAXINDEXSIZE 1000000000L
65
#define NAMETABLESIZE 1008
66
#define ELEMENTSIZE 256
67
#elif BITSINWORD == 16
68
#define NUMOBJECTS 100
69
#define MAXINDEXSIZE 33000000L
70
#define NAMETABLESIZE 1008
71
#define ELEMENTSIZE 128
72
#else
73
#error Only 64-bit and 32-bit platforms are supported.
74
#endif
75
76
77
int
minosread(FILE *f,
char
*buffer,MLONG size);
78
int
minoswrite(FILE *f,
char
*buffer,MLONG size);
79
80
/*
81
ELEMENTSIZE should make a nice number of sizeof(OBJECTS)
82
Usually this will be much too much, but there are cases.....
83
*/
84
85
typedef
struct
iniinfo
{
86
/* should contains only MLONG variables or convertiniinfo should be modified */
87
MLONG entriesinindex;
88
MLONG numberofindexblocks;
89
MLONG firstindexblock;
90
MLONG lastindexblock;
91
MLONG numberoftables;
92
MLONG numberofnamesblocks;
93
MLONG firstnameblock;
94
MLONG lastnameblock;
95
}
INIINFO
;
96
97
typedef
struct
objects
{
98
/* if any changes, convertblock should be adapted too!!!! */
99
MLONG position;
/* position of RHS= */
100
MLONG size;
/* size on disk (could be compressed) */
101
MLONG date;
/* Time stamp */
102
MLONG tablenumber;
/* Number of table. Refers to name in special index */
103
MLONG uncompressed;
/* uncompressed size if compressed. If not: 0 */
104
MLONG spare1;
105
MLONG spare2;
106
MLONG spare3;
107
char
element[ELEMENTSIZE];
/* table element in character form */
108
}
OBJECTS
;
109
110
typedef
struct
indexblock
{
111
MLONG flags;
112
MLONG previousblock;
113
MLONG position;
114
OBJECTS
objects
[NUMOBJECTS];
115
}
INDEXBLOCK
;
116
117
typedef
struct
nameblock
{
118
MLONG previousblock;
119
MLONG position;
120
char
names[NAMETABLESIZE];
121
}
NAMESBLOCK
;
122
123
typedef
struct
dbase
{
124
INIINFO
info;
125
MLONG mode;
126
MLONG tablenamessize;
127
MLONG topnumber;
128
MLONG tablenamefill;
129
MLONG rwmode;
130
INDEXBLOCK
**iblocks;
131
NAMESBLOCK
**nblocks;
132
FILE *handle;
133
char
*name;
134
char
*fullname;
135
char
*tablenames;
136
}
DBASE
;
137
138
/*
139
typedef int (*SFUN)(char *);
140
typedef struct compile {
141
char *keyword;
142
SFUN func;
143
} MCFUNCTION;
144
*/
145
#define TODISK 0
146
#define FROMDISK 1
147
#define MDIRTYFLAG 1
148
#define MCLEANFLAG (~MDIRTYFLAG)
149
#define INANDOUT 0
150
#define INPUTONLY 1
151
#define OUTPUTONLY 2
152
#define NOCOMPRESS 4
153
154
extern
int
withoutflush;
155
156
#endif
dbase
Definition
minos.h:123
indexblock
Definition
minos.h:110
iniinfo
Definition
minos.h:85
nameblock
Definition
minos.h:117
objects
Definition
minos.h:97
Generated by
1.9.8