- /* look for all entries in file_hashes belonging to a same directory*/
- e = this->db->query(this->db,
- "SELECT DISTINCT f.path FROM files AS f "
- "JOIN file_hashes AS fh ON f.id = fh.file "
- "WHERE fh.directory = ?",
- DB_INT, id, DB_TEXT);
- return e;
-}
-
-METHOD(pts_database_t, check_measurement, bool,
- private_pts_database_t *this, chunk_t received_hash, char *product, int id, char *file_name, pts_meas_algorithms_t algorithm, bool is_dir)
-{
- enumerator_t *e;
- chunk_t db_measurement;
-
- /* look for all entries belonging to a product, file and directory in file_hashes table */
-
- e = (is_dir) ? this->db->query(this->db,
- "SELECT fh.hash FROM file_hashes AS fh "
- "JOIN files AS f ON fh.file = f.id "
- "JOIN products AS p ON fh.product = p.id "
- "WHERE f.path = ? AND p.name = ? AND fh.directory = ? AND fh.algo = ?",
- DB_TEXT, file_name, DB_TEXT, product, DB_INT, id, DB_INT, algorithm, DB_BLOB) :
-
- this->db->query(this->db,
- "SELECT fh.hash FROM file_hashes AS fh "