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

Function main

tools/cmpconfig.c:135–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 ****************************************************************************/
134
135int main(int argc, char **argv, char **envp)
136{
137 struct variable_s *list1 = 0;
138 struct variable_s *list2 = 0;
139 FILE *stream1;
140 FILE *stream2;
141
142 if (argc != 3)
143 {
144 fprintf(stderr, "Unexpected number of arguments: %d\n\n", argc);
145 show_usage(argv[0]);
146 }
147
148 stream1 = fopen(argv[1], "r");
149 if (!stream1)
150 {
151 fprintf(stderr, "Failed to open %s for reading: %s\n\n",
152 argv[1], strerror(errno));
153 show_usage(argv[0]);
154 }
155
156 stream2 = fopen(argv[2], "r");
157 if (!stream2)
158 {
159 fprintf(stderr, "Failed to open %s for reading: %s\n\n",
160 argv[2], strerror(errno));
161 show_usage(argv[0]);
162 }
163
164 parse_file(stream1, &list1);
165 parse_file(stream2, &list2);
166
167 fclose(stream1);
168 fclose(stream2);
169
170 return compare_variables(list1, list2);
171}

Callers

nothing calls this directly

Calls 7

fprintfFunction · 0.85
fopenFunction · 0.85
strerrorFunction · 0.85
parse_fileFunction · 0.85
fcloseFunction · 0.85
compare_variablesFunction · 0.85
show_usageFunction · 0.70

Tested by

no test coverage detected