open_input(NULL, argv[1]); while (fgets(buffer, sizeof(buffer), infile)) {
lc++;
value = shift_state = 0;
cp = strtok(buffer, delims); if (*cp == '#') continue;
while (cp) { if (*cp == '=') break; this = find_key(cp); if (this == NULL)
oops("unknown key/modifier", cp); if (this->shift == is_shift) { if (value)
oops("modifiers must come first", cp);
shift_state += this->value;
} elseif (this->shift == is_input)
value = this->value; else
oops("bad modifier or key", cp);
cp = strtok(0, delims);
} if (!cp)
oops("no = found", NULL);
cp = strtok(0, delims); if (!cp)
oops("no speakup function after =", NULL);
this = find_key(cp); if (this == NULL || this->shift != is_spk)
oops("invalid speakup function", cp);
i = get_shift_value(shift_state); if (key_data[value][i]) { while (--cp > buffer) if (!*cp)
*cp = ' ';
oops("two functions on same key combination", cp);
}
key_data[value][i] = (char)this->value; if (value > max_key_used)
max_key_used = value;
}
fclose(infile);
this = find_key("spk_key"); if (this)
spk_val = this->value;
this = find_key("spk_lock"); if (this)
lock_val = this->value;
for (lc = 1; lc <= max_key_used; lc++) {
kp = key_data[lc]; if (!memcmp(key_data[0], kp, 16)) continue;
num_keys_used++; for (i = 0; i < max_states; i++) { if (kp[i] != spk_val && kp[i] != lock_val) continue;
shift_state = shift_table[i]; if (shift_state&16) continue;
shift_state = get_shift_value(shift_state+16);
kp[shift_state] = kp[i]; /* fill in so we can process the key up, as spk bit will be set */
}
}
printf("\t%d, %d, %d,\n\t", map_ver, num_keys_used, max_states); for (i = 0; i < max_states; i++)
printf("%d, ", shift_table[i]);
printf("%d,", flags); for (lc = 1; lc <= max_key_used; lc++) {
kp = key_data[lc]; if (!memcmp(key_data[0], kp, 16)) continue;
printf("\n\t%d,", lc); for (i = 0; i < max_states; i++)
printf(" %d,", (unsignedint)kp[i]);
}
printf("\n\t0, %d\n", map_ver);
exit(0);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.