not a beautiful or unique snowflake (nothings) wrote,
not a beautiful or unique snowflake
nothings



int main(int argc, char **argv)
{
   ...
   else if (!stricmp(parm, "checksum")) {
      ...
      // now scan and determine how many need checksumming
      if (arrlen(files) >= 2) {
         for (i=0; i < arrlen(files);) {
            ... // compute j that is last file of same length
            if (j-i > 1 && files[j].length > 0) {
               ...
               for (k=i; k < j; ++k) {
                  File *f = files[k].file;
                  if (f->parent->vol == v) {
                     if (f->cache_flags[crc_cache_offset] & crc_cache_mask) {
                        ...
                     } else {
                        // search for file with the same name as f/k
                        for (m=i; m < j; ++m) {
                           if (m != k) {
                              if (!stricmp(files[m].file->filename, f->filename)) {
                                 ... // compute crc of file
                                 // maybe write out the database; frequency depends on how slowed-down we're running
                                 if (will_crc % (scale*(delay > 150 ? 100 : delay ? 250 : 1000)) == 0) {
                                    write_database(buffer);
                                    changed = 0;
                                 }
                                 ...
                              }
                           }
                        }
                     }
                  }
               }
            }
            i = j;
         }
      }
      ...
   }
   ...
}
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 5 comments