home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / fileutil.lha / fileutils-3.3 / src / cp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-02  |  2.2 KB  |  82 lines

  1. /* cp.h  -- file copying (data definitions)
  2.    Copyright (C) 1989, 1990, 1991 Free Software Foundation.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.    Written by Torbjorn Granlund, Sweden (tege@sics.se). */
  19.  
  20. #include <sys/types.h>
  21. #include "system.h"
  22.  
  23. struct dir_list
  24. {
  25.   struct dir_list *parent;
  26.   ino_t ino;
  27.   dev_t dev;
  28. };
  29.  
  30. struct entry
  31. {
  32.   ino_t ino;
  33.   dev_t dev;
  34.   char *node;            /* Path name, or &new_file for new inodes.  */
  35.   struct entry *coll_link;    /* 0 = entry not occupied.  */
  36. };
  37.  
  38. struct htab
  39. {
  40.   unsigned modulus;        /* Size of the `hash' pointer vector.  */
  41.   struct entry *entry_tab;    /* Pointer to dynamically growing vector.  */
  42.   unsigned entry_tab_size;    /* Size of current `entry_tab' allocation.  */
  43.   unsigned first_free_entry;    /* Index in `entry_tab'.  */
  44.   struct entry *hash[1];    /* Vector of pointers in `entry_tab'.  */
  45. };
  46.  
  47. extern int exit_status;
  48. extern struct htab *htab;
  49.  
  50. /* For created inodes, a pointer in the search structure to this
  51.    character identifies that the inode as new.  */
  52. extern char new_file;
  53.  
  54. char *basename ();
  55. char *xmalloc ();
  56. char *xrealloc ();
  57. void forget_copied ();
  58. void forget_all ();
  59. int copy_reg ();
  60. void hash_init ();
  61. char *remember_copied ();
  62. int remember_created ();
  63. void error ();
  64. void usage ();
  65. char *savedir ();
  66. char *stpcpy ();
  67. int yesno ();
  68. int do_copy ();
  69. int copy ();
  70. int copy_dir ();
  71. void strip_trailing_slashes ();
  72. int is_ancestor ();
  73.  
  74. #ifndef S_IWRITE
  75. #define S_IWRITE S_IWUSR
  76. #define S_IEXEC S_IXUSR
  77. #endif
  78.  
  79. /* stat and lstat need to be declared because we use their addresses. */
  80. int stat ();
  81. int lstat ();
  82.