1/* utility functions for `patch' */ 2 3/* $Id: util.h 8008 2004-06-16 21:22:10Z korli $ */ 4 5/* An upper bound on the print length of a signed decimal line number. 6 Add one for the sign. */ 7#define LINENUM_LENGTH_BOUND (sizeof (LINENUM) * CHAR_BIT / 3 + 1) 8 9XTERN enum backup_type backup_type; 10 11int ok_to_reverse PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); 12void ask PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); 13void say PARAMS ((char const *, ...)) __attribute__ ((format (printf, 1, 2))); 14 15void fatal PARAMS ((char const *, ...)) 16 __attribute__ ((noreturn, format (printf, 1, 2))); 17void pfatal PARAMS ((char const *, ...)) 18 __attribute__ ((noreturn, format (printf, 1, 2))); 19 20char *fetchname PARAMS ((char *, int, time_t *)); 21char *savebuf PARAMS ((char const *, size_t)); 22char *savestr PARAMS ((char const *)); 23char const *version_controller PARAMS ((char const *, int, struct stat const *, char **, char **)); 24int version_get PARAMS ((char const *, char const *, int, int, char const *, struct stat *)); 25int create_file PARAMS ((char const *, int, mode_t)); 26int systemic PARAMS ((char const *)); 27char *format_linenum PARAMS ((char[LINENUM_LENGTH_BOUND + 1], LINENUM)); 28void Fseek PARAMS ((FILE *, file_offset, int)); 29void copy_file PARAMS ((char const *, char const *, int, mode_t)); 30void exit_with_signal PARAMS ((int)) __attribute__ ((noreturn)); 31void ignore_signals PARAMS ((void)); 32void init_time PARAMS ((void)); 33void memory_fatal PARAMS ((void)) __attribute__ ((noreturn)); 34void move_file PARAMS ((char const *, int volatile *, char *, mode_t, int)); 35void read_fatal PARAMS ((void)) __attribute__ ((noreturn)); 36void remove_prefix PARAMS ((char *, size_t)); 37void removedirs PARAMS ((char *)); 38void set_signals PARAMS ((int)); 39void write_fatal PARAMS ((void)) __attribute__ ((noreturn)); 40