1 #ifndef _TEMPRESULT_H
2 #define _TEMPRESULT_H
3 /* tempresult.h */
4 /*****************************************************************************/
5 /* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only                     */
6 /*                                                                           */
7 /* AS-Portierung                                                             */
8 /*                                                                           */
9 /* internal holder for int/float/string                                      */
10 /*                                                                           */
11 /*****************************************************************************/
12 
13 #include <stddef.h>
14 
15 #include "datatypes.h"
16 #include "dynstring.h"
17 #include "symflags.h"
18 #include "symbolsize.h"
19 
20 typedef enum
21 {
22   TempNone = 0,
23   TempInt = 1,
24   TempFloat = 2,
25   TempString = 4,
26   TempReg = 8,
27   TempAll = 15
28 } TempType;
29 
30 struct sRelocEntry;
31 
32 typedef unsigned tRegInt;
33 
34 typedef void (*DissectRegProc)(
35 #ifdef __PROTOS__
36 char *pDest, size_t DestSize, tRegInt Value, tSymbolSize InpSize
37 #endif
38 );
39 
40 typedef struct sRegDescr
41 {
42   DissectRegProc Dissect;
43   tRegInt Reg;
44 } tRegDescr;
45 
46 struct sTempResult
47 {
48   TempType Typ;
49   tSymbolFlags Flags;
50   unsigned AddrSpaceMask;
51   tSymbolSize DataSize;
52   struct sRelocEntry *Relocs;
53   DissectRegProc DissectReg;
54   union
55   {
56     LargeInt Int;
57     Double Float;
58     tDynString Ascii;
59     tRegDescr RegDescr;
60   } Contents;
61 };
62 typedef struct sTempResult TempResult;
63 
64 extern int TempResultToFloat(TempResult *pResult);
65 
66 extern int TempResultToPlainString(char *pDest, const TempResult *pResult, size_t DestSize);
67 
68 #endif /* _TEMPRESULT_H */
69