diff options
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* utility functions for `patch' */ +/* utility functions for 'patch' */ /* Copyright (C) 1986 Larry Wall @@ -27,6 +27,8 @@ Add one for the sign. */ #define LINENUM_LENGTH_BOUND (sizeof (lin) * CHAR_BIT / 3 + 1) +enum file_id_type { UNKNOWN, CREATED, DELETE_LATER, OVERWRITTEN }; + XTERN enum backup_type backup_type; bool ok_to_reverse (char const *, ...) __attribute__ ((format (printf, 1, 2))); @@ -38,7 +40,7 @@ void fatal (char const *, ...) void pfatal (char const *, ...) __attribute__ ((noreturn, format (printf, 1, 2))); -void fetchname (char const *, int, bool, char **, char **, struct timespec *); +void fetchname (char const *, int, char **, char **, struct timespec *); char *parse_name (char const *, int, char const **); char *savebuf (char const *, size_t); char *savestr (char const *); @@ -55,14 +57,18 @@ void ignore_signals (void); void init_backup_hash_table (void); void init_time (void); void xalloc_die (void) __attribute__ ((noreturn)); -void create_backup (char const *, struct stat *, int *, bool, bool); -void move_file (char const *, int *, struct stat const *, char const *, mode_t, bool); +void create_backup (char const *, const struct stat *, bool); +void move_file (char const *, bool *, struct stat const *, char const *, mode_t, bool); void read_fatal (void) __attribute__ ((noreturn)); void remove_prefix (char *, size_t); void removedirs (char const *); void set_signals (bool); void write_fatal (void) __attribute__ ((noreturn)); -bool file_already_seen (struct stat const *); +void insert_file_id (struct stat const *, enum file_id_type); +enum file_id_type lookup_file_id (struct stat const *); +void set_queued_output (struct stat const *, bool); +bool has_queued_output (struct stat const *); +int stat_file (char const *, struct stat *); enum file_attributes { FA_TIMES = 1, @@ -72,7 +78,7 @@ enum file_attributes { }; void set_file_attributes (char const *, enum file_attributes, char const *, - struct stat *, mode_t, struct timespec *); + const struct stat *, mode_t, struct timespec *); static inline char const * _GL_ATTRIBUTE_PURE skip_spaces (char const *str) |