MCPcopy Create free account
hub / github.com/apache/nuttx / main

Function main

tools/cnvwindeps.c:170–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168 ****************************************************************************/
169
170int main(int argc, char **argv, char **envp)
171{
172 char *path;
173 char *next;
174 FILE *stream;
175 bool begin;
176 bool quoted;
177 bool scouring;
178
179 if (argc != 2)
180 {
181 fprintf(stderr, "Unexpected number of arguments\n");
182 show_usage(argv[0]);
183 }
184
185 stream = fopen(argv[1], "r");
186 if (!stream)
187 {
188 fprintf(stderr, "open %s failed: %s\n", argv[1], strerror(errno));
189 exit(EXIT_FAILURE);
190 }
191
192 begin = true;
193 scouring = false;
194 g_lineno = 0;
195
196 while (fgets(g_line, MAX_LINE, stream) != NULL)
197 {
198 g_lineno++;
199 next = g_line;
200
201 for (; ; )
202 {
203 if (begin)
204 {
205 path = skip_spaces(next);
206 if (*path == '#')
207 {
208 /* The reset of the line is comment */
209
210 puts(path);
211 break;
212 }
213
214 next = strchr(path, ':');
215 if (!next)
216 {
217 fprintf(stderr, "%lu: Expected colon\n", g_lineno);
218 exit(EXIT_FAILURE);
219 }
220
221 if (*next != '\0')
222 {
223 *next++ = '\0';
224 }
225
226 scouring = scour_path(path);
227 if (!scouring)

Callers

nothing calls this directly

Calls 15

fprintfFunction · 0.85
fopenFunction · 0.85
strerrorFunction · 0.85
exitFunction · 0.85
putsFunction · 0.85
scour_pathFunction · 0.85
printfFunction · 0.85
fcloseFunction · 0.85
show_usageFunction · 0.70
skip_spacesFunction · 0.70
convert_pathFunction · 0.70
find_spacesFunction · 0.70

Tested by

no test coverage detected