[BACK]Return to file.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/file.c between version 1.38 and 1.39

version 1.38, 2004/12/06 21:03:12 version 1.39, 2004/12/07 17:10:56
Line 59 
Line 59 
 /*  /*
  * Standard patterns to ignore.   * Standard patterns to ignore.
  */   */
   
 static const char *cvs_ign_std[] = {  static const char *cvs_ign_std[] = {
         ".",          ".",
         "..",          "..",
Line 89 
Line 88 
  * Filename hash table used to avoid duplication of name strings when working   * Filename hash table used to avoid duplication of name strings when working
  * on large source trees with common parts.   * on large source trees with common parts.
  */   */
   
 SLIST_HEAD(cvs_fhb, cvs_fname);  SLIST_HEAD(cvs_fhb, cvs_fname);
   
 static struct cvs_fhb cvs_fnht[CVS_FILE_NBUCKETS];  static struct cvs_fhb cvs_fnht[CVS_FILE_NBUCKETS];
Line 122 
Line 120 
  * cvs_file_init()   * cvs_file_init()
  *   *
  */   */
   
 int  int
 cvs_file_init(void)  cvs_file_init(void)
 {  {
Line 180 
Line 177 
  * Add the pattern <pat> to the list of patterns for files to ignore.   * Add the pattern <pat> to the list of patterns for files to ignore.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_file_ignore(const char *pat)  cvs_file_ignore(const char *pat)
 {  {
Line 216 
Line 212 
  * Returns 1 if the filename <file> is matched by one of the ignore   * Returns 1 if the filename <file> is matched by one of the ignore
  * patterns, or 0 otherwise.   * patterns, or 0 otherwise.
  */   */
   
 int  int
 cvs_file_chkign(const char *file)  cvs_file_chkign(const char *file)
 {  {
Line 247 
Line 242 
  * created.   * created.
  * Returns the created file on success, or NULL on failure.   * Returns the created file on success, or NULL on failure.
  */   */
   
 CVSFILE*  CVSFILE*
 cvs_file_create(CVSFILE *parent, const char *path, u_int type, mode_t mode)  cvs_file_create(CVSFILE *parent, const char *path, u_int type, mode_t mode)
 {  {
Line 301 
Line 295 
  * Returns the copied file on success, or NULL on failure.  The returned   * Returns the copied file on success, or NULL on failure.  The returned
  * structure should be freed using cvs_file_free().   * structure should be freed using cvs_file_free().
  */   */
   
 CVSFILE*  CVSFILE*
 cvs_file_copy(CVSFILE *orig)  cvs_file_copy(CVSFILE *orig)
 {  {
Line 358 
Line 351 
  * Returns a pointer to the lowest common subdirectory to all specified   * Returns a pointer to the lowest common subdirectory to all specified
  * files.   * files.
  */   */
   
 CVSFILE*  CVSFILE*
 cvs_file_getspec(char **fspec, int fsn, int flags)  cvs_file_getspec(char **fspec, int fsn, int flags)
 {  {
Line 410 
Line 402 
  * The file's pathname <path> must be relative to the base of <hier>.   * The file's pathname <path> must be relative to the base of <hier>.
  * Returns the entry on success, or NULL on failure.   * Returns the entry on success, or NULL on failure.
  */   */
   
 CVSFILE*  CVSFILE*
 cvs_file_find(CVSFILE *hier, const char *path)  cvs_file_find(CVSFILE *hier, const char *path)
 {  {
Line 463 
Line 454 
  * at least MAXPATHLEN bytes long.   * at least MAXPATHLEN bytes long.
  * Returns a pointer to the start of the path on success, or NULL on failure.   * Returns a pointer to the start of the path on success, or NULL on failure.
  */   */
   
 char*  char*
 cvs_file_getpath(CVSFILE *file, char *buf, size_t len)  cvs_file_getpath(CVSFILE *file, char *buf, size_t len)
 {  {
Line 509 
Line 499 
  * has to be a file of type DT_DIR.   * has to be a file of type DT_DIR.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_file_attach(CVSFILE *parent, CVSFILE *file)  cvs_file_attach(CVSFILE *parent, CVSFILE *file)
 {  {
Line 535 
Line 524 
  * This function should not free the directory information on error, as this   * This function should not free the directory information on error, as this
  * is performed by cvs_file_free().   * is performed by cvs_file_free().
  */   */
   
 static int  static int
 cvs_file_getdir(CVSFILE *cf, int flags)  cvs_file_getdir(CVSFILE *cf, int flags)
 {  {
Line 655 
Line 643 
  *   *
  * Free a cvs_file structure and its contents.   * Free a cvs_file structure and its contents.
  */   */
   
 void  void
 cvs_file_free(CVSFILE *cf)  cvs_file_free(CVSFILE *cf)
 {  {
Line 672 
Line 659 
  * <exam>.  The function is called for all subdirectories and files of the   * <exam>.  The function is called for all subdirectories and files of the
  * root file.   * root file.
  */   */
   
 int  int
 cvs_file_examine(CVSFILE *cf, int (*exam)(CVSFILE *, void *), void *arg)  cvs_file_examine(CVSFILE *cf, int (*exam)(CVSFILE *, void *), void *arg)
 {  {
Line 698 
Line 684 
  *   *
  * Free a cvs_dir structure and its contents.   * Free a cvs_dir structure and its contents.
  */   */
   
 static void  static void
 cvs_file_freedir(struct cvs_dir *cd)  cvs_file_freedir(struct cvs_dir *cd)
 {  {
Line 728 
Line 713 
  * in the list must be given by <nfiles>.   * in the list must be given by <nfiles>.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 static int  static int
 cvs_file_sort(struct cvs_flist *flp, u_int nfiles)  cvs_file_sort(struct cvs_flist *flp, u_int nfiles)
 {  {
Line 790 
Line 774 
  *   *
  * Allocate a CVSFILE structure and initialize its internals.   * Allocate a CVSFILE structure and initialize its internals.
  */   */
   
 CVSFILE*  CVSFILE*
 cvs_file_alloc(const char *path, u_int type)  cvs_file_alloc(const char *path, u_int type)
 {  {
Line 848 
Line 831 
  * Returns a pointer to the created file structure on success, or NULL on   * Returns a pointer to the created file structure on success, or NULL on
  * failure.   * failure.
  */   */
   
 static CVSFILE*  static CVSFILE*
 cvs_file_lget(const char *path, int flags, CVSFILE *parent)  cvs_file_lget(const char *path, int flags, CVSFILE *parent)
 {  {
Line 921 
Line 903 
  * Generate an 8 bit hash value from the name of a file.   * Generate an 8 bit hash value from the name of a file.
  * XXX Improve my distribution!   * XXX Improve my distribution!
  */   */
   
 static u_int8_t  static u_int8_t
 cvs_file_hashname(const char *name)  cvs_file_hashname(const char *name)
 {  {
Line 943 
Line 924 
  * If no entry is found for that name, a new one is created and inserted into   * If no entry is found for that name, a new one is created and inserted into
  * the table.  The name's reference count is increased.   * the table.  The name's reference count is increased.
  */   */
   
 static struct cvs_fname*  static struct cvs_fname*
 cvs_file_getname(const char *name)  cvs_file_getname(const char *name)
 {  {

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39