vms.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* vms.h -- Header file for VMS (Alpha and Vax) support.
  2. Copyright (C) 1996-2022 Free Software Foundation, Inc.
  3. Main header file.
  4. Written by Klaus K"ampf (kkaempf@rmi.de)
  5. This file is part of BFD, the Binary File Descriptor library.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  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., 51 Franklin Street - Fifth Floor, Boston,
  17. MA 02110-1301, USA. */
  18. #undef vms
  19. #ifndef VMS_H
  20. #define VMS_H
  21. #include <time.h>
  22. /* Size of a VMS block on disk. */
  23. #define VMS_BLOCK_SIZE 512
  24. /* Miscellaneous definitions. */
  25. #define MAX_OUTREC_SIZE 4096
  26. #define MIN_OUTREC_LUFT 64
  27. /* File format. */
  28. enum file_format_enum
  29. {
  30. /* Not yet known. */
  31. FF_UNKNOWN,
  32. /* Unix format. Each record is preceeded by the record length,
  33. on 2 bytes. */
  34. FF_FOREIGN,
  35. /* Native (=VMS) format. The file only contains the content of the
  36. records. This may also appear on Unix, depending on which tool
  37. was used to transfer files. */
  38. FF_NATIVE
  39. };
  40. /* VMS records input buffer. */
  41. struct vms_rec_rd
  42. {
  43. /* Buffer and its size. */
  44. unsigned char *buf;
  45. unsigned int buf_size;
  46. /* Current record and its size. */
  47. unsigned char *rec;
  48. unsigned int rec_size;
  49. /* Input file format. */
  50. enum file_format_enum file_format;
  51. };
  52. /* VMS records output buffer. */
  53. struct vms_rec_wr
  54. {
  55. /* Output buffer. */
  56. unsigned char *buf;
  57. /* Current length of the record. */
  58. unsigned short int size;
  59. /* Sub-record start offset. */
  60. unsigned short int subrec_offset;
  61. /* Some records must have a size that is a multiple of the alignment.
  62. Mustn't be 0. */
  63. unsigned short int align;
  64. };
  65. struct evax_private_udata_struct
  66. {
  67. asymbol *bsym;
  68. asymbol *enbsym;
  69. char *origname;
  70. int lkindex;
  71. };
  72. /* vms-misc.c. */
  73. #define VMS_DEBUG 0
  74. #if VMS_DEBUG
  75. extern void _bfd_vms_debug (int, char *, ...) ATTRIBUTE_PRINTF_2;
  76. extern void _bfd_hexdump (int, unsigned char *, int, int);
  77. #define vms_debug _bfd_vms_debug
  78. #define vms_debug2(X) _bfd_vms_debug X
  79. #else
  80. #define vms_debug2(X)
  81. #endif
  82. extern char * vms_get_module_name (const char *, bool);
  83. extern unsigned char *get_vms_time_string (unsigned char *);
  84. extern time_t vms_time_to_time_t (unsigned int hi, unsigned int lo);
  85. extern time_t vms_rawtime_to_time_t (unsigned char *);
  86. extern void vms_time_t_to_vms_time (time_t ut, unsigned int *hi, unsigned int *lo);
  87. extern void vms_get_time (unsigned int *hi, unsigned int *lo);
  88. extern void vms_raw_get_time (unsigned char *buf);
  89. extern char * _bfd_vms_save_sized_string (bfd *, unsigned char *, size_t);
  90. extern char * _bfd_vms_save_counted_string (bfd *, unsigned char *, size_t);
  91. extern void _bfd_vms_output_begin (struct vms_rec_wr *, int);
  92. extern void _bfd_vms_output_alignment (struct vms_rec_wr *, int);
  93. extern void _bfd_vms_output_begin_subrec (struct vms_rec_wr *, int);
  94. extern void _bfd_vms_output_end_subrec (struct vms_rec_wr *);
  95. extern void _bfd_vms_output_end (bfd *, struct vms_rec_wr *);
  96. extern int _bfd_vms_output_check (struct vms_rec_wr *, int);
  97. extern void _bfd_vms_output_byte (struct vms_rec_wr *, unsigned);
  98. extern void _bfd_vms_output_short (struct vms_rec_wr *, unsigned);
  99. extern void _bfd_vms_output_long (struct vms_rec_wr *, unsigned long);
  100. extern void _bfd_vms_output_quad (struct vms_rec_wr *, bfd_vma);
  101. extern void _bfd_vms_output_counted (struct vms_rec_wr *, const char *);
  102. extern void _bfd_vms_output_dump (struct vms_rec_wr *, const unsigned char *, int);
  103. extern void _bfd_vms_output_fill (struct vms_rec_wr *, int, int);
  104. extern int _bfd_vms_convert_to_var_unix_filename (const char *);
  105. /* vms-alpha.c */
  106. extern void bfd_vms_set_section_flags (bfd *, asection *, flagword, flagword);
  107. #endif /* VMS_H */