FORM  4.2.1
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-2017 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. This should make files exchangable
55  between various 32-bits and 64-bits systems. At 4 bytes it might have
56  problems with files of more than 2 Gbytes.
57 
58 typedef long MLONG;
59 */
60 
61 #define MAXBASES 16
62 #ifdef WORDSIZE32
63 #define NUMOBJECTS 1024
64 #define MAXINDEXSIZE 1000000000L
65 #define NAMETABLESIZE 1008
66 #define ELEMENTSIZE 256
67 #else
68 #define NUMOBJECTS 100
69 #define MAXINDEXSIZE 33000000L
70 #define NAMETABLESIZE 1008
71 #define ELEMENTSIZE 128
72 #endif
73 
74 int minosread(FILE *f,char *buffer,MLONG size);
75 int minoswrite(FILE *f,char *buffer,MLONG size);
76 
77 /*
78  ELEMENTSIZE should make a nice number of sizeof(OBJECTS)
79  Usually this will be much too much, but there are cases.....
80 */
81 
82 typedef struct iniinfo {
83 /* should contains only MLONG variables or convertiniinfo should be modified */
84  MLONG entriesinindex;
85  MLONG numberofindexblocks;
86  MLONG firstindexblock;
87  MLONG lastindexblock;
88  MLONG numberoftables;
89  MLONG numberofnamesblocks;
90  MLONG firstnameblock;
91  MLONG lastnameblock;
92 } INIINFO;
93 
94 typedef struct objects {
95 /* if any changes, convertblock should be adapted too!!!! */
96  MLONG position; /* position of RHS= */
97  MLONG size; /* size on disk (could be compressed) */
98  MLONG date; /* Time stamp */
99  MLONG tablenumber; /* Number of table. Refers to name in special index */
100  MLONG uncompressed; /* uncompressed size if compressed. If not: 0 */
101  MLONG spare1;
102  MLONG spare2;
103  MLONG spare3;
104  char element[ELEMENTSIZE]; /* table element in character form */
105 } OBJECTS;
106 
107 typedef struct indexblock {
108  MLONG flags;
109  MLONG previousblock;
110  MLONG position;
111  OBJECTS objects[NUMOBJECTS];
112 } INDEXBLOCK;
113 
114 typedef struct nameblock {
115  MLONG previousblock;
116  MLONG position;
117  char names[NAMETABLESIZE];
118 } NAMESBLOCK;
119 
120 typedef struct dbase {
121  INIINFO info;
122  MLONG mode;
123  MLONG tablenamessize;
124  MLONG topnumber;
125  MLONG tablenamefill;
126  INDEXBLOCK **iblocks;
127  NAMESBLOCK **nblocks;
128  FILE *handle;
129  char *name;
130  char *fullname;
131  char *tablenames;
132 } DBASE;
133 
134 /*
135 typedef int (*SFUN)(char *);
136 typedef struct compile {
137  char *keyword;
138  SFUN func;
139 } MCFUNCTION;
140  */
141 #define TODISK 0
142 #define FROMDISK 1
143 #define MDIRTYFLAG 1
144 #define MCLEANFLAG (~MDIRTYFLAG)
145 #define INANDOUT 0
146 #define INPUTONLY 1
147 #define OUTPUTONLY 2
148 #define NOCOMPRESS 4
149 
150 extern int withoutflush;
151 
152 #endif
Definition: minos.h:82
Definition: minos.h:94
Definition: minos.h:120