=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.h,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/cvs/file.h 2004/08/06 20:12:15 1.8 --- src/usr.bin/cvs/file.h 2004/11/26 16:23:50 1.9 *************** *** 1,4 **** ! /* $OpenBSD: file.h,v 1.8 2004/08/06 20:12:15 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: file.h,v 1.9 2004/11/26 16:23:50 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 30,41 **** --- 30,47 ---- #include #include + #include struct cvs_file; struct cvs_dir; struct cvs_entries; + #define CVS_FILE_MAXDEPTH 32 + #define CVS_FILE_NBUCKETS 256 + + + #define CF_STAT 0x01 /* obsolete */ #define CF_IGNORE 0x02 /* apply regular ignore rules */ #define CF_RECURSE 0x04 /* recurse on directory operations */ *************** *** 68,90 **** #define CVS_FST_CONFLICT 5 #define CVS_FST_PATCHED 6 TAILQ_HEAD(cvs_flist, cvs_file); typedef struct cvs_file { ! char *cf_path; ! struct cvs_file *cf_parent; /* parent directory (NULL if none) */ ! char *cf_name; ! mode_t cf_mode; ! time_t cf_mtime; ! u_int16_t cf_cvstat; /* cvs status of the file */ ! u_int16_t cf_type; /* uses values from dirent.h */ ! struct cvs_dir *cf_ddat; /* only for directories */ TAILQ_ENTRY(cvs_file) cf_list; } CVSFILE; #define CVS_DIRF_STATIC 0x01 --- 74,103 ---- #define CVS_FST_CONFLICT 5 #define CVS_FST_PATCHED 6 + + struct cvs_fname { + char *cf_name; + u_int cf_ref; + SLIST_ENTRY(cvs_fname) cf_list; + }; + TAILQ_HEAD(cvs_flist, cvs_file); typedef struct cvs_file { ! struct cvs_file *cf_parent; /* parent directory (NULL if none) */ ! struct cvs_fname *cf_name; ! mode_t cf_mode; ! time_t cf_mtime; ! u_int16_t cf_cvstat; /* cvs status of the file */ ! u_int16_t cf_type; /* uses values from dirent.h */ ! struct cvs_dir *cf_ddat; /* only for directories */ TAILQ_ENTRY(cvs_file) cf_list; } CVSFILE; + #define CVS_FILE_NAME(cf) (cf->cf_name->cf_name) #define CVS_DIRF_STATIC 0x01 *************** *** 92,103 **** struct cvs_dir { - u_int cd_flags; struct cvsroot *cd_root; char *cd_repo; struct cvs_entries *cd_ent; struct cvs_flist cd_files; ! u_int cd_nfiles; }; --- 105,116 ---- struct cvs_dir { struct cvsroot *cd_root; char *cd_repo; struct cvs_entries *cd_ent; struct cvs_flist cd_files; ! u_int16_t cd_nfiles; ! u_int16_t cd_flags; }; *************** *** 116,128 **** int cvs_file_init (void); int cvs_file_ignore (const char *); int cvs_file_chkign (const char *); - CVSFILE* cvs_file_create (const char *, u_int, mode_t); CVSFILE* cvs_file_get (const char *, int); CVSFILE* cvs_file_getspec (char **, int, int); CVSFILE* cvs_file_find (CVSFILE *, const char *); int cvs_file_attach (CVSFILE *, CVSFILE *); int cvs_file_examine (CVSFILE *, int (*)(CVSFILE *, void *), void *); ! void cvs_file_free (struct cvs_file *); #endif /* FILE_H */ --- 129,142 ---- int cvs_file_init (void); int cvs_file_ignore (const char *); int cvs_file_chkign (const char *); CVSFILE* cvs_file_get (const char *, int); CVSFILE* cvs_file_getspec (char **, int, int); + CVSFILE* cvs_file_create (CVSFILE *, const char *, u_int, mode_t); CVSFILE* cvs_file_find (CVSFILE *, const char *); int cvs_file_attach (CVSFILE *, CVSFILE *); + char* cvs_file_getpath (CVSFILE *, char *, size_t); int cvs_file_examine (CVSFILE *, int (*)(CVSFILE *, void *), void *); ! void cvs_file_free (CVSFILE *); #endif /* FILE_H */