MCPcopy Create free account
hub / github.com/Singular/Singular / scan_info

Function scan_info

Singular/checklibs.c:151–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149 }
150}
151void scan_info(int *l)
152{
153 int have_LIBRARY=0;
154 int have_AUTHORS=0;
155 int have_PROCEDURES=0;
156 int have_SEEALSO=0;
157 int have_KEYWORDS=0;
158 int have_OVERVIEW=0;
159 int have_NOTE=0;
160 int have_other=0;
161 int texinfo=0;
162 unsigned char *p;
163
164 while(!feof(f))
165 {
166 if (strstr(buf,"LIBRARY: ")!=NULL)
167 {
168 have_LIBRARY++;
169 /* musrt be first*/
170 if (have_other+have_AUTHORS+have_PROCEDURES+have_KEYWORDS+have_SEEALSO!=0)
171 printf("error: LIBRARY: must be the first section in info\n");
172 }
173 else if (strstr(buf,"NOTE:")!=NULL)
174 {
175 if (have_PROCEDURES!=0)
176 printf("error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
177 have_NOTE++;
178 }
179 else if (strstr(buf,"OVERVIEW:")!=NULL)
180 {
181 have_OVERVIEW++;
182 if (have_PROCEDURES!=0)
183 printf("error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
184 }
185 else if (strstr(buf,"KEYWORDS: ")!=NULL)
186 {
187 have_KEYWORDS++;
188 }
189 else if (strstr(buf,"SEE ALSO: ")!=NULL)
190 {
191 have_SEEALSO++;
192 }
193 else if ((strstr(buf,"AUTHORS: ")!=NULL)
194 ||(strstr(buf,"AUTHOR: ")!=NULL))
195 {
196 have_AUTHORS++;
197 if (have_PROCEDURES!=0)
198 printf("error: only KEYWORDS/SEE ALSO may follow PROCEDURES\n");
199 }
200 else if ((p=strstr(buf,"PROCEDURES"))!=NULL)
201 {
202 unsigned char *pp=buf;
203 while (pp!=p)
204 {
205 if ((*pp!=' ')&&(*pp!='\t')) break;
206 pp++;
207 }
208 if (p==pp)

Callers 1

mainFunction · 0.85

Calls 2

scan_procFunction · 0.85
get_nextFunction · 0.85

Tested by

no test coverage detected