3 extern int exit_status;
5 struct solution *solution_load(FILE * fmap, FILE * fsolved) {
6 char buffer[BUFFER_SIZE];
15 buff_pos_old = buff_pos;
17 } else if (c == EOF) {
20 buffer[buff_pos++] = (char) c;
23 buffer[buff_pos_old++] = '\0';
25 hash = malloc(buff_pos_old * sizeof(char));
26 memcpy(hash, buffer, buff_pos_old * sizeof(char));
31 buffer[buff_pos++] = (char) c;
33 buffer[buff_pos] = '\0';
34 if (!strcmp(buffer, hash))
43 sol = malloc(sizeof(struct solution));
44 sol->sol = malloc(sz * sizeof(int));
48 if (c == ' ' || c == '\n') {
49 buffer[buff_pos] = '\0';
50 if (sol->size >= sz) {
52 sol->sol = realloc(sol->sol, sz * sizeof(int));
54 sol->sol[sol->size++] = atoi(buffer);
56 buffer[buff_pos++] = (char) c;
65 void solution_check(struct symlist *sl, struct solution *s) {
67 for (i = 0; i < s->size; s++) {
73 if ((unsigned) s->sol[i] > sl->maxid)
77 if (sl->array[s->sol[i] - 1].sym == NULL)
80 (sym_get_tristate_value(sl->array[s->sol[i] - 1].sym) ==
83 printf("Problem %s=%d/%d\n",
84 sl->array[s->sol[i] - 1].sym->name, !neg,
85 sym_get_tristate_value(sl->array[s->sol[i] - 1].sym));