From 26973e55d522e6e35a7618646cbdc7f4bf99e152 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 31 Aug 2003 20:46:56 +0000 Subject: filename hashing implemented git-svn-id: file:///home/lennart/svn/public/syrep/trunk@19 07ea20a6-d2c5-0310-9e02-9ef735347d72 --- src/dbstruct.h | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'src/dbstruct.h') diff --git a/src/dbstruct.h b/src/dbstruct.h index 2df2aed..b5f0c26 100644 --- a/src/dbstruct.h +++ b/src/dbstruct.h @@ -3,22 +3,42 @@ /* $Id$ */ +/*** + This file is part of syrep. + + syrep is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + syrep is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with syrep; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +***/ + #include #include +#include + #include "syrep.h" struct syrep_md { - uint8_t digest[SYREP_DIGESTLENGTH]; + uint8_t digest[SYREP_DIGESTLENGTH]; }; -struct syrep_name { - char path[PATH_MAX+1]; +struct syrep_nrecno { /* name record number */ + db_recno_t recno; }; struct syrep_id { struct syrep_md md; - struct syrep_name name; + struct syrep_nrecno nrecno; }; struct syrep_meta { @@ -34,15 +54,27 @@ struct syrep_version { uint32_t v; }; +struct syrep_nhash { /* name hash */ + uint32_t hash; +}; + +struct syrep_name { + char path[PATH_MAX+1]; +}; + + /* Table layout: * * syrep_id :: syrep_meta => id_meta - * syrep_md :: syrep_name => md_name (DUP) - * syrep_name :: syrep_md => name_md (DUP) + * syrep_md :: syrep_nrecno => md_nrecno (DUP) + * syrep_nrecno :: syrep_md => nrecno_md (DUP) + * syrep_nrecno :: syrep_md => nrecno_lastmd + * syrep_md :: syrep_nrecono => md_lastnrecno + * * syrep_version :: syrep_timestamp => version_timestamp - * syrep_name :: syrep_md => name_lastmd - * syrep_md :: last_md => md_lastmd - * + * + * nhash :: nrecno => nhash_nrecno (DUP) + * nrecno :: name => nrecno_name */ #endif -- cgit