#include "misc/auxiliary.h"
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <gmp.h>
#include "omalloc/omalloc.h"
#include "reporter/s_buff.h"
#include "reporter/si_signals.h"
#include "reporter/reporter.h"
Go to the source code of this file.
◆ S_BUFF_LEN
◆ s_close()
Definition at line 46 of file s_buff.cc.
47{
49 {
54 return r;
55 }
56 return 0;
57}
#define omFreeSize(addr, size)
◆ s_getc()
Definition at line 59 of file s_buff.cc.
60{
62 {
64 return 0;
65 }
66 if (F->bp>=F->end)
67 {
70 if (r<=0)
71 {
72 F->is_eof=1;
73 return -1;
74 }
75 else
76 {
77 F->end=r-1;
78 F->bp=0;
79 return F->buff[0];
80 }
81 }
82
83 F->bp++;
84 return F->buff[F->bp];
85}
◆ s_iseof()
Definition at line 255 of file s_buff.cc.
256{
257 if (F!=
NULL)
return F->is_eof;
258 else return 1;
259}
◆ s_isready()
Definition at line 86 of file s_buff.cc.
87{
89 {
91 return 0;
92 }
93 if (F->bp>=F->end) return 0;
95 while((
p<F->end)&&(F->buff[
p]<=
' '))
p++;
96 if (
p>=F->end)
return 0;
97 return 1;
98}
◆ s_open()
◆ s_open_by_name()
◆ s_readbytes()
Definition at line 169 of file s_buff.cc.
170{
172 {
174 return 0;
175 }
177 while((!F->is_eof)&&(
i<len))
178 {
181 }
183}
◆ s_readint()
Definition at line 113 of file s_buff.cc.
114{
116 {
118 return 0;
119 }
120 char c;
121 int neg=1;
122 int r=0;
123
124 do
125 {
127 } while((!F->is_eof) && (c<=' '));
128 if (c==
'-') { neg=-1; c=
s_getc(F); }
130 {
131
132 r=r*10+(c-'0');
134 }
136
137
138 return r*neg;
139}
void s_ungetc(int c, s_buff F)
◆ s_readlong()
Definition at line 141 of file s_buff.cc.
142{
144 {
146 return 0;
147 }
148 char c;
149 long neg=1;
150 long r=0;
151
152 do
153 {
155 } while((!F->is_eof) && (c<=' '));
156 if (c==
'-') { neg=-1; c=
s_getc(F); }
158 {
159
160 r=r*10+(c-'0');
162 }
164
165
166 return r*neg;
167}
◆ s_readmpz()
Definition at line 185 of file s_buff.cc.
186{
188 {
190 return;
191 }
193 char c;
194 int neg=1;
195 do
196 {
198 } while((!F->is_eof) && (c<=' '));
199 if (c==
'-') { neg=-1; c=
s_getc(F); }
201 {
205 }
208}
◆ s_readmpz_base()
Definition at line 210 of file s_buff.cc.
211{
213 {
215 return;
216 }
218 char c;
219 int neg=1;
220 do
221 {
223 } while((!F->is_eof) && (c<=' '));
224 if (c==
'-') { neg=-1; c=
s_getc(F); }
228 while(c>' ')
229 {
231 || ((c>='a') && (c<='z'))
232 || ((c>='A') && (c<='Z')))
233 {
236 }
237 else
238 {
240 break;
241 }
243 {
248 }
250 }
254}
void WerrorS(const char *s)
#define omRealloc(addr, size)
◆ s_ungetc()
Definition at line 100 of file s_buff.cc.
101{
103 {
105 }
106 else if (F->bp>=0)
107 {
108 F->buff[F->bp]=c;
109 F->bp--;
110 }
111}