7 /* Fletcher algorithm */
8 ck_t checksum(int[] msg)
10 ck_t ck = { .a = 0, .b = 0 };
11 for (int i = 4; i < dim(msg); i++) {
26 while (!File::end(stdin)) {
27 input[dim(input)] = gets();
31 for (int i = 0; i < dim(input); i++) {
32 string[*] words = String::wordsplit(input[i], " ,\t");
33 for (int j = 0; j < dim(words); j++) {
34 if (words[j] == "/" + "*")
36 if (String::length(words[j]) > 0 &&
37 Ctype::isdigit(words[j][0])) {
38 msg[dim(msg)] = string_to_integer(words[j]);
42 printf("\t0xb5, 0x62, \t\t/* length: %d bytes */\n", dim(msg));
43 for (int i = 0; i < dim(input); i++)
44 printf("%s\n", input[i]);
45 ck_t ck = checksum(msg);
46 printf ("\t0x%02x, 0x%02x,\n",