File: io.doc

package info (click to toggle)
symmetrica 2.0+ds-6
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 9,456 kB
  • sloc: ansic: 97,289; makefile: 170; sh: 70
file content (297 lines) | stat: -rw-r--r-- 7,775 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
COMMENT:
IO-Functions
------------

NAME:  
	     display
SYNOPSIS: 
	  INT display(OP a)
DESCRIPTION:
	 This is a old routine to provide  nice output of special 
        objects. 
RETURN:
	     OK or ERROR
BUGS:  
	     It only works for SCHUBERT objects.


NAME:  
	     ferrers
SYNOPSIS:
	   INT ferrers(OP a)
DESCRIPTION:
	 prints the Ferrers diagramm of a PARTITION object to
        stdout.
RETURN:
	     OK or ERROR
BUGS:  
	does not work with SKEWPARTITION object

NAME:  
	     fprint
SYNOPSIS:
	   INT fprint(FILE *fp, OP a)
DESCRIPTION:
	 prints the entered object a to the file pointed to by fp.
        This works for the following kind of objects:

	AUG_PART, BINTREE, BRUCH, GEN_CHAR, GRAPH, INTEGER,
        HOM_SYM, PARTITION, GRAL, MONOPOLY, POLYNOM, SCHUBERT,
        SCHUR, LIST, LONGINT, MATRIX, KOSTKA, KRANZTYPUS, MONOM, 
        PERMUTATION, SKEWPARTITION, SYMCHAR TABLEAUX, COMP,
        WORD, VECTOR, SQ_RADICAL, CYCLOTOMIC

	If you print to stdout there is a global variable 
        INT zeilenposition, which is updated to do line breaks after about
        70 chars printed to stdout.
RETURN:
	     OK or ERROR
BUGS:  
	     Sometimes  the output is not easy to unterstand, there is no
        difference between a VECTOR object with INTEGER objects and
        a PERMUTATION object. 

NAME:  
	     fprintln
SYNOPSIS: 
	  INT fprintln(FILE *fp, OP a)
DESCRIPTION: 
	this does the same as fprint but with a trailing
        newline.
RETURN:
	     OK 

NAME:  
	     objectread
SYNOPSIS:
	   INT objectread(FILE *fp, OP a)
DESCRIPTION:
	 reads an object  from the file fp, the object
        will be in the variable a. The object must have 
        been stored before by the routine objectwrite.
	This works for the following types:
	BRUCH, INTEGER, GRAL, HOM_SYM, SCHUR, MONOPOLY,
        POLYNOM, SCHUBERT, LIST, LONGINT, MATRIX, MONOM,
        SQ_RADICAL, CYCLOTOMIC, PARTITION, PERMUTATION, 
        SYMCHAR, SKEWPARTITION, TABLEAUX, VECTOR, INTEGERVECTOR,
	BITVECTOR
	There is an error message in the case of fp == NULL.
BUGS:  
	     The format of storage is directly readable and because
        of that very storage space consuming.
        not yet implemented for all types

NAME:  
	     objectwrite
SYNOPSIS:
	   INT objectwrite(FILE *fp, OP a)
DESCRIPTION:
	 stores the object a in the file pointed by fp. In general
        the format  codes first the type of the object and then it
	stores the
        parts of the object. Further information is in the doc files
        for special objects. At the moment it works for the following
        types:
            BRUCH CYCLOTOMIC  GRAL HOM_SYM
            INTEGER LIST LONGINT MATRIX MONOM MONOPOLY PARTITION
            PERMUTATION POLYNOM SKEWPARTITION SCHUBERT SCHUR  SYMCHAR
            SQ_RADICAL TABLEAUX VECTOR INTEGERVECTOR,
	    BITVECTOR
	There is an error message in the case of fp == NULL.
BUGS:  
	     not yet implemented for all types
EXAMPLE:
	#include "def.h"
	#include "macro.h"

	main()
	{
	OP a,b;
	FILE *fp1,*fp2;
	anfang();

	a=callocobject(); b=callocobject(); 
	scan(scanobjectkind(),a);
	
	fp1=fopen("klo.dat","w"); objectwrite(fp1,a); fclose(fp1);
	fp1=fopen("klo.dat","r"); objectread(fp1,b); fclose(fp1);
	println(b);
	freeall(a); freeall(b);
	ende();
	}

NAME:	
	sprint
SYNOPSIS:
	INT sprint(char *t; OP obj)
DESCRIPTION:
	prints an object on a string. It is up to the
	user that the string is big enough to store the result.
	At the moment it works for the following
        types:
		INTEGER, LONGINT
BUGS:
	not all types are implemented.

NAME:  
     print
SYNOPSIS:
   INT print(OP a)
DESCRIPTION:
 prints the object a to stdout. The position on stdout
        is updated using a global variable 'INT zeilenposition'. At about
	position 70 it prints a newline to stdout, and changes 
	'zeilenposition' to 0. It calls the subroutine fprint, 
	and works so for the same types.
RETURN: 
    OK if no error
BUGS:
   as in fprint

NAME: 
      printeingabe
SYNOPSIS:
   INT printeingabe(char *text)
DESCRIPTION: 
prints the entered text to stderr, this is under
	normal circumstances the terminal of the user.
	After the text it prints a newline.
CHANGES:   
 in former versions, it printed to stdout
RETURN:
     OK if no error
BUGS:
       there is no variable for the position of the cursor on
        stderr, like for stdout.
        

NAME:      
 println
SYNOPSIS: 
  INT println(OP a)
DESCRIPTION:
 prints the object a to stdout, at the end it prints
        newline. (compare with print)
BUGS:
    as in print

NAME: 
      printobjectkind
SYNOPSIS:
   INT printobjectkind(OP a)
DESCRIPTION: 
print the kind of the object a. This is a routine, which must
       	be changed for every new type of object.
EXAMPLE:
    ......
            OP a = callocobject();
            scan(INTEGER,a);
	    printobjectkind(a);
            ......
            will print the information integer on the terminal

NAME: 
      scan
SYNOPSIS:
   INT scan(OBJECTKIND typ, OP result)
DESCRIPTION: 
reads an object of the specified kind into the
	object result. The result is freed first to an 
	empty object. You can read the following kinds
             BRUCH CYCLOTOMIC FASTPOLYNOM 
	     GEN_CHAR GRAL HOM_SYM INTEGER 
             INTEGERVECTOR KOSTKA KRANZ 
             KRANZTYPUS LIST LONGINT MATRIX MONOM MONOPOLY 
             PARTITION PERMUTATION
             POLYNOM SCHUBERT SCHUR SKEWPARTITION 
             SQ_RADICAL SYMCHAR TABLEAUX VECTOR
             WORD 
        The kind INTEGERVECTOR is a special kind only provided as a 
        type for input.
        The output during scanning is written using the routine
        printeingabe, so it prints to stderr, you may redirect
        it (only on systems where it is possible).
RETURN:
     OK if no error
	a value different from OK else.
BUGS:   
there is much output during scanning of an object.

NAME:
       sscan
SYNOPSIS:
   INT sscan(char *string, OBJECTKIND typ, OP result)
DESCRIPTION: 
reads an object of the specified kind into the
	object result. The input is a string entered as the
	first parameter. You can read the following kinds
             INTEGER LONGINT PARTITION PERMUTATION
		SCHUR
RETURN:     
OK if no error a value different from OK else.
BUGS:
   many types are missing
EXAMPLE:
	/* SYMMETRICA  */
	#include "def.h"
	#include "macro.h"
	main()
	{
	OP a;
	anfang();
	a = callocobject();
	sscan("-1237878456777777", LONGINT, a);
	println(a); freeall(a); ende();
	}

NAME:
       scanobjectkind
SYNOPSIS:
   OBJECTKIND scanobjectkind()
DESCRIPTION:
 reads interactively the kind of an object
RETURN:
     the read kind of object
CHANGES:
 in version 1.1 it prints the text of the interaction to 
         stdout, now it prints to stderr
BUGS:
       not all types are listed

NAME: 
      tex
SYNOPSIS:
   INT tex(OP a)
DESCRIPTION:
 gives an output in tex-readible form. It works for the 
	following types of objects:
             BRUCH CYCLOTOMIC GRAL INTEGER KOSTKA LIST LONGINT MATRIX 
             MONOM MONOPOLY PARTITION PERMUTATION
             POLYNOM SCHUBERT SCHUR SQ_RADICAL SYMCHAR TABLEAUX VECTOR
         The position in the file of the texoutput is updated using
         a global variable  INT texposition.
CHANGES:   
 in version 1.1 it prints the TeX-output to stdout, now 
        in version 1.2+ it prints to texout, which is in the default 
	case stdout, but may be changed by the user.
BUGS:
	does not work for all types
 there are too many switches between math mode and no math mode.
        LaTeX output would also be good.
EXAMPLE:
	#include "def.h"
	#include "macro.h"

	main()
	{
	OP a;
	anfang();
	a=callocobject(); 
	texout = fopen("klo","w");
	scan(BRUCH,a);
	tex(a);
	freeall(a);
	ende();
	}
	and the output will be written to the file klo.