Subversion Repositories pentevo

Rev

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

  1. #ifndef _ASMSTRUCTS_H
  2. #define _ASMSTRUCTS_H
  3. /* asmstructs.h  */
  4. /*****************************************************************************/
  5. /* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only                     */
  6. /*                                                                           */
  7. /* AS-Portierung                                                             */
  8. /*                                                                           */
  9. /* functions for structure handling                                          */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12.  
  13.  
  14. #include "symbolsize.h"
  15. #include "addrspace.h"
  16.  
  17. struct sStructElem;
  18. struct sStrComp;
  19.  
  20. typedef void (*tStructElemExpandFnc)(const struct sStrComp *pVarName, const struct sStructElem *pStructElem, LargeWord Base);
  21.  
  22. typedef struct sStructElem
  23. {
  24.   struct sStructElem *Next;
  25.   char *pElemName, *pRefElemName;
  26.   Boolean IsStruct;
  27.   tStructElemExpandFnc ExpandFnc;
  28.   LongInt Offset;
  29.   ShortInt BitPos; /* -1 -> no bit position */
  30.   ShortInt BitWidthM1; /* -1 -> no bit field, otherwise actual width minus one */
  31.   tSymbolSize OpSize;
  32. } TStructElem, *PStructElem;
  33.  
  34. typedef struct sStructRec
  35. {
  36.   LongInt TotLen;
  37.   PStructElem Elems;
  38.   char ExtChar;
  39.   Boolean DoExt;
  40.   Boolean IsUnion;
  41. } TStructRec, *PStructRec;
  42.  
  43. typedef struct sStructStack
  44. {
  45.   struct sStructStack *Next;
  46.   char *Name, *pBaseName;
  47.   LargeWord SaveCurrPC, SaveOffsetToInnermost;
  48.   PStructRec StructRec;
  49. } TStructStack, *PStructStack;
  50.  
  51. extern PStructStack StructStack, pInnermostNamedStruct;
  52. extern as_addrspace_t StructSaveSeg;
  53.  
  54. extern PStructRec CreateStructRec(void);
  55.  
  56. extern void DestroyStructElem(PStructElem pStructElem);
  57.  
  58. extern void DestroyStructRec(PStructRec StructRec);
  59.  
  60. extern void BuildStructName(char *pResult, unsigned ResultLen, const char *pName);
  61.  
  62. extern PStructElem CreateStructElem(const struct sStrComp *pElemName);
  63.  
  64. extern PStructElem CloneStructElem(const struct sStrComp *pCloneElemName, const struct sStructElem *pSrc);
  65.  
  66. extern Boolean AddStructElem(PStructRec pStructRec, PStructElem pElement);
  67.  
  68. extern void SetStructElemSize(PStructRec pStructRec, const struct sStrComp *pElemName, tSymbolSize Size);
  69.  
  70. extern void AddStructSymbol(const char *pName, LargeWord Value);
  71.  
  72. extern void ResolveStructReferences(PStructRec pStructRec);
  73.  
  74. extern void BumpStructLength(PStructRec StructRec, LongInt Length);
  75.  
  76. extern void AddStruct(PStructRec StructRec, char *Name, Boolean Protest);
  77.  
  78. extern Boolean FoundStruct(PStructRec *Erg, const char *pName);
  79.  
  80. extern void ResetStructDefines(void);
  81.  
  82. extern void PrintStructList(void);
  83.  
  84. extern void ClearStructList(void);
  85.  
  86. extern void ExpandStruct(PStructRec StructRec, const char *p_struct_name);
  87.  
  88. extern void asmstruct_init(void);
  89.  
  90. #endif /* _ASMSTRUCTS_H */
  91.