Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef _TOOLUTILS_H
  2. #define _TOOLUTILS_H
  3. /* toolutils.c */
  4. /*****************************************************************************/
  5. /* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only                     */
  6. /*                                                                           */
  7. /* AS-Portierung                                                             */
  8. /*                                                                           */
  9. /*****************************************************************************/
  10.  
  11. #include "fileformat.h"
  12.  
  13. typedef struct
  14. {
  15.   LargeInt Addr;
  16.   LongInt Type;
  17.   char *Name;
  18. } TRelocEntry, *PRelocEntry;
  19.  
  20. typedef struct
  21. {
  22.   char *Name;
  23.   LargeInt Value;
  24.   LongInt Flags;
  25. } TExportEntry, *PExportEntry;
  26.  
  27. typedef struct
  28. {
  29.   LongInt RelocCount, ExportCount;
  30.   PRelocEntry RelocEntries;
  31.   PExportEntry ExportEntries;
  32.   char *Strings;
  33. } TRelocInfo, *PRelocInfo;
  34.  
  35. extern Word FileID;
  36.  
  37. extern const char *OutName;
  38.  
  39. extern void WrCopyRight(const char *Msg);
  40.  
  41. extern void DelSuffix(char *Name);
  42.  
  43. extern void AddSuffix(char *Name, unsigned NameSize, const char *Suff);
  44.  
  45. extern void FormatError(const char *Name, const char *Detail);
  46.  
  47. extern void ChkIO(const char *Name);
  48. extern void chk_wr_read_error(const char *p_name);
  49.  
  50. extern Word Granularity(Byte Header, Byte Segment);
  51.  
  52. extern void ReadRecordHeader(Byte *Header, Byte *Target, Byte* Segment,
  53.                              Byte *Gran, const char *Name, FILE *f);
  54.  
  55. extern void WriteRecordHeader(Byte *Header, Byte *Target, Byte* Segment,
  56.                               Byte *Gran, const char *Name, FILE *f);
  57.  
  58. extern void SkipRecord(Byte Header, const char *Name, FILE *f);
  59.  
  60. extern PRelocInfo ReadRelocInfo(FILE *f);
  61.  
  62. extern void DestroyRelocInfo(PRelocInfo PInfo);
  63.  
  64. extern as_cmd_result_t CMD_FilterList(Boolean Negate, const char *Arg);
  65.  
  66. extern as_cmd_result_t CMD_Range(LongWord *pStart, LongWord *pStop,
  67.                            Boolean *pStartAuto, Boolean *pStopAuto,
  68.                            const char *Arg);
  69.  
  70. extern Boolean FilterOK(Byte Header);
  71.  
  72. extern Boolean RemoveOffset(char *Name, LongWord *Offset);
  73.  
  74.  
  75. extern void EraseFile(const char *FileName, LongWord Offset);
  76.  
  77.  
  78. extern Boolean AddressWildcard(const char *addr);
  79.  
  80.  
  81. extern void toolutils_init(const char *ProgPath);
  82.  
  83. #endif /* _TOOLUTILS_H */
  84.