Пример #1
0
int
get_exp_length_first (char **words, int end_block)
{
  int i;
  int lines;

  for (i = 0; words[i] != NULL; i++)
    {
      for (lines = 0; words[i][lines] == '\n'; lines++);

      if (words[i][lines] == '\0' || words[i][lines] == end_block)
        break;

      if (words[i][lines] == '('
          || words[i][lines] == '['
          || (words[i][lines] == '!'
              && words[i][lines + 1] == '['))
        i += get_exp_length (words + i + 1,
                             get_end_block (words[i]
                                            [lines]));
      else if (words[i][lines] == '{')
        return i + get_exp_length (words + i + 1, '}') + 1;
    }

  return (words[i] == NULL) ? i : i + 1;
}
Пример #2
0
void log_ioa(const struct io_activity *ioa)
{
        int i;
        LOG("%s, bytes to transfer: %d, delta count: %d", ioa->rw? "W" : "R", ioa->data_size, ioa->delta_count);

        for (i = 0; i < ioa->delta_count; ++i) {
                int count;
                struct block_delta *delta = &ioa->deltas[i];
                LOG("bv #%d: len %d, offset %d, %d sectors (%d..%d) or %d blocks (%d..%d)",
                    i, delta->size, delta->offset,
                    get_sectors_count(delta), delta->start_sector, delta->end_sector,
                    get_blocks_count(delta), get_start_block(delta), get_end_block(delta));
                count = find_word_count("DAMN", delta->data, delta->size);
                if (count > 0) LOG("Found DAMN from deltas %d times", count);
        }
}
Пример #3
0
inline int get_blocks_count(const struct block_delta *delta)
{
    return get_end_block(delta) - get_start_block(delta) + 1;
}