bucomm.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* bucomm.h -- binutils common include file.
  2. Copyright (C) 1991-2022 Free Software Foundation, Inc.
  3. This file is part of GNU Binutils.
  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 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #ifndef _BUCOMM_H
  17. #define _BUCOMM_H
  18. /* In bucomm.c. */
  19. /* Return the filename in a static buffer. */
  20. const char *bfd_get_archive_filename (const bfd *);
  21. void bfd_nonfatal (const char *);
  22. void bfd_nonfatal_message (const char *, const bfd *, const asection *,
  23. const char *, ...);
  24. void bfd_fatal (const char *) ATTRIBUTE_NORETURN;
  25. void report (const char *, va_list) ATTRIBUTE_PRINTF(1,0);
  26. void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
  27. void non_fatal (const char *, ...) ATTRIBUTE_PRINTF_1;
  28. void set_default_bfd_target (void);
  29. void list_matching_formats (char **);
  30. void list_supported_targets (const char *, FILE *);
  31. void list_supported_architectures (const char *, FILE *);
  32. int display_info (void);
  33. void print_arelt_descr (FILE *, bfd *, bool, bool);
  34. char *make_tempname (const char *, int *);
  35. char *make_tempdir (const char *);
  36. bfd_vma parse_vma (const char *, const char *);
  37. off_t get_file_size (const char *);
  38. bool is_valid_archive_path (char const *);
  39. extern char *program_name;
  40. /* In filemode.c. */
  41. void mode_string (unsigned long, char *);
  42. /* In version.c. */
  43. extern void print_version (const char *);
  44. /* In rename.c. */
  45. extern void set_times (const char *, const struct stat *);
  46. extern int smart_rename (const char *, const char *, int,
  47. struct stat *, bool);
  48. /* In libiberty. */
  49. void *xmalloc (size_t);
  50. void *xrealloc (void *, size_t);
  51. #if __GNUC__ >= 7
  52. #define _mul_overflow(a, b, res) __builtin_mul_overflow (a, b, res)
  53. #else
  54. /* Assumes unsigned values. Careful! Args evaluated multiple times. */
  55. #define _mul_overflow(a, b, res) \
  56. ((*res) = (a), (*res) *= (b), (b) != 0 && (*res) / (b) != (a))
  57. #endif
  58. #endif /* _BUCOMM_H */