#ifndef SUBR_H
# define SUBR_H
void expand_string (char **, size_t *, size_t);
char *Xreadlink (const char *link, size_t size);
void xrealloc_and_strcat (char **, size_t *, const char *);
int strip_trailing_newlines (char *str);
int pathname_levels (const char *path);
void free_names (int *pargc, char *argv[]);
void line2argv (int *pargc, char ***argv, char *line, char *sepchars);
int numdots (const char *s);
int compare_revnums (const char *, const char *);
char *increment_revnum (const char *);
char *getcaller (void);
char *previous_rev (RCSNode *rcs, const char *rev);
char *gca (const char *rev1, const char *rev2);
void check_numeric (const char *, int, char **);
char *make_message_rcsvalid (const char *message);
int file_has_markers (const struct file_info *);
void get_file (const char *, const char *, const char *,
char **, size_t *, size_t *);
void resolve_symlink (char **filename);
char *backup_file (const char *file, const char *suffix);
char *shell_escape (char *buf, const char *str);
void sleep_past (time_t desttime);
struct format_cmdline_walklist_closure
{
const char *format;
char **buf;
size_t *length;
char **d;
char quotes;
#ifdef SUPPORT_OLD_INFO_FMT_STRINGS
int onearg;
int firstpass;
const char *srepos;
#endif
void *closure;
};
char *cmdlinequote (char quotes, char *s);
char *cmdlineescape (char quotes, char *s);
#ifdef SUPPORT_OLD_INFO_FMT_STRINGS
char *format_cmdline (bool oldway, const char *srepos, const char *format, ...);
#else
char *format_cmdline (const char *format, ...);
#endif
#define xstrdup Xstrdup
char *Xstrdup (const char *str)
__attribute__ ((__malloc__));
char *Xasprintf (const char *format, ...)
__attribute__ ((__malloc__, __format__ (__printf__, 1, 2)));
char *Xasnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
__attribute__ ((__malloc__, __format__ (__printf__, 3, 4)));
bool readBool (const char *infopath, const char *option,
const char *p, bool *val);
FILE *xfopen (const char *, const char *);
char *xcanonicalize_file_name (const char *path);
bool isThisHost (const char *otherhost);
bool isSamePath (const char *path1_in, const char *path2_in);
#endif