void AsmDefInit(void)
{
+#if 1
+ abort();
+#else
LongInt z;
DoLst = eLstMacroExpAll;
FirstDefine = NULL;
FirstSaveState = NULL;
+#endif
}
void NullProc(void)
{
+#if 1
+ abort();
+#else
+#endif
}
void Default_InternSymbol(char *Asc, TempResult *Erg)
{
+#if 1
+ abort();
+#else
UNUSED(Asc);
Erg->Typ = TempNone;
+#endif
}
void Default_DissectBit(char *pDest, size_t DestSize, LargeWord BitSpec)
{
+#if 1
+ abort();
+#else
HexString(pDest, DestSize, BitSpec, 0);
+#endif
}
static char *GetString(void)
{
+#if 1
+ abort();
+#else
return (char*)malloc(STRINGSIZE * sizeof(char));
+#endif
}
int SetMaxCodeLen(LongWord NewMaxCodeLen)
{
+#if 1
+ abort();
+#else
if (NewMaxCodeLen > MaxCodeLen_Max)
return ENOMEM;
if (NewMaxCodeLen > MaxCodeLen)
MaxCodeLen = NewMaxCodeLen;
}
return 0;
+#endif
}
/*!------------------------------------------------------------------------
void AppendArg(size_t ReqSize)
{
+#if 1
+ abort();
+#else
if (ArgCnt >= ArgCntMax)
WrXError(ErrNum_InternalError, "MaxArgCnt");
++ArgCnt;
if (as_dynstr_realloc(&ArgStr[ArgCnt].str, as_dynstr_roundup_len(ReqSize)))
WrXError(ErrNum_InternalError, "out of memory");
}
+#endif
}
/*!------------------------------------------------------------------------
void InsertArg(int Index, size_t ReqSize)
{
+#if 1
+ abort();
+#else
int z;
/* 0 should never be passed... */
if (as_dynstr_realloc(&ArgStr[Index].str, as_dynstr_roundup_len(ReqSize)))
WrXError(ErrNum_InternalError, "out of memory");
}
+#endif
}
Boolean SetIsOccupied(void)
{
+#if 1
+ abort();
+#else
return SetIsOccupiedFnc && SetIsOccupiedFnc();
+#endif
}
Boolean SaveIsOccupied(void)
{
+#if 1
+ abort();
+#else
return SaveIsOccupiedFnc && SaveIsOccupiedFnc();
+#endif
}
Boolean RestoreIsOccupied(void)
{
+#if 1
+ abort();
+#else
return RestoreIsOccupiedFnc && RestoreIsOccupiedFnc();
+#endif
}
void asmdef_init(void)
{
+#if 1
+ abort();
+#else
SwitchFrom = NullProc;
InternSymbol = Default_InternSymbol;
DissectBit = Default_DissectBit;
SegLimits = (LargeWord*)calloc(SegCount, sizeof(*SegLimits));
Phases = (LargeWord*)calloc(SegCountPlusStruct, sizeof(*Phases));
PCs = (LargeWord*)calloc(SegCountPlusStruct, sizeof(*PCs));
+#endif
}
static void ClearExpectErrors(void)
{
+#if 1
+ abort();
+#else
tExpectError *pOld;
while (pExpectErrors)
pExpectErrors = pExpectErrors->pNext;
free(pOld);
}
+#endif
}
static void AddExpectError(tExpectError *pExpectError)
{
+#if 1
+ abort();
+#else
pExpectError->pNext = pExpectErrors;
pExpectErrors = pExpectError;
+#endif
}
static tExpectError *FindAndTakeExpectError(tErrorNum Num)
{
+#if 1
+ abort();
+#else
tExpectError *pRun, *pPrev;
for (pRun = pExpectErrors, pPrev = NULL; pRun; pPrev = pRun, pRun = pRun->pNext)
return pRun;
}
return NULL;
+#endif
}
/*!------------------------------------------------------------------------
static void GenLineMarker(char *pDest, unsigned DestSize, char Marker, const struct sLineComp *pLineComp, const char *pPrefix)
{
+#if 1
+ abort();
+#else
char *pRun;
int z;
for (z = 0; (z < (int)pLineComp->Len) && (pRun - pDest + 1 < (int)DestSize); z++)
*pRun++ = Marker;
*pRun = '\0';
+#endif
}
/*!------------------------------------------------------------------------
static void GenLineForMarking(char *pDest, unsigned DestSize, const char *pSrc, const char *pPrefix)
{
+#if 1
+ abort();
+#else
char *pRun;
strmaxcpy(pDest, pPrefix, DestSize);
for (; *pSrc && (pRun - pDest + 1 < (int)DestSize); pSrc++)
*pRun++ = TabCompressed(*pSrc);
*pRun = '\0';
+#endif
}
/*!------------------------------------------------------------------------
static void EmergencyStop(void)
{
+#if 1
+ abort();
+#else
CloseIfOpen(&ErrorFile);
CloseIfOpen(&LstFile);
if (ShareMode != 0)
CloseIfOpen(&PrgFile);
unlink(OutName);
}
+#endif
}
/*!------------------------------------------------------------------------
static const char *ErrorNum2String(tErrorNum Num, char *Buf, int BufSize)
{
+#if 1
+ abort();
+#else
int msgno = -1;
*Buf = '\0';
as_snprintf(Buf, BufSize, "%s %d", getmessage(Num_ErrMsgIntError), (int) Num);
}
return (msgno != -1) ? getmessage(msgno) : Buf;
+#endif
}
/*!------------------------------------------------------------------------
void WrErrorString(const char *pMessage, const char *pAdd, Boolean Warning, Boolean Fatal,
const char *pExtendError, const struct sLineComp *pLineComp)
{
+#if 1
+ abort();
+#else
String ErrStr[4];
unsigned ErrStrCount = 0, z;
char *p;
EmergencyStop();
exit(3);
}
+#endif
}
/*!------------------------------------------------------------------------
void WrXErrorPos(tErrorNum Num, const char *pExtendError, const struct sLineComp *pLineComp)
{
+#if 1
+ abort();
+#else
String h;
char Add[11];
const char *pErrorMsg;
else
*Add = '\0';
WrErrorString(pErrorMsg, Add, Num < 1000, Num >= 10000, pExtendError, pLineComp);
+#endif
}
/*!------------------------------------------------------------------------
void WrStrErrorPos(tErrorNum Num, const struct sStrComp *pStrComp)
{
+#if 1
+ abort();
+#else
WrXErrorPos(Num, pStrComp->str.p_str, &pStrComp->Pos);
+#endif
}
/*!------------------------------------------------------------------------
void WrError(tErrorNum Num)
{
+#if 1
+ abort();
+#else
WrXErrorPos(Num, NULL, NULL);
+#endif
}
/*!------------------------------------------------------------------------
void WrXError(tErrorNum Num, const char *pExtError)
{
+#if 1
+ abort();
+#else
WrXErrorPos(Num, pExtError, NULL);
+#endif
}
/*!------------------------------------------------------------------------
void ChkIO(tErrorNum ErrNo)
{
+#if 1
+ abort();
+#else
int io;
io = errno;
return;
WrXError(ErrNo, GetErrorMsg(io));
+#endif
}
/*!------------------------------------------------------------------------
void ChkXIO(tErrorNum ErrNo, char *pExtError)
{
+#if 1
+ abort();
+#else
tStrComp TmpComp;
StrCompMkTemp(&TmpComp, pExtError, 0);
ChkStrIO(ErrNo, &TmpComp);
+#endif
}
/*!------------------------------------------------------------------------
void ChkStrIO(tErrorNum ErrNo, const struct sStrComp *pComp)
{
+#if 1
+ abort();
+#else
int io;
String s;
WrXErrorPos(ErrNo, s, &pComp->Pos);
else
WrXError(ErrNo, s);
+#endif
}
/*!------------------------------------------------------------------------
void CodeEXPECT(Word Code)
{
+#if 1
+ abort();
+#else
UNUSED(Code);
if (!ChkArgCnt(1, ArgCntMax));
}
InExpect = True;
}
+#endif
}
/*!------------------------------------------------------------------------
void CodeENDEXPECT(Word Code)
{
+#if 1
+ abort();
+#else
UNUSED(Code);
if (!ChkArgCnt(0, 0));
}
InExpect = False;
}
+#endif
}
/*!------------------------------------------------------------------------
void AsmErrPassInit(void)
{
+#if 1
+ abort();
+#else
ErrorCount = 0;
WarnCount = 0;
ClearExpectErrors();
InExpect = False;
+#endif
}
/*!------------------------------------------------------------------------
void AsmErrPassExit(void)
{
+#if 1
+ abort();
+#else
if (InExpect)
WrError(ErrNum_MissingENDEXPECT);
ClearExpectErrors();
InExpect = False;
+#endif
}
static Boolean AddSingle(PInstTreeNode *Node, char *NName, InstProc NProc, Word NIndex)
{
+#if 1
+ abort();
+#else
PInstTreeNode p1, p2;
Boolean Result = False;
}
}
return Result;
+#endif
}
void AddInstTree(PInstTreeNode *Root, char *NName, InstProc NProc, Word NIndex)
{
+#if 1
+ abort();
+#else
AddSingle(Root, NName, NProc, NIndex);
+#endif
}
static void ClearSingle(PInstTreeNode *Node)
{
+#if 1
+ abort();
+#else
ChkStack();
if (*Node)
free(*Node);
*Node = NULL;
}
+#endif
}
void ClearInstTree(PInstTreeNode *Root)
{
+#if 1
+ abort();
+#else
ClearSingle(Root);
+#endif
}
Boolean SearchInstTree(PInstTreeNode Root, char *OpPart)
{
+#if 1
+ abort();
+#else
int z;
z = 0;
Root->Proc(Root->Index);
return True;
}
+#endif
}
static void PNode(PInstTreeNode Node, Word Lev)
{
+#if 1
+ abort();
+#else
ChkStack();
if (Node)
{
printf("%*s %s %p %p %d\n", 5 * Lev, "", Node->Name, (void*)Node->Left, (void*)Node->Right, Node->Balance);
PNode(Node->Right, Lev + 1);
}
+#endif
}
void PrintInstTree(PInstTreeNode Root)
{
+#if 1
+ abort();
+#else
PNode(Root, 0);
+#endif
}
/*----------------------------------------------------------------------------*/
static int GetKey(const char *Name, LongWord TableSize)
{
+#if 1
+ abort();
+#else
register unsigned char *p;
LongWord tmp = 0;
for (p = (unsigned char *)Name; *p != '\0'; p++)
tmp = (tmp << 2) + ((LongWord)*p);
return tmp % TableSize;
+#endif
}
PInstTable CreateInstTable(int TableSize)
{
+#if 1
+ abort();
+#else
int z;
PInstTableEntry tmp;
PInstTable tab;
tab->Entries = tmp;
tab->Dynamic = FALSE;
return tab;
+#endif
}
void SetDynamicInstTable(PInstTable Table)
{
+#if 1
+ abort();
+#else
Table->Dynamic = TRUE;
+#endif
}
void DestroyInstTable(PInstTable tab)
{
+#if 1
+ abort();
+#else
int z;
if (tab->Dynamic)
free(tab->Entries);
free(tab);
+#endif
}
void AddInstTable(PInstTable tab, const char *Name, Word Index, InstProc Proc)
{
+#if 1
+ abort();
+#else
LongWord h0 = GetKey(Name, tab->Size), z = 0;
/* mindestens ein freies Element lassen, damit der Sucher garantiert terminiert */
if ((LongInt)(++h0) == tab->Size)
h0 = 0;
}
+#endif
}
void RemoveInstTable(PInstTable tab, const char *Name)
{
+#if 1
+ abort();
+#else
LongWord h0 = GetKey(Name, tab->Size);
while (1)
if ((LongInt)(++h0) == tab->Size)
h0 = 0;
}
+#endif
}
Boolean LookupInstTable(PInstTable tab, const char *Name)
{
+#if 1
+ abort();
+#else
LongWord h0 = GetKey(Name, tab->Size);
while (1)
if ((LongInt)(++h0) == tab->Size)
h0 = 0;
}
+#endif
}
void PrintInstTable(FILE *stream, PInstTable tab)
{
+#if 1
+ abort();
+#else
int z;
for (z = 0; z < tab->Size; z++)
if (tab->Entries[z].Name)
fprintf(stream, "[%3d]: %-10s Index %4d Coll %2d\n", z,
tab->Entries[z].Name, tab->Entries[z].Index, tab->Entries[z].Coll);
+#endif
}
/*----------------------------------------------------------------------------*/
void asmitree_init(void)
{
+#if 1
+ abort();
+#else
+#endif
}
void AsmParsInit(void)
{
+#if 1
+ abort();
+#else
FirstSymbol = NULL;
FirstLocSymbol = NULL; MomLocHandle = -1; SetMomSection(-1);
RadixBase = 10;
OutRadixBase = 16;
RegistersDefined = False;
+#endif
}
/*!------------------------------------------------------------------------
static Boolean range_not_checkable(IntType type)
{
+#if 1
+ abort();
+#else
#ifndef HAS64
return (((int)type) >= ((int)SInt32));
#else
return (((int)type) >= ((int)SInt64));
#endif
+#endif
}
/*!------------------------------------------------------------------------
Boolean RangeCheck(LargeInt Wert, IntType Typ)
{
+#if 1
+ abort();
+#else
return range_not_checkable(Typ) || ((Wert >= IntTypeDefs[(int)Typ].Min) && (Wert <= IntTypeDefs[(int)Typ].Max));
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkRangeByType(LargeInt value, IntType type, const struct sStrComp *p_comp)
{
+#if 1
+ abort();
+#else
return range_not_checkable(type) || ChkRangePos(value, IntTypeDefs[(int)type].Min, IntTypeDefs[(int)type].Max, p_comp);
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkRangeWarnByType(LargeInt value, IntType type, const struct sStrComp *p_comp)
{
+#if 1
+ abort();
+#else
return range_not_checkable(type) || ChkRangeWarnPos(value, IntTypeDefs[(int)type].Min, IntTypeDefs[(int)type].Max, p_comp);
+#endif
}
Boolean FloatRangeCheck(Double Wert, FloatType Typ)
{
+#if 1
+ abort();
+#else
/* NaN/Infinity is representable in all formats */
int numclass = as_fpclassify(Wert);
return False;
}
/** if (Typ == FloatDec) && (fabs(Wert) > 1e1000) WrError(ErrNum_BigDecFloat);**/
+#endif
}
Boolean SingleBit(LargeInt Inp, LargeInt *Erg)
{
+#if 1
+ abort();
+#else
*Erg = 0;
do
{
}
while ((*Erg != LARGEBITS) && (!Odd(Inp)));
return (*Erg != LARGEBITS) && (Inp == 1);
-}
+#endif
+}
IntType GetSmallestUIntType(LargeWord MaxValue)
{
+#if 1
+ abort();
+#else
IntType Result;
Result = (IntType) 0;
return Result;
}
return UInt32;
+#endif
}
IntType GetUIntTypeByBits(unsigned Bits)
{
+#if 1
+ abort();
+#else
IntType Result;
for (Result = (IntType) 0; Result < IntTypeCnt; Result++)
{
}
fprintf(stderr, "define unsigned int type with %u bits\n", Bits);
exit(255);
+#endif
}
static Boolean ProcessBk(char **Start, char *Erg)
{
+#if 1
+ abort();
+#else
LongInt System = 0, Acc = 0, Digit = 0;
char ch;
int cnt;
WrError(ErrNum_InvEscSequence);
return False;
}
+#endif
}
/*!------------------------------------------------------------------------
LargeInt NonZString2Int(const struct as_nonz_dynstr *p_str)
{
+#if 1
+ abort();
+#else
if ((p_str->len > 0) && (p_str->len <= 4))
{
const char *pRun;
return Result;
}
return -1;
+#endif
}
Boolean Int2NonZString(struct as_nonz_dynstr *p_str, LargeInt Src)
{
+#if 1
+ abort();
+#else
int Search;
Byte Digit;
char *pDest;
}
memmove(p_str->p_str, pDest, p_str->len);
return True;
+#endif
}
/*!------------------------------------------------------------------------
int TempResultToInt(TempResult *pResult)
{
+#if 1
+ abort();
+#else
switch (pResult->Typ)
{
case TempInt:
return -1;
}
return 0;
+#endif
}
/*!------------------------------------------------------------------------
Boolean MultiCharToInt(TempResult *pResult, unsigned MaxLen)
{
+#if 1
+ abort();
+#else
if ((pResult->Typ == TempString)
&& (pResult->Contents.str.len <= MaxLen)
&& (pResult->Flags & eSymbolFlag_StringSingleQuoted))
return True;
}
return False;
+#endif
}
/*!------------------------------------------------------------------------
Boolean ExpandStrSymbol(char *pDest, size_t DestSize, const tStrComp *pSrc)
{
+#if 1
+ abort();
+#else
tStrComp SrcComp;
const char *pStart;
return True;
}
}
+#endif
}
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
void InitTmpSymbols(void)
{
+#if 1
+ abort();
+#else
TmpSymCounter = FwdSymCounter = BackSymCounter = 0;
*TmpSymCounterVal = '\0';
TmpSymLogDepth = 0;
*LastGlobSymbol = '\0';
+#endif
}
static void AddTmpSymLog(Boolean Back, LongInt Counter)
{
+#if 1
+ abort();
+#else
/* shift out oldest value */
if (TmpSymLogDepth)
TmpSymLog[0].Counter = Counter;
if (TmpSymLogDepth < LOCSYMSIGHT)
TmpSymLogDepth++;
+#endif
}
static Boolean ChkTmp1(char *Name, as_symbol_source_t symbol_source)
{
+#if 1
+ abort();
+#else
char *Src, *Dest;
Boolean Result = FALSE;
}
return Result;
+#endif
}
static Boolean ChkTmp2(char *pDest, const char *pSrc, as_symbol_source_t symbol_source)
{
+#if 1
+ abort();
+#else
const char *pRun, *pBegin, *pEnd;
int Cnt;
Boolean Result = FALSE;
}
return Result;
+#endif
}
static Boolean ChkTmp3(char *Name, as_symbol_source_t symbol_source)
{
+#if 1
+ abort();
+#else
if ('.' == *Name)
{
strmaxprep2(Name, LastGlobSymbol, STRINGSIZE);
#endif
strmaxcpy(LastGlobSymbol, Name, STRINGSIZE);
return False;
+#endif
}
static Boolean ChkTmp(char *Name, as_symbol_source_t symbol_source)
{
+#if 1
+ abort();
+#else
Boolean IsTmp1, IsTmp2, IsTmp3;
IsTmp1 = ChkTmp1(Name, symbol_source);
IsTmp2 = ChkTmp2(Name, Name, symbol_source);
IsTmp3 = ChkTmp3(Name, IsTmp2 ? e_symbol_source_none : symbol_source);
return IsTmp1 || IsTmp2 || IsTmp3;
+#endif
}
Boolean IdentifySection(const tStrComp *pName, LongInt *Erg)
{
+#if 1
+ abort();
+#else
PSaveSection SLauf;
String ExpName;
sint Depth;
return True;
}
}
+#endif
}
static Boolean GetSymSection(char *Name, LongInt *Erg, const tStrComp *pUnexpComp)
{
+#if 1
+ abort();
+#else
String Part;
tStrComp TmpComp;
char *q;
StrCompMkTemp(&TmpComp, Part, sizeof(Part));
return IdentifySection(&TmpComp, Erg);
+#endif
}
/*****************************************************************************
static LargeInt ConstIntVal(const char *pExpr, IntType Typ, Boolean *pResult)
{
+#if 1
+ abort();
+#else
LargeInt Wert;
Boolean NegFlag = False;
int Digit;
WrError(ErrNum_WOverRange);
return Wert & IntTypeDefs[(int)Typ].Mask;
}
+#endif
}
/*****************************************************************************
static Double ConstFloatVal(const char *pExpr, FloatType Typ, Boolean *pResult)
{
+#if 1
+ abort();
+#else
Double Erg;
char *pEnd;
*pResult = True;
}
return Erg;
+#endif
}
/*****************************************************************************
static void ConstStringVal(const tStrComp *pExpr, TempResult *pDest, Boolean *pResult)
{
+#if 1
+ abort();
+#else
tStrComp Raw, Copy, Remainder;
char *pPos, QuoteChar;
int l, TLen;
*pResult = True;
func_exit:
StrCompFree(&Raw);
+#endif
}
void EvalResultClear(tEvalResult *pResult)
{
+#if 1
+ abort();
+#else
pResult->OK = False;
pResult->Flags = eSymbolFlag_None;
pResult->AddrSpaceMask = 0;
pResult->DataSize = eSymbolSizeUnknown;
+#endif
}
/*****************************************************************************
static tErrorNum DeduceExpectTypeErrMsgMask(unsigned Mask, TempType ActType)
{
+#if 1
+ abort();
+#else
switch (ActType)
{
case TempInt:
default:
return ErrNum_InternalError;
}
+#endif
}
static Byte GetOpTypeMask(Byte TotMask, int OpIndex)
{
+#if 1
+ abort();
+#else
return (TotMask >> (OpIndex * 4)) & 15;
+#endif
}
static Byte TryConvert(Byte TypeMask, TempType ActType, int OpIndex)
{
+#if 1
+ abort();
+#else
if (TypeMask & ActType)
return 0 << (4 * OpIndex);
if ((TypeMask & TempFloat) && (ActType == TempInt))
if ((TypeMask & TempFloat) && (ActType == TempString))
return (1|2) << (4 * OpIndex);
return 255;
+#endif
}
void EvalStrExpression(const tStrComp *pExpr, TempResult *pErg)
{
+#if 1
+ abort();
+#else
const Operator *pOp;
const Operator *FOps[OPERATOR_MAXCNT];
LongInt FOpCnt = 0;
FreeRelocs(&InVals[z1].Relocs);
as_tempres_free(&InVals[z1]);
}
+#endif
}
void EvalExpression(const char *pExpr, TempResult *pErg)
{
+#if 1
+ abort();
+#else
tStrComp Expr;
StrCompMkTemp(&Expr, (char*)pExpr, 0);
EvalStrExpression(&Expr, pErg);
+#endif
}
LargeInt EvalStrIntExpressionWithResult(const tStrComp *pComp, IntType Type, tEvalResult *pResult)
{
+#if 1
+ abort();
+#else
TempResult t;
LargeInt Result = -1;
func_exit:
as_tempres_free(&t);
return Result;
+#endif
}
LargeInt EvalStrIntExpressionWithFlags(const tStrComp *pComp, IntType Type, Boolean *pResult, tSymbolFlags *pFlags)
{
+#if 1
+ abort();
+#else
tEvalResult EvalResult;
LargeInt Result = EvalStrIntExpressionWithResult(pComp, Type, &EvalResult);
if (pFlags)
*pFlags = EvalResult.Flags;
return Result;
+#endif
}
LargeInt EvalStrIntExpression(const tStrComp *pComp, IntType Type, Boolean *pResult)
{
+#if 1
+ abort();
+#else
tEvalResult EvalResult;
LargeInt Result = EvalStrIntExpressionWithResult(pComp, Type, &EvalResult);
*pResult = EvalResult.OK;
return Result;
+#endif
}
LargeInt EvalStrIntExpressionOffsWithResult(const tStrComp *pExpr, int Offset, IntType Type, tEvalResult *pResult)
{
+#if 1
+ abort();
+#else
if (Offset)
{
tStrComp Comp;
}
else
return EvalStrIntExpressionWithResult(pExpr, Type, pResult);
+#endif
}
LargeInt EvalStrIntExpressionOffsWithFlags(const tStrComp *pComp, int Offset, IntType Type, Boolean *pResult, tSymbolFlags *pFlags)
{
+#if 1
+ abort();
+#else
tEvalResult EvalResult;
LargeInt Result = EvalStrIntExpressionOffsWithResult(pComp, Offset, Type, &EvalResult);
if (pFlags)
*pFlags = EvalResult.Flags;
return Result;
+#endif
}
LargeInt EvalStrIntExpressionOffs(const tStrComp *pComp, int Offset, IntType Type, Boolean *pResult)
{
+#if 1
+ abort();
+#else
tEvalResult EvalResult;
LargeInt Result = EvalStrIntExpressionOffsWithResult(pComp, Offset, Type, &EvalResult);
*pResult = EvalResult.OK;
return Result;
+#endif
}
Double EvalStrFloatExpressionWithResult(const tStrComp *pExpr, FloatType Type, tEvalResult *pResult)
{
+#if 1
+ abort();
+#else
TempResult t;
Double Result = -1;
func_exit:
as_tempres_free(&t);
return Result;
+#endif
}
Double EvalStrFloatExpression(const tStrComp *pExpr, FloatType Type, Boolean *pResult)
{
+#if 1
+ abort();
+#else
Double Ret;
tEvalResult Result;
Ret = EvalStrFloatExpressionWithResult(pExpr, Type, &Result);
*pResult = Result.OK;
return Ret;
+#endif
}
void EvalStrStringExpressionWithResult(const tStrComp *pExpr, tEvalResult *pResult, char *pEvalResult)
{
+#if 1
+ abort();
+#else
TempResult t;
as_tempres_ini(&t);
pResult->OK = True;
}
as_tempres_free(&t);
+#endif
}
void EvalStrStringExpression(const tStrComp *pExpr, Boolean *pResult, char *pEvalResult)
{
+#if 1
+ abort();
+#else
tEvalResult Result;
EvalStrStringExpressionWithResult(pExpr, &Result, pEvalResult);
*pResult = Result.OK;
+#endif
}
/*!------------------------------------------------------------------------
PSymbolEntry ExpandAndFindNode(const struct sStrComp *pComp, TempType SearchType)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
const char *pKlPos;
if (!pEntry)
pEntry = FindNode(ExpName, SearchType);
return pEntry;
+#endif
}
tErrorNum EvalStrRegExpressionWithResult(const struct sStrComp *pExpr, tRegDescr *pResult, tEvalResult *pEvalResult)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
EvalResultClear(pEvalResult);
pEvalResult->OK = True;
return ErrNum_None;
+#endif
}
/*!------------------------------------------------------------------------
tRegEvalResult EvalStrRegExpressionAsOperand(const tStrComp *pArg, struct sRegDescr *pResult, struct sEvalResult *pEvalResult, tSymbolSize ReqSize, Boolean MustBeReg)
{
+#if 1
+ abort();
+#else
tErrorNum ErrorNum;
ErrorNum = EvalStrRegExpressionWithResult(pArg, pResult, pEvalResult);
WrStrErrorPos(ErrorNum, pArg);
return MustBeReg ? eIsNoReg : eRegAbort;
}
+#endif
}
static void FreeSymbolEntry(PSymbolEntry *Node, Boolean Destroy)
{
+#if 1
+ abort();
+#else
PCrossRef Lauf;
if ((*Node)->Tree.Name)
free(*Node);
Node = NULL;
}
+#endif
}
static char *serr, *snum;
static Boolean SymbolAdder(PTree *PDest, PTree Neu, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry NewEntry = (PSymbolEntry)Neu, *Node;
PEnterStruct EnterStruct = (PEnterStruct) pData;
FreeSymbolEntry(Node, False);
return True;
}
+#endif
}
static void EnterLocSymbol(PSymbolEntry Neu)
{
+#if 1
+ abort();
+#else
TEnterStruct EnterStruct;
PTree TreeRoot;
TreeRoot = &FirstLocSymbol->Tree;
EnterTree(&TreeRoot, (&Neu->Tree), SymbolAdder, &EnterStruct);
FirstLocSymbol = (PSymbolEntry)TreeRoot;
+#endif
}
static void EnterSymbol_Search(PForwardSymbol *Lauf, PForwardSymbol *Prev,
PForwardSymbol **RRoot, PSymbolEntry Neu,
PForwardSymbol *Root, Byte ResCode, Byte *SearchErg)
{
+#if 1
+ abort();
+#else
*Lauf = (*Root);
*Prev = NULL;
*RRoot = Root;
}
if (*Lauf)
*SearchErg = ResCode;
+#endif
}
static void EnterSymbol(PSymbolEntry Neu, Boolean MayChange, LongInt ResHandle)
{
+#if 1
+ abort();
+#else
PForwardSymbol Lauf, Prev;
PForwardSymbol *RRoot;
Byte SearchErg;
}
EnterTree(&TreeRoot, &(Neu->Tree), SymbolAdder, &EnterStruct);
FirstSymbol = (PSymbolEntry)TreeRoot;
+#endif
}
void PrintSymTree(char *Name)
{
+#if 1
+ abort();
+#else
fprintf(Debug, "---------------------\n");
fprintf(Debug, "Enter Symbol %s\n\n", Name);
PrintSymbolTree();
PrintSymbolDepth();
+#endif
}
/*!------------------------------------------------------------------------
void ChangeSymbol(PSymbolEntry pEntry, LargeInt Value)
{
+#if 1
+ abort();
+#else
if (!pEntry->changed)
{
pEntry->unchanged_value = (pEntry->SymWert.Typ == TempInt) ? pEntry->SymWert.Contents.Int : 0;
pEntry->changed = True;
}
as_tempres_set_int(&pEntry->SymWert, Value);
+#endif
}
/*!------------------------------------------------------------------------
PSymbolEntry CreateSymbolEntry(const tStrComp *pName, LongInt *pDestHandle, tSymbolFlags symbol_flags)
{
+#if 1
+ abort();
+#else
PSymbolEntry pNeu;
String ExtName;
pNeu->Tree.Name = as_strdup(ExtName);
as_tempres_ini(&pNeu->SymWert);
return pNeu;
+#endif
}
/*!------------------------------------------------------------------------
PSymbolEntry EnterIntSymbolWithFlags(const tStrComp *pName, LargeInt Wert, as_addrspace_t addrspace, Boolean MayChange, tSymbolFlags Flags)
{
+#if 1
+ abort();
+#else
LongInt DestHandle;
PSymbolEntry pNeu = CreateSymbolEntry(pName, &DestHandle, Flags);
else
EnterLocSymbol(pNeu);
return pNeu;
+#endif
}
/*!------------------------------------------------------------------------
void EnterExtSymbol(const tStrComp *pName, LargeInt Wert, as_addrspace_t addrspace, Boolean MayChange)
{
+#if 1
+ abort();
+#else
LongInt DestHandle;
PSymbolEntry pNeu = CreateSymbolEntry(pName, &DestHandle, eSymbolFlag_None);
}
else
EnterLocSymbol(pNeu);
+#endif
}
/*!------------------------------------------------------------------------
PSymbolEntry EnterRelSymbol(const tStrComp *pName, LargeInt Wert, as_addrspace_t addrspace, Boolean MayChange)
{
+#if 1
+ abort();
+#else
LongInt DestHandle;
PSymbolEntry pNeu = CreateSymbolEntry(pName, &DestHandle, eSymbolFlag_None);
EnterLocSymbol(pNeu);
return pNeu;
+#endif
}
/*!------------------------------------------------------------------------
void EnterFloatSymbol(const tStrComp *pName, Double Wert, Boolean MayChange)
{
+#if 1
+ abort();
+#else
LongInt DestHandle;
PSymbolEntry pNeu = CreateSymbolEntry(pName, &DestHandle, eSymbolFlag_None);
}
else
EnterLocSymbol(pNeu);
+#endif
}
/*!------------------------------------------------------------------------
void EnterNonZStringSymbolWithFlags(const tStrComp *pName, const as_nonz_dynstr_t *p_value, Boolean MayChange, tSymbolFlags Flags)
{
+#if 1
+ abort();
+#else
LongInt DestHandle;
PSymbolEntry pNeu = CreateSymbolEntry(pName, &DestHandle, Flags);
}
else
EnterLocSymbol(pNeu);
+#endif
}
/*!------------------------------------------------------------------------
void EnterStringSymbol(const tStrComp *pName, const char *pValue, Boolean MayChange)
{
+#if 1
+ abort();
+#else
as_nonz_dynstr_t NonZString;
as_nonz_dynstr_ini_c_str(&NonZString, pValue);
EnterNonZStringSymbol(pName, &NonZString, MayChange);
as_nonz_dynstr_free(&NonZString);
+#endif
}
/*!------------------------------------------------------------------------
void EnterRegSymbol(const struct sStrComp *pName, const tRegDescr *pDescr, tSymbolSize Size, Boolean MayChange, Boolean AddList)
{
+#if 1
+ abort();
+#else
LongInt DestHandle;
PSymbolEntry pNeu = CreateSymbolEntry(pName, &DestHandle, eSymbolFlag_None);
*ListLine = '=';
pDescr->Dissect(&ListLine[1], STRINGSIZE - 1, pDescr->Reg, Size);
}
+#endif
}
static void AddReference(PSymbolEntry Node)
{
+#if 1
+ abort();
+#else
PCrossRef Lauf, Neu;
/* Speicher belegen */
Lauf = Lauf->Next;
Lauf->Next = Neu;
}
+#endif
}
static PSymbolEntry FindNode_FNode(char *Name, TempType SearchType, LongInt Handle)
{
+#if 1
+ abort();
+#else
PSymbolEntry Lauf;
Lauf = (PSymbolEntry) SearchTree((PTree)FirstSymbol, Name, Handle);
}
return Lauf;
+#endif
}
static Boolean FindNode_FSpec(char *Name, PForwardSymbol Root)
{
+#if 1
+ abort();
+#else
while ((Root) && (strcmp(Root->Name, Name)))
Root = Root->Next;
return (Root != NULL);
+#endif
}
static PSymbolEntry FindNode(const char *Name_O, TempType SearchType)
{
+#if 1
+ abort();
+#else
PSaveSection Lauf;
LongInt DestSection;
PSymbolEntry Result = NULL;
Result = FindNode_FNode(Name, SearchType, DestSection);
return Result;
+#endif
}
static PSymbolEntry FindLocNode_FNode(char *Name, TempType SearchType, LongInt Handle)
{
+#if 1
+ abort();
+#else
PSymbolEntry Lauf;
Lauf = (PSymbolEntry) SearchTree((PTree)FirstLocSymbol, Name, Handle);
}
return Lauf;
+#endif
}
static PSymbolEntry FindLocNode(const char *Name_O, TempType SearchType)
{
+#if 1
+ abort();
+#else
PLocHandle RunLocHandle;
PSymbolEntry Result = NULL;
String Name;
}
return Result;
+#endif
}
/**
void SetSymbolType(const tStrComp *pName, Byte NTyp)
{
+#if 1
+ abort();
+#else
PSymbolEntry Lauf;
Boolean HRef;
String ExpName;
if (Lauf)
Lauf->SymType = NTyp;
DoRefs = HRef;
+#endif
}
**/
void LookupSymbol(const struct sStrComp *pComp, TempResult *pValue, Boolean WantRelocs, TempType ReqType)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
const char *pKlPos;
}
else
WrStrErrorPos(ErrNum_SymbolUndef, pComp);
+#endif
}
/*!------------------------------------------------------------------------
void SetSymbolOrStructElemSize(const struct sStrComp *pName, tSymbolSize Size)
{
+#if 1
+ abort();
+#else
if (pInnermostNamedStruct)
SetStructElemSize(pInnermostNamedStruct->StructRec, pName->str.p_str, Size);
else
pEntry->SymWert.DataSize = Size;
DoRefs = HRef;
}
+#endif
}
/*!------------------------------------------------------------------------
ShortInt GetSymbolSize(const struct sStrComp *pName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
if (!pEntry)
pEntry = FindNode(ExpName, TempInt);
return pEntry ? pEntry->SymWert.DataSize : eSymbolSizeUnknown;
+#endif
}
/*!------------------------------------------------------------------------
Boolean IsSymbolDefined(const struct sStrComp *pName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
if (!pEntry)
pEntry = FindNode(ExpName, TempAll);
return pEntry && pEntry->Defined;
+#endif
}
/*!------------------------------------------------------------------------
Boolean IsSymbolUsed(const struct sStrComp *pName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
if (!pEntry)
pEntry = FindNode(ExpName, TempAll);
return pEntry && pEntry->Used;
+#endif
}
/*!------------------------------------------------------------------------
Boolean IsSymbolChangeable(const struct sStrComp *pName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
if (!pEntry)
pEntry = FindNode(ExpName, TempAll);
return pEntry && pEntry->Changeable;
+#endif
}
/*!------------------------------------------------------------------------
as_addrspace_t addrspace_from_mask(unsigned mask)
{
+#if 1
+ abort();
+#else
as_addrspace_t space;
for (space = SegCode; space < SegCount; space++)
if (mask & (1 << space))
return space;
return SegNone;
+#endif
}
Integer GetSymbolType(const struct sStrComp *pName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pEntry;
String ExpName;
return 0x80;
else
return addrspace_from_mask(pEntry->SymWert.AddrSpaceMask);
+#endif
}
typedef struct
static void PrintSymbolList_AddOut(char *s, TListContext *pContext)
{
+#if 1
+ abort();
+#else
int AddVisibleLen = visible_strlen(s),
AddLen = strlen(s);
pContext->ZeilenrestLen += AddLen;
pContext->ZeilenrestVisibleLen += AddVisibleLen;
}
+#endif
}
static void PrintSymbolList_PNode(PTree Tree, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry Node = (PSymbolEntry) Tree;
if (Node->SymWert.Typ != TempReg)
if (!Node->Used)
pContext->USum++;
}
+#endif
}
void PrintSymbolList(void)
{
+#if 1
+ abort();
+#else
int ActPageWidth;
TListContext Context;
as_dynstr_free(&Context.s1);
as_dynstr_free(&Context.sh);
as_dynstr_free(&Context.Zeilenrest);
+#endif
}
typedef struct
static Boolean match_space_mask(unsigned mask, as_addrspace_t space)
{
+#if 1
+ abort();
+#else
if (SegNone == space)
return !mask;
else
return !!((mask >> space) & 1);
+#endif
}
static void PrintDebSymbols_PNode(PTree Tree, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry Node = (PSymbolEntry) Tree;
TDebContext *DebContext = (TDebContext*) pData;
int l1;
}
fprintf(DebContext->f, "%s %-3d %d %d\n", Blanks(25 - l1), Node->SymWert.DataSize, (int)Node->Used, (int)Node->Changeable);
ChkIO(ErrNum_FileWriteError);
+#endif
}
void PrintDebSymbols(FILE *f)
{
+#if 1
+ abort();
+#else
TDebContext DebContext;
as_dynstr_ini(&DebContext.s, 256);
IterTree((PTree)FirstSymbol, PrintDebSymbols_PNode, &DebContext);
}
as_dynstr_free(&DebContext.s);
+#endif
}
typedef struct
static void PrNoISection(PTree Tree, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry Node = (PSymbolEntry)Tree;
TNoISymContext *pContext = (TNoISymContext*) pData;
errno = 0; fprintf(pContext->f, LargeHIntFormat, Node->SymWert.Contents.Int); ChkIO(ErrNum_FileWriteError);
errno = 0; fprintf(pContext->f, "\n"); ChkIO(ErrNum_FileWriteError);
}
+#endif
}
void PrintNoISymbols(FILE *f)
{
+#if 1
+ abort();
+#else
PCToken CurrSection;
TNoISymContext Context;
fprintf(f, LargeIntFormat, ChunkMax(&CurrSection->Usage)); ChkIO(ErrNum_FileWriteError);
fprintf(f, "\n"); ChkIO(ErrNum_FileWriteError);
}
+#endif
}
void PrintSymbolTree(void)
{
+#if 1
+ abort();
+#else
DumpTree((PTree)FirstSymbol);
+#endif
}
static void ClearSymbolList_ClearNode(PTree Node, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry SymbolEntry = (PSymbolEntry) Node;
UNUSED(pData);
FreeSymbolEntry(&SymbolEntry, FALSE);
+#endif
}
void ClearSymbolList(void)
{
+#if 1
+ abort();
+#else
PTree TreeRoot;
TreeRoot = &(FirstSymbol->Tree);
TreeRoot = &(FirstLocSymbol->Tree);
FirstLocSymbol = NULL;
DestroyTree(&TreeRoot, ClearSymbolList_ClearNode, NULL);
+#endif
}
/*-------------------------------------------------------------------------*/
Boolean PushSymbol(const tStrComp *pSymName, const tStrComp *pStackName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pSrc;
PSymbolStack LStack, NStack, PStack;
PSymbolStackEntry Elem;
LStack->Contents = Elem;
return True;
+#endif
}
Boolean PopSymbol(const tStrComp *pSymName, const tStrComp *pStackName)
{
+#if 1
+ abort();
+#else
PSymbolEntry pDest;
PSymbolStack LStack, PStack;
PSymbolStackEntry Elem;
free(Elem);
return True;
+#endif
}
void ClearStacks(void)
{
+#if 1
+ abort();
+#else
PSymbolStack Act;
PSymbolStackEntry Elem;
int z;
FirstStack = Act->Next;
free(Act);
}
+#endif
}
/*-------------------------------------------------------------------------*/
void EnterFunction(const tStrComp *pComp, char *FDefinition, Byte NewCnt)
{
+#if 1
+ abort();
+#else
PFunction Neu;
String FName_N;
const char *pFName;
Neu->Name = as_strdup(pFName);
Neu->Definition = as_strdup(FDefinition);
FirstFunction = Neu;
+#endif
}
PFunction FindFunction(const char *Name)
{
+#if 1
+ abort();
+#else
PFunction Lauf = FirstFunction;
String Name_N;
while ((Lauf) && (strcmp(Lauf->Name, Name)))
Lauf = Lauf->Next;
return Lauf;
+#endif
}
void PrintFunctionList(void)
{
+#if 1
+ abort();
+#else
PFunction Lauf;
String OneS;
Boolean cnt;
WrLstLine(OneS);
}
WrLstLine("");
+#endif
}
void ClearFunctionList(void)
{
+#if 1
+ abort();
+#else
PFunction Lauf;
while (FirstFunction)
free(FirstFunction);
FirstFunction = Lauf;
}
+#endif
}
/*-------------------------------------------------------------------------*/
static void ResetSymbolDefines_ResetNode(PTree Node, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry SymbolEntry = (PSymbolEntry) Node;
UNUSED(pData);
SymbolEntry->Defined = False;
SymbolEntry->Used = False;
+#endif
}
void ResetSymbolDefines(void)
{
+#if 1
+ abort();
+#else
IterTree(&(FirstSymbol->Tree), ResetSymbolDefines_ResetNode, NULL);
IterTree(&(FirstLocSymbol->Tree), ResetSymbolDefines_ResetNode, NULL);
+#endif
}
void SetFlag(Boolean *Flag, const char *Name, Boolean Wert)
{
+#if 1
+ abort();
+#else
tStrComp TmpComp;
*Flag = Wert;
StrCompMkTemp(&TmpComp, (char*)Name, 0);
EnterIntSymbol(&TmpComp, *Flag ? 1 : 0, SegNone, True);
+#endif
}
void AddDefSymbol(char *Name, TempResult *Value)
{
+#if 1
+ abort();
+#else
PDefSymbol Neu;
Neu = FirstDefSymbol;
Neu->SymName = as_strdup(Name);
Neu->Wert = (*Value);
FirstDefSymbol = Neu;
+#endif
}
void RemoveDefSymbol(char *Name)
{
+#if 1
+ abort();
+#else
PDefSymbol Save, Lauf;
if (!FirstDefSymbol)
}
free(Save->SymName);
free(Save);
+#endif
}
void CopyDefSymbols(void)
{
+#if 1
+ abort();
+#else
PDefSymbol Lauf;
tStrComp TmpComp;
}
Lauf = Lauf->Next;
}
+#endif
}
const TempResult *FindDefSymbol(const char *pName)
{
+#if 1
+ abort();
+#else
PDefSymbol pRun;
for (pRun = FirstDefSymbol; pRun; pRun = pRun->Next)
if (!strcmp(pName, pRun->SymName))
return &pRun->Wert;
return NULL;
+#endif
}
void PrintSymbolDepth(void)
{
+#if 1
+ abort();
+#else
LongInt TreeMin, TreeMax;
GetTreeDepth(&(FirstSymbol->Tree), &TreeMin, &TreeMax);
fprintf(Debug, " MinTree %ld\n", (long)TreeMin);
fprintf(Debug, " MaxTree %ld\n", (long)TreeMax);
+#endif
}
LongInt GetSectionHandle(char *SName_O, Boolean AddEmpt, LongInt Parent)
{
+#if 1
+ abort();
+#else
PCToken Lauf, Prev;
LongInt z;
String SName;
z = -2;
}
return z;
+#endif
}
const char *GetSectionName(LongInt Handle)
{
+#if 1
+ abort();
+#else
PCToken Lauf = FirstSection;
static const char *Dummy = "";
Handle--;
}
return Lauf ? Lauf->Name : Dummy;
+#endif
}
void SetMomSection(LongInt Handle)
{
+#if 1
+ abort();
+#else
LongInt z;
MomSectionHandle = Handle;
if (MomSection)
MomSection = MomSection->Next;
}
+#endif
}
void AddSectionUsage(LongInt Start, LongInt Length)
{
+#if 1
+ abort();
+#else
if ((ActPC != SegCode) || (!MomSection))
return;
AddChunk(&(MomSection->Usage), Start, Length, False);
+#endif
}
void ClearSectionUsage(void)
{
+#if 1
+ abort();
+#else
PCToken Tmp;
for (Tmp = FirstSection; Tmp; Tmp = Tmp->Next)
ClearChunk(&(Tmp->Usage));
+#endif
}
static void PrintSectionList_PSection(LongInt Handle, int Indent)
{
+#if 1
+ abort();
+#else
PCToken Lauf;
LongInt Cnt;
String h;
Lauf = Lauf->Next;
Cnt++;
}
+#endif
}
void PrintSectionList(void)
{
+#if 1
+ abort();
+#else
if (!FirstSection)
return;
WrLstLine(getmessage(Num_ListSectionListHead2));
WrLstLine("");
PrintSectionList_PSection(-1, 0);
+#endif
}
void PrintDebSections(FILE *f)
{
+#if 1
+ abort();
+#else
PCToken Lauf;
LongInt Cnt, z, l, s;
char Str[30];
Lauf = Lauf->Next;
Cnt++;
}
+#endif
}
void ClearSectionList(void)
{
+#if 1
+ abort();
+#else
PCToken Tmp;
while (FirstSection)
ClearChunk(&(Tmp->Usage));
FirstSection = Tmp->Next; free(Tmp);
}
+#endif
}
/*---------------------------------------------------------------------------------*/
static void PrintCrossList_PNode(PTree Node, void *pData)
{
+#if 1
+ abort();
+#else
int FileZ;
PCrossRef pCross;
String LineAcc;
WrLstLine(LineAcc);
}
WrLstLine("");
+#endif
}
void PrintCrossList(void)
{
+#if 1
+ abort();
+#else
as_dynstr_t val_str;
as_dynstr_ini(&val_str, 256);
IterTree(&(FirstSymbol->Tree), PrintCrossList_PNode, &val_str);
WrLstLine("");
as_dynstr_free(&val_str);
+#endif
}
static void ClearCrossList_CNode(PTree Tree, void *pData)
{
+#if 1
+ abort();
+#else
PCrossRef Lauf;
PSymbolEntry SymbolEntry = (PSymbolEntry) Tree;
UNUSED(pData);
free(SymbolEntry->RefList);
SymbolEntry->RefList = Lauf;
}
+#endif
}
void ClearCrossList(void)
{
+#if 1
+ abort();
+#else
IterTree(&(FirstSymbol->Tree), ClearCrossList_CNode, NULL);
+#endif
}
/*--------------------------------------------------------------------------*/
LongInt GetLocHandle(void)
{
+#if 1
+ abort();
+#else
return LocHandleCnt++;
+#endif
}
void PushLocHandle(LongInt NewLoc)
{
+#if 1
+ abort();
+#else
PLocHandle NewLocHandle;
NewLocHandle = (PLocHandle) malloc(sizeof(TLocHeap));
NewLocHandle->Cont = MomLocHandle;
NewLocHandle->Next = FirstLocHandle;
FirstLocHandle = NewLocHandle; MomLocHandle = NewLoc;
+#endif
}
void PopLocHandle(void)
{
+#if 1
+ abort();
+#else
PLocHandle OldLocHandle;
OldLocHandle = FirstLocHandle;
MomLocHandle = OldLocHandle->Cont;
FirstLocHandle = OldLocHandle->Next;
free(OldLocHandle);
+#endif
}
void ClearLocStack()
{
+#if 1
+ abort();
+#else
while (MomLocHandle != -1)
PopLocHandle();
+#endif
}
/*--------------------------------------------------------------------------*/
static void PrintRegList_PNode(PTree Tree, void *pData)
{
+#if 1
+ abort();
+#else
PSymbolEntry Node = (PSymbolEntry) Tree;
if (Node->SymWert.Typ == TempReg)
if (!Node->Used)
pContext->USum++;
}
+#endif
}
void PrintRegDefs(void)
{
+#if 1
+ abort();
+#else
String buf;
LongInt ActPageWidth;
TListContext Context;
as_dynstr_free(&Context.Zeilenrest);
as_dynstr_free(&Context.s1);
as_dynstr_free(&Context.sh);
+#endif
}
/*--------------------------------------------------------------------------*/
void ClearCodepages(void)
{
+#if 1
+ abort();
+#else
PTransTable Old;
while (TransTables)
free(Old->Table);
free(Old);
}
+#endif
}
void PrintCodepages(void)
{
+#if 1
+ abort();
+#else
char buf[500];
PTransTable Table;
int z, cnt, cnt2;
as_snprintf(buf, sizeof(buf), "%d%s", cnt2,
getmessage((cnt2 == 1) ? Num_ListCodepageSumMsg : Num_ListCodepageSumsMsg));
WrLstLine(buf);
+#endif
}
/*--------------------------------------------------------------------------*/
void asmpars_init(void)
{
+#if 1
+ abort();
+#else
tIntTypeDef *pCurr;
serr = (char*)malloc(sizeof(char) * STRINGSIZE);
}
LastGlobSymbol = (char*)malloc(sizeof(char) * STRINGSIZE);
+#endif
}
void AsmSubPassInit(void)
{
+#if 1
+ abort();
+#else
PageLength = 60;
PageWidth = 0;
+#endif
}
/****************************************************************************/
void AddCopyright(const char *NewLine)
{
+#if 1
+ abort();
+#else
AddStringListLast(&CopyrightList, NewLine);
+#endif
}
void WriteCopyrights(TSwitchProc NxtProc)
{
+#if 1
+ abort();
+#else
StringRecPtr Lauf;
if (!StringListEmpty(CopyrightList))
NxtProc();
}
}
+#endif
}
/*--------------------------------------------------------------------------*/
static char *QuotPosCore(const char *s, int (*SearchFnc)(const char*, const char*), const char *pSearch, tQualifyQuoteFnc QualifyQuoteFnc)
{
+#if 1
+ abort();
+#else
register ShortInt Brack = 0, AngBrack = 0;
register const char *i;
Boolean InSglQuot = False, InDblQuot = False, ThisEscaped = False, NextEscaped = False;
}
return NULL;
+#endif
}
static int SearchSingleChar(const char *pPos, const char *pSearch)
{
+#if 1
+ abort();
+#else
return ((int)*pSearch) - ((int)*pPos);
+#endif
}
static int SearchMultChar(const char *pPos, const char *pSearch)
{
+#if 1
+ abort();
+#else
return !strchr(pSearch, *pPos);
+#endif
}
static int SearchMultString(const char *pPos, const char *pSearch)
{
+#if 1
+ abort();
+#else
int len;
while (True)
return 0;
pSearch += len + 1;
}
+#endif
}
char *QuotMultPosQualify(const char *s, const char *pSearch, tQualifyQuoteFnc QualifyQuoteFnc)
{
+#if 1
+ abort();
+#else
return QuotPosCore(s, SearchMultChar, pSearch, QualifyQuoteFnc);
+#endif
}
char *QuotPosQualify(const char *s, char Zeichen, tQualifyQuoteFnc QualifyQuoteFnc)
{
+#if 1
+ abort();
+#else
return QuotPosCore(s, SearchSingleChar, &Zeichen, QualifyQuoteFnc);
+#endif
}
char *QuotSMultPosQualify(const char *s, const char *pStrs, tQualifyQuoteFnc QualifyQuoteFnc)
{
+#if 1
+ abort();
+#else
return QuotPosCore(s, SearchMultString, pStrs, QualifyQuoteFnc);
+#endif
}
char *RQuotPos(char *s, char Zeichen)
{
+#if 1
+ abort();
+#else
ShortInt Brack = 0, AngBrack = 0;
char *i;
Boolean Quot = False, Paren = False;
}
return NULL;
+#endif
}
/*--------------------------------------------------------------------------*/
char *FirstBlank(const char *s)
{
+#if 1
+ abort();
+#else
const char *h, *Min = NULL;
h = strchr(s, ' ');
if ((!Min) || (h < Min))
Min = h;
return (char*)Min;
+#endif
}
/*--------------------------------------------------------------------------*/
void SplitString(char *Source, char *Left, char *Right, char *Trenner)
{
+#if 1
+ abort();
+#else
char Save;
LongInt slen = strlen(Source);
*Right = '\0';
else
strmov(Right, Trenner + 1);
+#endif
}
/*--------------------------------------------------------------------------*/
void UpString(char *s)
{
+#if 1
+ abort();
+#else
char *z;
int hypquot = 0;
Boolean LastBk = FALSE, ThisBk;
}
LastBk = ThisBk;
}
+#endif
}
/*!------------------------------------------------------------------------
char *MatchChars(const char *pStr, const char *pPattern, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
char *pResult = NULL;
func_exit:
va_end(ap);
return pResult;
+#endif
}
/*!------------------------------------------------------------------------
char *MatchCharsRev(const char *pStr, const char *pPattern, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
char *pResult = NULL;
const char *pPatternRun = pPattern + strlen(pPattern) - 1,
func_exit:
va_end(ap);
return pResult;
+#endif
}
/*!------------------------------------------------------------------------
char *FindClosingParenthese(const char *pStr)
{
+#if 1
+ abort();
+#else
int Nest = 1;
Boolean InSgl = False, InDbl = False;
}
}
return NULL;
+#endif
}
/*!------------------------------------------------------------------------
char *FindOpeningParenthese(const char *pStrBegin, const char *pStrEnd, const char Bracks[2])
{
+#if 1
+ abort();
+#else
int Nest = 1;
Boolean InSgl = False, InDbl = False;
}
}
return NULL;
+#endif
}
/****************************************************************************/
void TranslateString(char *s, int Length)
{
+#if 1
+ abort();
+#else
char *pRun, *pEnd;
if (Length < 0)
Length = strlen(s);
for (pRun = s, pEnd = pRun + Length; pRun < pEnd; pRun++)
*pRun = CharTransTable[((usint)(*pRun)) & 0xff];
+#endif
}
ShortInt StrCaseCmp(const char *s1, const char *s2, LongInt Hand1, LongInt Hand2)
{
+#if 1
+ abort();
+#else
int tmp;
tmp = as_toupper(*s1) - as_toupper(*s2);
if (tmp > 0)
return 1;
return 0;
+#endif
}
/****************************************************************************/
void AddSuffix(char *s, const char *Suff)
{
+#if 1
+ abort();
+#else
char *p, *z, *Part;
p = NULL;
Part = p ? p : s;
if (!strchr(Part, '.'))
strmaxcat(s, Suff, STRINGSIZE);
+#endif
}
void KillSuffix(char *s)
{
+#if 1
+ abort();
+#else
char *p, *z, *Part;
p = NULL;
Part = strchr(Part, '.');
if (Part)
*Part = '\0';
+#endif
}
/*--------------------------------------------------------------------------*/
char *PathPart(char *Name)
{
+#if 1
+ abort();
+#else
static String s;
char *p;
s[1] = '\0';
return s;
+#endif
}
/*--------------------------------------------------------------------------*/
const char *NamePart(const char *Name)
{
+#if 1
+ abort();
+#else
const char *p = strrchr(Name, PATHSEP);
#ifdef DRSEP
#endif
return p ? p + 1 : Name;
+#endif
}
/****************************************************************************/
void FloatString(char *pDest, size_t DestSize, Double f)
{
+#if 1
+ abort();
+#else
#define MaxLen 18
char *p, *d, ExpChar = HexStartCharacter + ('E' - 'A');
sint n, ExpVal, nzeroes;
p = pDest + strlen(pDest);
if (p && (*(p - 1) == '.'))
strmov(p - 1, p);
+#endif
}
/****************************************************************************/
void StrSym(const TempResult *t, Boolean WithSystem, as_dynstr_t *p_dest, unsigned Radix)
{
+#if 1
+ abort();
+#else
LargeInt IntVal;
if (p_dest->capacity)
default:
as_sdprintf(p_dest, "???");
}
+#endif
}
/****************************************************************************/
void ResetPageCounter(void)
{
+#if 1
+ abort();
+#else
int z;
for (z = 0; z <= ChapMax; z++)
PageCounter[z] = 0;
LstCounter = 0;
ChapDepth = 0;
+#endif
}
/*--------------------------------------------------------------------------*/
void NewPage(ShortInt Level, Boolean WithFF)
{
+#if 1
+ abort();
+#else
ShortInt z;
String Header, s;
char Save;
fprintf(LstFile, "\n\n");
ChkIO(ErrNum_ListWrError);
}
+#endif
}
/*--------------------------------------------------------------------------*/
void WrLstLine(const char *Line)
{
+#if 1
+ abort();
+#else
int LLength;
char bbuf[2500];
String LLine;
}
}
}
+#endif
}
/*****************************************************************************/
void SetListLineVal(TempResult *t)
{
+#if 1
+ abort();
+#else
as_dynstr_t str;
as_dynstr_ini(&str, STRINGSIZE);
as_snprintf(ListLine, STRINGSIZE, "=%s", str.p_str);
LimitListLine();
as_dynstr_free(&str);
+#endif
}
void LimitListLine(void)
{
+#if 1
+ abort();
+#else
if (strlen(ListLine) + 1 > LISTLINESPACE)
{
ListLine[LISTLINESPACE - 4] = '\0';
strmaxcat(ListLine, "..", STRINGSIZE);
}
+#endif
}
/*!------------------------------------------------------------------------
static Boolean CompMatch(int Col, const struct sLineComp *pComp)
{
+#if 1
+ abort();
+#else
return (pComp
&& (pComp->StartCol >= 0)
&& (Col >= pComp->StartCol)
&& (Col < pComp->StartCol + (int)pComp->Len));
+#endif
}
void PrintOneLineMuted(FILE *pFile, const char *pLine,
const struct sLineComp *pMuteComponent,
const struct sLineComp *pMuteComponent2)
{
+#if 1
+ abort();
+#else
int z, Len = strlen(pLine);
Boolean Match;
}
fputc('\n', pFile);
ChkIO(ErrNum_ListWrError);
+#endif
}
/*!------------------------------------------------------------------------
void PrLineMarker(FILE *pFile, const char *pLine, const char *pPrefix, const char *pTrailer,
char Marker, const struct sLineComp *pLineComp)
{
+#if 1
+ abort();
+#else
const char *pRun;
int z;
fputc(Marker, pFile);
fprintf(pFile, "%s\n", pTrailer);
}
+#endif
}
/****************************************************************************/
static Byte GetValidSymChar(unsigned Ch)
{
+#if 1
+ abort();
+#else
return (Ch < ValidSymCharLen) ? ValidSymChar[Ch] : 0;
+#endif
}
static char *ChkNameUpTo(const char *pSym, const char *pUpTo, Byte _Mask)
{
+#if 1
+ abort();
+#else
Byte Mask = _Mask;
unsigned Ch;
const char *pPrev;
Mask = _Mask << 1;
}
return (char*)pSym;
+#endif
}
char *ChkSymbNameUpTo(const char *pSym, const char *pUpTo)
{
+#if 1
+ abort();
+#else
char *pResult = ChkNameUpTo(pSym, pUpTo, VALID_S1);
/* If NULL as UpTo was given, and all is fine up to end of string,
if (!pUpTo && !*pResult)
pResult= NULL;
return pResult;
+#endif
}
Boolean ChkSymbName(const char *pSym)
{
+#if 1
+ abort();
+#else
const char *pEnd = ChkSymbNameUpTo(pSym, NULL);
return *pSym && !pEnd;
+#endif
}
char *ChkMacSymbNameUpTo(const char *pSym, const char *pUpTo)
{
+#if 1
+ abort();
+#else
char *pResult = ChkNameUpTo(pSym, pUpTo, VALID_M1);
/* If NULL as UpTo was given, and all is fine up to end of string,
if (!pUpTo && !*pResult)
pResult= NULL;
return pResult;
+#endif
}
Boolean ChkMacSymbName(const char *pSym)
{
+#if 1
+ abort();
+#else
const char *pEnd = ChkMacSymbNameUpTo(pSym, NULL);
return *pSym && !pEnd;
+#endif
}
/*!------------------------------------------------------------------------
unsigned visible_strlen(const char *pSym)
{
+#if 1
+ abort();
+#else
if (ValidSymCharLen > 256)
{
unsigned Result = 0;
}
else
return strlen(pSym);
+#endif
}
/****************************************************************************/
LargeWord ProgCounter(void)
{
+#if 1
+ abort();
+#else
return PCs[ActPC];
+#endif
}
/*--------------------------------------------------------------------------*/
LargeWord EProgCounter(void)
{
+#if 1
+ abort();
+#else
return PCs[ActPC] + Phases[ActPC];
+#endif
}
/*--------------------------------------------------------------------------*/
Word Granularity(void)
{
+#if 1
+ abort();
+#else
return Grans[ActPC];
+#endif
}
/*--------------------------------------------------------------------------*/
Word ListGran(void)
{
+#if 1
+ abort();
+#else
return ListGrans[ActPC];
+#endif
}
/*--------------------------------------------------------------------------*/
void ChkSpace(Byte AddrSpace, unsigned AddrSpaceMask)
{
+#if 1
+ abort();
+#else
AddrSpaceMask &= ~(1 << AddrSpace);
if (AddrSpaceMask) WrError(ErrNum_WrongSegment);
+#endif
}
/****************************************************************************/
void PrintChunk(ChunkList *NChunk, DissectBitProc Dissect, int ItemsPerLine)
{
+#if 1
+ abort();
+#else
LargeWord NewMin, FMin;
Boolean Found;
Word p = 0, z;
if (BufferZ != 0)
WrLstLine(BufferS);
+#endif
}
/*--------------------------------------------------------------------------*/
void PrintUseList(void)
{
+#if 1
+ abort();
+#else
int z, z2, l;
String s;
(z == SegBData) ? 3 : 4);
WrLstLine("");
}
+#endif
}
void ClearUseList(void)
{
+#if 1
+ abort();
+#else
int z;
for (z = 1; z < SegCount; z++)
ClearChunk(SegChunks + z);
+#endif
}
/****************************************************************************/
static char *GetPath(char *Acc)
{
+#if 1
+ abort();
+#else
char *p;
static String tmp;
strmov(Acc, p + 1);
}
return tmp;
+#endif
}
void AddIncludeList(char *NewPath)
{
+#if 1
+ abort();
+#else
String Test;
strmaxcpy(Test, IncludeList, STRINGSIZE);
if (*IncludeList != '\0')
strmaxprep(IncludeList, SDIRSEP, STRINGSIZE);
strmaxprep(IncludeList, NewPath, STRINGSIZE);
+#endif
}
void RemoveIncludeList(char *RemPath)
{
+#if 1
+ abort();
+#else
String Save;
char *Part;
strmaxcat(IncludeList, Part, STRINGSIZE);
}
}
+#endif
}
/****************************************************************************/
void ClearOutList(void)
{
+#if 1
+ abort();
+#else
ClearStringList(&OutList);
+#endif
}
void AddToOutList(const char *NewName)
{
+#if 1
+ abort();
+#else
AddStringListLast(&OutList, NewName);
+#endif
}
void RemoveFromOutList(const char *OldName)
{
+#if 1
+ abort();
+#else
RemoveStringList(&OutList, OldName);
+#endif
}
char *GetFromOutList(void)
{
+#if 1
+ abort();
+#else
return GetAndCutStringList(&OutList);
+#endif
}
void ClearShareOutList(void)
{
+#if 1
+ abort();
+#else
ClearStringList(&ShareOutList);
+#endif
}
void AddToShareOutList(const char *NewName)
{
+#if 1
+ abort();
+#else
AddStringListLast(&ShareOutList, NewName);
+#endif
}
void RemoveFromShareOutList(const char *OldName)
{
+#if 1
+ abort();
+#else
RemoveStringList(&ShareOutList, OldName);
+#endif
}
char *GetFromShareOutList(void)
{
+#if 1
+ abort();
+#else
return GetAndCutStringList(&ShareOutList);
+#endif
}
void ClearListOutList(void)
{
+#if 1
+ abort();
+#else
ClearStringList(&ListOutList);
+#endif
}
void AddToListOutList(const char *NewName)
{
+#if 1
+ abort();
+#else
AddStringListLast(&ListOutList, NewName);
+#endif
}
void RemoveFromListOutList(const char *OldName)
{
+#if 1
+ abort();
+#else
RemoveStringList(&ListOutList, OldName);
+#endif
}
char *GetFromListOutList(void)
{
+#if 1
+ abort();
+#else
return GetAndCutStringList(&ListOutList);
+#endif
}
/****************************************************************************/
static Boolean CompressLine_NErl(char ch)
{
+#if 1
+ abort();
+#else
return (((ch >= 'A') && (ch <= 'Z'))
|| ((ch >= 'a') && (ch <= 'z'))
|| ((ch >= '0') && (ch <= '9')));
+#endif
}
typedef int (*tCompareFnc)(const char *s1, const char *s2, size_t n);
int ReplaceLine(as_dynstr_t *p_str, const char *pSearch, const char *pReplace, Boolean CaseSensitive)
{
+#if 1
+ abort();
+#else
int SearchLen = strlen(pSearch), ReplaceLen = strlen(pReplace), StrLen = strlen(p_str->p_str), DeltaLen = ReplaceLen - SearchLen;
int NumReplace = 0, Pos, End, CmpRes, Avail, nCopy, nMove;
tCompareFnc Compare = CaseSensitive ? strncmp : as_strncasecmp;
Pos++;
}
return NumReplace;
+#endif
}
static void SetToken(char *Token, unsigned TokenNum)
{
+#if 1
+ abort();
+#else
Token[0] = (TokenNum >> 4) + 1;
Token[1] = (TokenNum & 15) + 1;
Token[2] = 0;
+#endif
}
/*!------------------------------------------------------------------------
int CompressLine(const char *TokNam, unsigned TokenNum, as_dynstr_t *p_str, Boolean ThisCaseSensitive)
{
+#if 1
+ abort();
+#else
char Token[3];
SetToken(Token, TokenNum);
return ReplaceLine(p_str, TokNam, Token, ThisCaseSensitive);
+#endif
}
/*!------------------------------------------------------------------------
void ExpandLine(const char *TokNam, unsigned TokenNum, as_dynstr_t *p_str)
{
+#if 1
+ abort();
+#else
char Token[3];
SetToken(Token, TokenNum);
(void)ReplaceLine(p_str, Token, TokNam, True);
+#endif
}
void KillCtrl(char *Line)
{
+#if 1
+ abort();
+#else
char *z;
if (*(z = Line) == '\0')
z++;
}
while (*z != '\0');
+#endif
}
/****************************************************************************/
void BookKeeping(void)
{
+#if 1
+ abort();
+#else
if (MakeUseList)
if (AddChunk(SegChunks + ActPC, ProgCounter(), CodeLen, ActPC == SegCode))
WrError(ErrNum_Overlap);
AddSectionUsage(ProgCounter(), CodeLen);
AddLineInfo(InMacroFlag, CurrLine, CurrFileName, ActPC, PCs[ActPC], CodeLen);
}
+#endif
}
/****************************************************************************/
long DTime(long t1, long t2)
{
+#if 1
+ abort();
+#else
LongInt d;
d = t2 - t1;
if (d < 0) d += (24*360000);
return (d > 0) ? d : -d;
+#endif
}
/*--------------------------------------------------------------------------*/
void InitPass(void)
{
+#if 1
+ abort();
+#else
tProcStore *pStore;
for (pStore = pInitPassProcStore; pStore; pStore = pStore->pNext)
pStore->Proc();
+#endif
}
void ClearUp(void)
{
+#if 1
+ abort();
+#else
tProcStore *pStore;
for (pStore = pClearUpProcStore; pStore; pStore = pStore->pNext)
pStore->Proc();
+#endif
}
void AddInitPassProc(SimpProc NewProc)
{
+#if 1
+ abort();
+#else
tProcStore *pNewStore = (tProcStore*)calloc(1, sizeof(*pNewStore));
pNewStore->pNext = pInitPassProcStore;
pNewStore->Proc = NewProc;
pInitPassProcStore = pNewStore;
+#endif
}
void AddClearUpProc(SimpProc NewProc)
{
+#if 1
+ abort();
+#else
tProcStore *pNewStore = (tProcStore*)calloc(1, sizeof(*pNewStore));
pNewStore->pNext = pClearUpProcStore;
pNewStore->Proc = NewProc;
pClearUpProcStore = pNewStore;
+#endif
}
/*--------------------------------------------------------------------------*/
long GTime(void)
{
+#if 1
+ abort();
+#else
struct time tbuf;
long result;
result = (result * 60) + tbuf.ti_sec;
result = (result * 100) + tbuf.ti_hund;
return result;
+#endif
}
#elif __IBMC__
long GTime(void)
{
+#if 1
+ abort();
+#else
DATETIME dt;
struct tm ts;
DosGetDateTime(&dt);
ts.tm_min = dt.minutes;
ts.tm_sec = dt.seconds;
return (mktime(&ts) * 100) + (dt.hundredths);
+#endif
}
#elif __MINGW32__
long GTime(void)
{
+#if 1
+ abort();
+#else
union
{
#ifndef NOLONGLONG
# define _W32_FT_OFFSET (116444736000000000LL)
return (_now.ns100 - _W32_FT_OFFSET) / 100000LL;
#endif
+#endif
}
#else
long GTime(void)
{
+#if 1
+ abort();
+#else
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec*100) + (tv.tv_usec/10000);
+#endif
}
#endif
void ChkStack(void)
{
+#if 1
+ abort();
+#else
LongWord avail = stackavail();
if (avail < MinStack)
WrError(ErrNum_StackOvfl);
if (avail < LowStack)
LowStack = avail;
+#endif
}
void ResetStack(void)
{
+#if 1
+ abort();
+#else
LowStack = stackavail();
+#endif
}
LongWord StackRes(void)
{
+#if 1
+ abort();
+#else
return LowStack - MinStack;
+#endif
}
#endif /* __TURBOC__ */
void *ckmalloc(size_t s)
{
+#if 1
+ abort();
+#else
void *tmp;
#ifdef __TURBOC__
if (!tmp && (s > 0))
WrError(ErrNum_HeapOvfl);
return tmp;
+#endif
}
void *ckrealloc(void *p, size_t s)
{
+#if 1
+ abort();
+#else
void *tmp;
#ifdef __TURBOC__
if (!tmp)
WrError(ErrNum_HeapOvfl);
return tmp;
+#endif
}
#endif
static void SetValidSymChar(unsigned Ch, Byte Value)
{
+#if 1
+ abort();
+#else
ValidSymChar[Ch] = Value;
+#endif
}
static void SetValidSymChars(unsigned Start, unsigned Stop, Byte Value)
{
+#if 1
+ abort();
+#else
for (; Start <= Stop; Start++)
SetValidSymChar(Start, Value);
+#endif
}
void asmsub_init(void)
{
+#if 1
+ abort();
+#else
#ifdef __TURBOC__
#ifdef __MSDOS__
#ifdef __DPMI16__
#endif
version_init();
+#endif
}
char *FExpand(char *Src)
{
+#if 1
+ abort();
+#else
static String CurrentDir;
String Copy;
#ifdef DRSEP
strmaxcat(CurrentDir, Copy, STRINGSIZE);
return CurrentDir;
+#endif
}
/*!------------------------------------------------------------------------
static int AssembleAndCheck(char *pDest, size_t DestSize, const char *pPath, unsigned PathLen, const char *pFileToSearch)
{
+#if 1
+ abort();
+#else
FILE *pDummy;
if (PathLen > DestSize - 1)
}
else
return 2;
+#endif
}
int FSearch(char *pDest, size_t DestSize, const char *pFileToSearch, const char *pCurrFileName, const char *pSearchPath)
{
+#if 1
+ abort();
+#else
/* If the file has an absolute path ('/....', '\....', 'X:....'), do not search relative
to current file's directory: */
*pDest = '\0';
return 2;
+#endif
}
long FileSize(FILE *file)
{
+#if 1
+ abort();
+#else
long Save = ftell(file), Size;
fseek(file, 0, SEEK_END);
Size=ftell(file);
fseek(file, Save, SEEK_SET);
return Size;
+#endif
}
Byte Lo(Word inp)
{
+#if 1
+ abort();
+#else
return (inp & 0xff);
+#endif
}
Byte Hi(Word inp)
{
+#if 1
+ abort();
+#else
return ((inp >> 8) & 0xff);
+#endif
}
unsigned LoWord(LongWord Src)
{
+#if 1
+ abort();
+#else
return (Src & 0xffff);
+#endif
}
unsigned HiWord(LongWord Src)
{
+#if 1
+ abort();
+#else
return ((Src >> 16) & 0xffff);
+#endif
}
unsigned long LoDWord(LargeWord Src)
{
+#if 1
+ abort();
+#else
return Src & 0xfffffffful;
+#endif
}
Boolean Odd(int inp)
{
+#if 1
+ abort();
+#else
return ((inp & 1) == 1);
+#endif
}
Boolean DirScan(char *Mask, charcallback callback)
{
+#if 1
+ abort();
+#else
char Name[1024];
#ifdef __MSDOS__
return True;
#endif
#endif
+#endif
}
LongInt MyGetFileTime(char *Name)
{
+#if 1
+ abort();
+#else
struct stat st;
if (stat(Name, &st) == -1)
return 0;
else
return st.st_mtime;
+#endif
}
#ifdef __CYGWIN32__
char *DeCygWinDirList(char *pStr)
{
+#if 1
+ abort();
+#else
char *pRun;
for (pRun = pStr; *pRun; pRun++)
*pRun = ';';
return pStr;
+#endif
}
char *DeCygwinPath(char *pStr)
{
+#if 1
+ abort();
+#else
char *pRun;
if ((strlen(pStr) >= 4)
*pRun = '\\';
return pStr;
+#endif
}
#endif /* __CYGWIN32__ */
void bpemu_init(void)
{
+#if 1
+ abort();
+#else
+#endif
}
CPUVar AddCPUUserWithArgs(const char *NewName, tCPUSwitchUserProc Switcher, void *pUserData, tCPUFreeUserDataProc Freeer, const tCPUArg *pArgs)
{
+#if 1
+ abort();
+#else
tpCPUDef Lauf, Neu;
char *p;
int l;
}
return CPUCnt++;
+#endif
}
typedef struct
static void SwitchNoUserProc(void *pUserData)
{
+#if 1
+ abort();
+#else
((tNoUserData*)pUserData)->Switcher();
+#endif
}
static void FreeNoUserProc(void *pUserData)
{
+#if 1
+ abort();
+#else
free(pUserData);
+#endif
}
CPUVar AddCPUWithArgs(const char *NewName, tCPUSwitchProc Switcher, const tCPUArg *pArgs)
{
+#if 1
+ abort();
+#else
tNoUserData *pData = (tNoUserData*)malloc(sizeof(*pData));
pData->Switcher = Switcher;
return AddCPUUserWithArgs(NewName, SwitchNoUserProc, pData, FreeNoUserProc, pArgs);
+#endif
}
Boolean AddCPUAlias(char *OrigName, char *AliasName)
{
+#if 1
+ abort();
+#else
tpCPUDef Lauf = FirstCPUDef, Neu;
while ((Lauf) && (strcmp(Lauf->Name, OrigName)))
Lauf->Next = Neu;
return True;
}
+#endif
}
void IterateCPUList(tCPUListIterator Iterator, void *pUser)
{
+#if 1
+ abort();
+#else
tpCPUDef pRun;
for (pRun= FirstCPUDef; pRun; pRun = pRun->Next)
Iterator(pRun, pUser);
+#endif
}
typedef struct
static void PrintIterator(const tCPUDef *pCPUDef, void *pUser)
{
+#if 1
+ abort();
+#else
tPrintContext *pContext = (tPrintContext*)pUser;
/* ignore aliases */
printf("%-*s", MaxNameLen + 1, pCPUDef->Name);
pContext->cnt++;
}
+#endif
}
void PrintCPUList(tPrintNextCPUProc NxtProc)
{
+#if 1
+ abort();
+#else
tPrintContext Context;
Context.Proc = NULL;
IterateCPUList(PrintIterator, &Context);
printf("\n");
NxtProc();
+#endif
}
void ClearCPUList(void)
{
+#if 1
+ abort();
+#else
tpCPUDef Save;
while (FirstCPUDef)
Save->FreeProc(Save->pUserData);
free(Save);
}
+#endif
}
const tCPUDef *LookupCPUDefByVar(CPUVar Var)
{
+#if 1
+ abort();
+#else
tpCPUDef pRun;
for (pRun = FirstCPUDef; pRun; pRun = pRun->Next)
if (pRun->Number == Var)
break;
return pRun;
+#endif
}
const tCPUDef *LookupCPUDefByName(const char *pName)
{
+#if 1
+ abort();
+#else
tpCPUDef pRun;
for (pRun = FirstCPUDef; pRun; pRun = pRun->Next)
break;
}
return pRun;
+#endif
}
void cpulist_init(void)
{
+#if 1
+ abort();
+#else
FirstCPUDef = NULL;
CPUCnt = 0;
+#endif
}
static void check_dynamic(const as_dynstr_t *p_str)
{
+#if 1
+ abort();
+#else
if (!p_str->dynamic)
{
fprintf(stderr, "attemt to resize non-dynamic string\n");
abort();
}
+#endif
}
/*!------------------------------------------------------------------------
void as_dynstr_ini(as_dynstr_t *p_str, size_t ini_capacity)
{
+#if 1
+ abort();
+#else
p_str->p_str = (char*)malloc(ini_capacity);
p_str->capacity = p_str->p_str ? ini_capacity : 0;
p_str->dynamic = !!p_str->p_str;
memset(p_str->p_str, 0, p_str->capacity);
+#endif
}
/*!------------------------------------------------------------------------
void as_dynstr_ini_clone(as_dynstr_t *p_str, const as_dynstr_t *p_src)
{
+#if 1
+ abort();
+#else
p_str->p_str = (char*)malloc(p_src->capacity);
if (p_str->p_str)
{
p_str->capacity = 0;
p_str->dynamic = 0;
}
+#endif
}
/*!------------------------------------------------------------------------
void as_dynstr_ini_c_str(as_dynstr_t *p_str, const char *p_src)
{
+#if 1
+ abort();
+#else
size_t capacity = as_dynstr_roundup_len(strlen(p_src));
p_str->p_str = (char*)malloc(capacity);
p_str->capacity = 0;
p_str->dynamic = 0;
}
+#endif
}
/*!------------------------------------------------------------------------
int as_dynstr_realloc(as_dynstr_t *p_str, size_t new_capacity)
{
+#if 1
+ abort();
+#else
char *p_new;
size_t old_capacity;
}
else
return ENOMEM;
+#endif
}
/*!------------------------------------------------------------------------
void as_dynstr_free(as_dynstr_t *p_str)
{
+#if 1
+ abort();
+#else
if (p_str->dynamic && p_str->p_str)
free(p_str->p_str);
p_str->p_str = NULL;
p_str->capacity = 0;
p_str->dynamic = 0;
+#endif
}
/*!------------------------------------------------------------------------
size_t as_dynstr_copy(as_dynstr_t *p_dest, const as_dynstr_t *p_src)
{
+#if 1
+ abort();
+#else
return as_dynstr_copy_c_str(p_dest, p_src->p_str);
+#endif
}
/*!------------------------------------------------------------------------
size_t as_dynstr_copy_c_str(as_dynstr_t *p_dest, const char *p_src)
{
+#if 1
+ abort();
+#else
size_t len = strlen(p_src);
if ((len >= p_dest->capacity) && p_dest->dynamic)
memcpy(p_dest->p_str, p_src, len);
p_dest->p_str[len] = '\0';
return len;
+#endif
}
/*!------------------------------------------------------------------------
size_t as_dynstr_append_c_str(as_dynstr_t *p_dest, const char *p_src)
{
+#if 1
+ abort();
+#else
size_t src_len = strlen(p_src),
dest_len = strlen(p_dest->p_str);
memcpy(p_dest->p_str + dest_len, p_src, src_len);
p_dest->p_str[dest_len + src_len] = '\0';
return src_len;
+#endif
}
/*!------------------------------------------------------------------------
void as_dynstr_dump_hex(FILE *p_file, const as_dynstr_t *p_str)
{
+#if 1
+ abort();
+#else
const char *p_run;
fprintf(p_file, "[%u]", (unsigned)p_str->capacity);
for (p_run = p_str->p_str; *p_run; p_run++) fprintf(p_file, " %02x", *p_run & 0xff);
fprintf(p_file, "\n");
+#endif
}
/* */
/*****************************************************************************/
+#include <stdlib.h> // Nick
#include <string.h>
#include <stdarg.h>
#include "strutil.h"
static tErrorNum GetDefaultCPUErrorNum(tErrorNum ThisNum)
{
+#if 1
+ abort();
+#else
return ThisNum ? ThisNum : ErrNum_InstructionNotSupported;
+#endif
}
/*!------------------------------------------------------------------------
static Boolean report_error_range(LargeInt value, LargeInt ref, char comp_op, tErrorNum error_num, const tStrComp *p_comp)
{
+#if 1
+ abort();
+#else
char s[100];
as_snprintf(s, sizeof(s), "%llld %c %llld", value, comp_op, ref);
else
WrXError(error_num, s);
return False;
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkRangePos(LargeInt Value, LargeInt Min, LargeInt Max, const tStrComp *p_comp)
{
+#if 1
+ abort();
+#else
if (Value < Min)
return report_error_range(Value, Min, '<', ErrNum_UnderRange, p_comp);
else if (Value > Max)
return report_error_range(Value, Max, '>', ErrNum_OverRange, p_comp);
else
return True;
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkRangeWarnPos(LargeInt Value, LargeInt Min, LargeInt Max, const tStrComp *p_comp)
{
+#if 1
+ abort();
+#else
if (Value < Min)
return report_error_range(Value, Min, '<', ErrNum_WUnderRange, p_comp);
else if (Value > Max)
return report_error_range(Value, Max, '>', ErrNum_WOverRange, p_comp);
else
return True;
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkArgCntExtPos(int ThisCnt, int MinCnt, int MaxCnt, const struct sLineComp *pComp)
{
+#if 1
+ abort();
+#else
if ((ThisCnt < MinCnt) || (ThisCnt > MaxCnt))
{
char Str[100];
}
else
return True;
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkArgCntExtEitherOr(int ThisCnt, int EitherCnt, int OrCnt)
{
+#if 1
+ abort();
+#else
if ((ThisCnt != EitherCnt) && (ThisCnt != OrCnt))
{
char Str[100];
}
else
return True;
+#endif
}
/*!------------------------------------------------------------------------
extern Boolean ChkMinCPUExt(CPUVar MinCPU, tErrorNum ErrorNum)
{
+#if 1
+ abort();
+#else
if (MomCPU < MinCPU)
{
const tCPUDef *pCPUDef;
return False;
}
return True;
+#endif
}
/*!------------------------------------------------------------------------
Boolean AChkMinCPUExtPos(CPUVar MinCPU, tErrorNum ErrorNum, const struct sStrComp *pComp)
{
+#if 1
+ abort();
+#else
if (MomCPU < MinCPU)
{
WrStrErrorPos(ErrorNum, pComp);
return False;
}
return True;
+#endif
}
/*!------------------------------------------------------------------------
extern Boolean ChkMaxCPUExt(CPUVar MaxCPU, tErrorNum ErrorNum)
{
+#if 1
+ abort();
+#else
if (MomCPU > MaxCPU)
{
const tCPUDef *pCPUDef;
return False;
}
return True;
+#endif
}
/*!------------------------------------------------------------------------
extern Boolean ChkRangeCPUExt(CPUVar MinCPU, CPUVar MaxCPU, tErrorNum ErrorNum)
{
+#if 1
+ abort();
+#else
if ((MomCPU < MinCPU) || (MomCPU > MaxCPU))
{
const tCPUDef *pCPUDefMin, *pCPUDefMax;
return False;
}
return True;
+#endif
}
/*!------------------------------------------------------------------------
extern Boolean ChkExactCPUExt(CPUVar MatchCPU, tErrorNum ErrorNum)
{
+#if 1
+ abort();
+#else
if (MomCPU != MatchCPU)
{
const tCPUDef *pCPUDef;
return False;
}
return True;
+#endif
}
/*!------------------------------------------------------------------------
static void IterateExclude(const tCPUDef *pThisCPUDef, void *pUser)
{
+#if 1
+ abort();
+#else
tExcludeContext *pContext = (tExcludeContext*)pUser;
/* ignore other families or aliases */
pContext->First = False;
}
pContext->pLastCPUDef = pThisCPUDef;
+#endif
}
extern Boolean ChkExcludeCPUExt(CPUVar MatchCPU, tErrorNum ErrorNum)
{
+#if 1
+ abort();
+#else
tExcludeContext Context;
if (MomCPU != MatchCPU)
else
WrError(GetDefaultCPUErrorNum(ErrorNum));
return False;
+#endif
}
/*!------------------------------------------------------------------------
int ChkExcludeCPUList(int ErrorNum, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
int Index = -1, FoundIndex = 0;
CPUVar ThisCPU;
}
return FoundIndex;
+#endif
}
/*!------------------------------------------------------------------------
extern int ChkExactCPUList(int ErrorNum, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
String Str;
CPUVar ThisCPU, NextCPU;
strmaxcat(Str, getmessage(Num_ErrMsgOnlyCPUSupported2), sizeof(Str));
WrXError(GetDefaultCPUErrorNum((tErrorNum)ErrorNum), Str);
return -1;
+#endif
}
/*!------------------------------------------------------------------------
int ChkExactCPUMaskExt(Word CPUMask, CPUVar FirstCPU, tErrorNum ErrorNum)
{
+#if 1
+ abort();
+#else
int Bit = MomCPU - FirstCPU;
String Str;
const tCPUDef *pCPUDef;
strmaxcat(Str, getmessage(Num_ErrMsgOnlyCPUSupported2), sizeof(Str));
WrXError(ErrorNum ? ErrorNum : ErrNum_InstructionNotSupported, Str);
return -1;
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkSamePage(LargeWord CurrAddr, LargeWord DestAddr, unsigned PageBits, tSymbolFlags DestFlags)
{
+#if 1
+ abort();
+#else
LargeWord Mask = ~((1ul << PageBits) - 1);
Boolean Result = ((CurrAddr & Mask) == (DestAddr & Mask))
|| mFirstPassUnknownOrQuestionable(DestFlags);
if (!Result)
WrError(ErrNum_TargOnDiffPage);
return Result;
+#endif
}
static Boolean ChkIntFormatCHex(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
if ((pCtx->ExprLen > 2)
&& (*pCtx->pExpr == '0')
&& (RadixBase <= Ch - 'A' + 10)
return True;
}
return False;
+#endif
}
static Boolean ChkIntFormatCBin(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
if ((pCtx->ExprLen > 2)
&& (*pCtx->pExpr == '0')
&& (RadixBase <= Ch - 'A' + 10)
return True;
}
return False;
+#endif
}
static Boolean ChkIntFormatMot(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
if ((pCtx->ExprLen > 1)
&& (*pCtx->pExpr == Ch))
{
return True;
}
return False;
+#endif
}
static Boolean ChkIntFormatInt(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
if ((pCtx->ExprLen < 2) || !as_isdigit(*pCtx->pExpr))
return False;
if ((RadixBase <= Ch - 'A' + 10)
return True;
}
return False;
+#endif
}
static Boolean ChkIntFormatIBM(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
if ((pCtx->ExprLen < 3)
|| (as_toupper(*pCtx->pExpr) != Ch)
|| (pCtx->pExpr[1] != '\''))
return True;
}
return False;
+#endif
}
static Boolean ChkIntFormatCOct(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
const char *pRun;
UNUSED(Ch);
if (DigitVal(*pRun, 8) < 0)
return False;
return True;
+#endif
}
static Boolean ChkIntFormatNatHex(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
const char *pRun;
UNUSED(Ch);
if (!as_isxdigit(*pRun))
return False;
return True;
+#endif
}
static Boolean ChkIntFormatDef(tIntCheckCtx *pCtx, char Ch)
{
+#if 1
+ abort();
+#else
UNUSED(pCtx);
UNUSED(Ch);
return True;
+#endif
}
static const tIntFormatList IntFormatList_All[] =
const char *GetIntConstIntelSuffix(unsigned Radix)
{
+#if 1
+ abort();
+#else
static const char BaseLetters[3] =
{
'B', 'O', 'H'
return Result;
}
return "";
+#endif
}
/*!------------------------------------------------------------------------
const char *GetIntConstMotoPrefix(unsigned Radix)
{
+#if 1
+ abort();
+#else
static const char BaseIds[3] =
{
'%', '@', '$'
return Result;
}
return "";
+#endif
}
/*!------------------------------------------------------------------------
const char *GetIntConstCPrefix(unsigned Radix)
{
+#if 1
+ abort();
+#else
static const char BaseIds[3][3] =
{
"0b", "0", "0x"
if (Radix == BaseVals[BaseIdx])
return BaseIds[BaseIdx];;
return "";
+#endif
}
/*!------------------------------------------------------------------------
const char *GetIntConstIBMPrefix(unsigned Radix)
{
+#if 1
+ abort();
+#else
static const char BaseIds[3] =
{
'B', 'O', 'X'
return Result;
}
return "";
+#endif
}
/*!------------------------------------------------------------------------
const char *GetIntConstIBMSuffix(unsigned Radix)
{
+#if 1
+ abort();
+#else
unsigned BaseIdx;
for (BaseIdx = 0; BaseIdx < sizeof(BaseVals) / sizeof(*BaseVals); BaseIdx++)
if (Radix == BaseVals[BaseIdx])
return "\'";
return "";
+#endif
}
/*!------------------------------------------------------------------------
void SetIntConstModeByMask(LongWord Mask)
{
+#if 1
+ abort();
+#else
const tIntFormatList *pSrc;
tIntFormatList *pDest;
*pDest++ = *pSrc;
}
memset(pDest, 0, sizeof(*pDest));
+#endif
}
/*!------------------------------------------------------------------------
Boolean ModifyIntConstModeByMask(LongWord ANDMask, LongWord ORMask)
{
+#if 1
+ abort();
+#else
LongWord NewMask = (NativeIntConstModeMask & ~ANDMask) | ORMask;
if ((NewMask & BadMask) == BadMask)
SetIntConstModeByMask(NativeIntConstModeMask | (RelaxedMode ? OtherIntConstModeMask : 0));
return True;
}
+#endif
}
/*!------------------------------------------------------------------------
void SetIntConstMode(tIntConstMode Mode)
{
+#if 1
+ abort();
+#else
IntConstMode = Mode;
switch (Mode)
{
}
NativeIntConstModeMask |= (1ul << eIntFormatDefRadix);
SetIntConstModeByMask(NativeIntConstModeMask | (RelaxedMode ? OtherIntConstModeMask : 0));
+#endif
}
/*!------------------------------------------------------------------------
void SetIntConstRelaxedMode(Boolean NewRelaxedMode)
{
+#if 1
+ abort();
+#else
SetIntConstModeByMask(NativeIntConstModeMask | (NewRelaxedMode ? OtherIntConstModeMask : 0));
+#endif
}
/*!------------------------------------------------------------------------
tIntFormatId GetIntFormatId(const char *pIdent)
{
+#if 1
+ abort();
+#else
const tIntFormatList *pList;
for (pList = IntFormatList_All; pList->Check; pList++)
if (!as_strcasecmp(pIdent, pList->Ident))
return (tIntFormatId)pList->Id;
return eIntFormatNone;
+#endif
}
/*!------------------------------------------------------------------------
void intformat_init(void)
{
+#if 1
+ abort();
+#else
/* Allow all int const modes for handling possible -D options: */
RelaxedMode = True;
SetIntConstMode(eIntConstModeC);
+#endif
}
void _DumpCodeFill(const char *pTitle, const tCurrCodeFill *pFill)
{
+#if 1
+ abort();
+#else
fprintf(stderr, "%s %u %d\n", pTitle, (unsigned)pFill->FullWordCnt, pFill->LastWordFill);
+#endif
}
/*!------------------------------------------------------------------------
static Boolean SetDSFlag(struct sLayoutCtx *pCtx, tDSFlag Flag)
{
+#if 1
+ abort();
+#else
if ((pCtx->DSFlag != DSNone) && (pCtx->DSFlag != Flag))
{
WrStrErrorPos(ErrNum_MixDBDS, pCtx->pCurrComp);
}
pCtx->DSFlag = Flag;
return True;
+#endif
}
/*!------------------------------------------------------------------------
static Boolean IncMaxCodeLen(struct sLayoutCtx *pCtx, LongWord NumFullWords)
{
+#if 1
+ abort();
+#else
if (SetMaxCodeLen((pCtx->CurrCodeFill.FullWordCnt + NumFullWords) * pCtx->FullWordSize))
{
WrStrErrorPos(ErrNum_CodeOverflow, pCtx->pCurrComp);
}
else
return True;
+#endif
}
static LargeWord ByteInWord(Byte b, int Pos)
{
+#if 1
+ abort();
+#else
return ((LargeWord)b) << (Pos << 3);
+#endif
}
static Byte NibbleInByte(Byte n, int Pos)
{
+#if 1
+ abort();
+#else
return (n & 15) << (Pos << 2);
+#endif
}
static Word NibbleInWord(Byte n, int Pos)
{
+#if 1
+ abort();
+#else
return ((Word)(n & 15)) << (Pos << 2);
+#endif
}
static Byte ByteFromWord(LargeWord w, int Pos)
{
+#if 1
+ abort();
+#else
return (w >> (Pos << 3)) & 0xff;
+#endif
}
static Byte NibbleFromByte(Byte b, int Pos)
{
+#if 1
+ abort();
+#else
return (b >> (Pos << 2)) & 0x0f;
+#endif
}
static Byte NibbleFromWord(Word w, int Pos)
{
+#if 1
+ abort();
+#else
return (w >> (Pos << 2)) & 0x0f;
+#endif
}
/*!------------------------------------------------------------------------
static void SubCodeFill(tCurrCodeFill *c, const tCurrCodeFill *a, const tCurrCodeFill *b, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
c->FullWordCnt = a->FullWordCnt - b->FullWordCnt;
if ((c->LastWordFill = a->LastWordFill - b->LastWordFill) < 0)
{
c->LastWordFill += pCtx->ElemsPerFullWord;
c->FullWordCnt--;
}
+#endif
}
/*!------------------------------------------------------------------------
static void MultCodeFill(tCurrCodeFill *b, LongWord a, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
b->FullWordCnt *= a;
b->LastWordFill *= a;
if (pCtx->ElemsPerFullWord > 1)
b->FullWordCnt += div;
b->LastWordFill = mod;
}
+#endif
}
/*!------------------------------------------------------------------------
static void IncCodeFill(tCurrCodeFill *a, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (++a->LastWordFill >= pCtx->ElemsPerFullWord)
{
a->LastWordFill -= pCtx->ElemsPerFullWord;
a->FullWordCnt++;
}
+#endif
}
/*!------------------------------------------------------------------------
static Boolean IncCurrCodeFill(struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
LongInt OldFullWordCnt = pCtx->CurrCodeFill.FullWordCnt;
IncCodeFill(&pCtx->CurrCodeFill, pCtx);
WAsmCode[pCtx->CurrCodeFill.FullWordCnt] = 0;
return True;
}
+#endif
}
/*!------------------------------------------------------------------------
static void IncCodeFillBy(tCurrCodeFill *a, const tCurrCodeFill *inc, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
a->LastWordFill += inc->LastWordFill;
if ((pCtx->ElemsPerFullWord > 1) && (a->LastWordFill >= pCtx->ElemsPerFullWord))
{
a->FullWordCnt++;
}
a->FullWordCnt += inc->FullWordCnt;
+#endif
}
/*****************************************************************************
static Boolean Put4I_To_8(Byte b, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
tCurrCodeFill Pos = pCtx->CurrCodeFill;
if (!IncCurrCodeFill(pCtx))
return False;
else
BAsmCode[Pos.FullWordCnt] |= NibbleInByte(b, Pos.LastWordFill ^ pCtx->LoHiMap);
return True;
+#endif
}
static Boolean Replicate4_To_8(const tCurrCodeFill *pStartPos, const tCurrCodeFill *pEndPos, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte b;
tCurrCodeFill CurrPos;
}
return True;
+#endif
}
static Boolean Put4I_To_16(Byte b, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
tCurrCodeFill Pos = pCtx->CurrCodeFill;
if (!IncCurrCodeFill(pCtx))
return False;
else
WAsmCode[Pos.FullWordCnt] |= NibbleInWord(b, Pos.LastWordFill ^ pCtx->LoHiMap);
return True;
+#endif
}
static Boolean Replicate4_To_16(const tCurrCodeFill *pStartPos, const tCurrCodeFill *pEndPos, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte b;
tCurrCodeFill CurrPos;
}
return True;
+#endif
}
static Boolean LayoutNibble(const tStrComp *pExpr, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Boolean Result = False;
TempResult t;
func_exit:
as_tempres_free(&t);
return Result;
+#endif
}
/*****************************************************************************
static Boolean Put8I_To_8(Byte b, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 1))
return False;
BAsmCode[pCtx->CurrCodeFill.FullWordCnt++] = b;
return True;
+#endif
}
static Boolean Put8I_To_16(Byte b, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
tCurrCodeFill Pos = pCtx->CurrCodeFill;
if (!IncCurrCodeFill(pCtx))
return False;
else
WAsmCode[Pos.FullWordCnt] |= ByteInWord(b, Pos.LastWordFill ^ pCtx->LoHiMap);
return True;
+#endif
}
static Boolean Replicate8ToN_To_8(const tCurrCodeFill *pStartPos, const tCurrCodeFill *pEndPos, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
tCurrCodeFill Pos;
if (!IncMaxCodeLen(pCtx, pEndPos->FullWordCnt - pStartPos->FullWordCnt))
}
return True;
+#endif
}
static Boolean Replicate8_To_16(const tCurrCodeFill *pStartPos, const tCurrCodeFill *pEndPos, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte b;
tCurrCodeFill CurrPos;
}
return True;
+#endif
}
static Boolean LayoutByte(const tStrComp *pExpr, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Boolean Result = False;
TempResult t;
func_exit:
as_tempres_free(&t);
return Result;
+#endif
}
/*****************************************************************************
static Boolean Put16I_To_8(Word w, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 2))
return False;
BAsmCode[pCtx->CurrCodeFill.FullWordCnt + (0 ^ pCtx->LoHiMap)] = Lo(w);
BAsmCode[pCtx->CurrCodeFill.FullWordCnt + (1 ^ pCtx->LoHiMap)] = Hi(w);
pCtx->CurrCodeFill.FullWordCnt += 2;
return True;
+#endif
}
static Boolean Put16F_To_8(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 2))
return False;
if (!Double_2_ieee2(t, BAsmCode + pCtx->CurrCodeFill.FullWordCnt, !!pCtx->LoHiMap))
}
pCtx->CurrCodeFill.FullWordCnt += 2;
return True;
+#endif
}
static Boolean Put16I_To_16(Word w, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 1))
return False;
WAsmCode[pCtx->CurrCodeFill.FullWordCnt++] = w;
return True;
+#endif
}
static Boolean Put16F_To_16(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte Tmp[2];
if (!IncMaxCodeLen(pCtx, 1))
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + 0] = ByteInWord(Tmp[0], 0 ^ pCtx->LoHiMap) | ByteInWord(Tmp[1], 1 ^ pCtx->LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 1;
return True;
+#endif
}
static Boolean Replicate16ToN_To_16(const tCurrCodeFill *pStartPos, const tCurrCodeFill *pEndPos, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
tCurrCodeFill Pos;
if (!IncMaxCodeLen(pCtx, pEndPos->FullWordCnt - pStartPos->FullWordCnt))
}
return True;
+#endif
}
static Boolean LayoutWord(const tStrComp *pExpr, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Boolean Result = False;
TempResult t;
func_exit:
as_tempres_free(&t);
return Result;
+#endif
}
/*****************************************************************************
static Boolean Put32I_To_8(LongWord l, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 4))
return False;
BAsmCode[pCtx->CurrCodeFill.FullWordCnt + (0 ^ pCtx->LoHiMap)] = (l ) & 0xff;
BAsmCode[pCtx->CurrCodeFill.FullWordCnt + (3 ^ pCtx->LoHiMap)] = (l >> 24) & 0xff;
pCtx->CurrCodeFill.FullWordCnt += 4;
return True;
+#endif
}
static Boolean Put32F_To_8(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 4))
return False;
Double_2_ieee4(t, BAsmCode + pCtx->CurrCodeFill.FullWordCnt, !!pCtx->LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 4;
return True;
+#endif
}
static Boolean Put32I_To_16(LongWord l, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 2))
return False;
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + (0 ^ pCtx->LoHiMap)] = LoWord(l);
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + (1 ^ pCtx->LoHiMap)] = HiWord(l);
pCtx->CurrCodeFill.FullWordCnt += 2;
return True;
+#endif
}
static Boolean Put32F_To_16(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte Tmp[4];
if (!IncMaxCodeLen(pCtx, 2))
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + 1] = ByteInWord(Tmp[2], 0 ^ pCtx->LoHiMap) | ByteInWord(Tmp[3], 1 ^ pCtx->LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 2;
return True;
+#endif
}
static Boolean LayoutDoubleWord(const tStrComp *pExpr, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
TempResult erg;
Boolean Result = False;
Word Cnt = 0;
func_exit:
as_tempres_free(&erg);
return Result;
+#endif
}
static Boolean Put64I_To_8(LargeWord l, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 8))
return False;
BAsmCode[pCtx->CurrCodeFill.FullWordCnt + (0 ^ pCtx->LoHiMap)] = (l ) & 0xff;
#endif
pCtx->CurrCodeFill.FullWordCnt += 8;
return True;
+#endif
}
static Boolean Put64F_To_8(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 8))
return False;
Double_2_ieee8(t, BAsmCode + pCtx->CurrCodeFill.FullWordCnt, !!pCtx->LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 8;
return True;
+#endif
}
static Boolean Put64I_To_16(LargeWord l, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 4))
return False;
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + (0 ^ pCtx->LoHiMap)] = (l ) & 0xffff;
#endif
pCtx->CurrCodeFill.FullWordCnt += 4;
return True;
+#endif
}
static Boolean Put64F_To_16(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte Tmp[8];
int LoHiMap = pCtx->LoHiMap & 1;
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + 3] = ByteInWord(Tmp[6], 0 ^ LoHiMap) | ByteInWord(Tmp[7], 1 ^ LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 4;
return True;
+#endif
}
static Boolean LayoutQuadWord(const tStrComp *pExpr, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Boolean Result = False;
TempResult erg;
Word Cnt = 0;
func_exit:
as_tempres_free(&erg);
return Result;
+#endif
}
/*****************************************************************************
static Boolean Put80F_To_8(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
if (!IncMaxCodeLen(pCtx, 10))
return False;
Double_2_ieee10(t, BAsmCode + pCtx->CurrCodeFill.FullWordCnt, !!pCtx->LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 10;
return True;
+#endif
}
static Boolean Put80F_To_16(Double t, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Byte Tmp[10];
int LoHiMap = pCtx->LoHiMap & 1;
WAsmCode[pCtx->CurrCodeFill.FullWordCnt + 4] = ByteInWord(Tmp[8], 0 ^ LoHiMap) | ByteInWord(Tmp[9], 1 ^ LoHiMap);
pCtx->CurrCodeFill.FullWordCnt += 5;
return True;
+#endif
}
static Boolean LayoutTenBytes(const tStrComp *pExpr, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
Boolean Result = False;
TempResult erg;
Word Cnt;
func_exit:
as_tempres_free(&erg);
return Result;
+#endif
}
/*****************************************************************************
static Boolean DecodeIntelPseudo_ValidSymChar(char ch)
{
+#if 1
+ abort();
+#else
ch = as_toupper(ch);
return (((ch >= 'A') && (ch <= 'Z'))
|| ((ch >= '0') && (ch <= '9'))
|| (ch == '_')
|| (ch == '.'));
+#endif
}
static void DecodeIntelPseudo_HandleQuote(int *pDepth, Byte *pQuote, char Ch)
{
+#if 1
+ abort();
+#else
switch (Ch)
{
case '(':
(*pQuote) ^= 2;
break;
}
+#endif
}
static Boolean DecodeIntelPseudo_LayoutMult(const tStrComp *pArg, struct sLayoutCtx *pCtx)
{
+#if 1
+ abort();
+#else
int z, Depth, Len, LastNonBlank;
Boolean OK, LastValid, Result;
Byte Quote;
func_exit:
pCtx->pCurrComp = pSaveComp;
return Result;
+#endif
}
/*!------------------------------------------------------------------------
static void DecodeIntelDx(tLayoutCtx *pLayoutCtx)
{
+#if 1
+ abort();
+#else
tStrComp *pArg;
Boolean OK;
}
if (OK && (pLayoutCtx->FullWordSize == 1))
ActListGran = 1;
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDN(Word Flags)
{
+#if 1
+ abort();
+#else
tLayoutCtx LayoutCtx;
memset(&LayoutCtx, 0, sizeof(LayoutCtx));
break;
}
DecodeIntelDx(&LayoutCtx);
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDB(Word Flags)
{
+#if 1
+ abort();
+#else
tLayoutCtx LayoutCtx;
memset(&LayoutCtx, 0, sizeof(LayoutCtx));
if (*LabPart.str.p_str)
SetSymbolOrStructElemSize(&LabPart, eSymbolSize8Bit);
DecodeIntelDx(&LayoutCtx);
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDW(Word Flags)
{
+#if 1
+ abort();
+#else
tLayoutCtx LayoutCtx;
memset(&LayoutCtx, 0, sizeof(LayoutCtx));
if (*LabPart.str.p_str)
SetSymbolOrStructElemSize(&LabPart, eSymbolSize16Bit);
DecodeIntelDx(&LayoutCtx);
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDD(Word Flags)
{
+#if 1
+ abort();
+#else
tLayoutCtx LayoutCtx;
memset(&LayoutCtx, 0, sizeof(LayoutCtx));
if (*LabPart.str.p_str)
SetSymbolOrStructElemSize(&LabPart, eSymbolSize32Bit);
DecodeIntelDx(&LayoutCtx);
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDQ(Word Flags)
{
+#if 1
+ abort();
+#else
tLayoutCtx LayoutCtx;
memset(&LayoutCtx, 0, sizeof(LayoutCtx));
if (*LabPart.str.p_str)
SetSymbolOrStructElemSize(&LabPart, eSymbolSize64Bit);
DecodeIntelDx(&LayoutCtx);
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDT(Word Flags)
{
+#if 1
+ abort();
+#else
tLayoutCtx LayoutCtx;
memset(&LayoutCtx, 0, sizeof(LayoutCtx));
if (*LabPart.str.p_str)
SetSymbolOrStructElemSize(&LabPart, eSymbolSize80Bit);
DecodeIntelDx(&LayoutCtx);
+#endif
}
/*!------------------------------------------------------------------------
void DecodeIntelDS(Word Code)
{
+#if 1
+ abort();
+#else
UNUSED(Code);
if (ChkArgCnt(1, 1))
BookKeeping();
}
}
+#endif
}
/*!------------------------------------------------------------------------
Boolean DecodeIntelPseudo(Boolean BigEndian)
{
+#if 1
+ abort();
+#else
static PInstTable InstTables[2] = { NULL, NULL };
int Idx = !!BigEndian;
InstTables[Idx] = InstTable;
}
return LookupInstTable(InstTables[Idx], OpPart.str.p_str);
+#endif
}
/*!------------------------------------------------------------------------
static void DecodeZ80SYNTAX(Word Code)
{
+#if 1
+ abort();
+#else
UNUSED(Code);
if (ChkArgCnt(1, 1))
else
WrStrErrorPos(ErrNum_InvArg, &ArgStr[1]);
}
+#endif
}
/*!------------------------------------------------------------------------
Boolean ChkZ80Syntax(tZ80Syntax InstrSyntax)
{
+#if 1
+ abort();
+#else
if ((InstrSyntax == eSyntax808x) && (!(CurrZ80Syntax & eSyntax808x)))
{
WrStrErrorPos(ErrNum_Z80SyntaxExclusive, &OpPart);
}
else
return True;
+#endif
}
/*!------------------------------------------------------------------------
void AddZ80Syntax(struct sInstTable *InstTable)
{
+#if 1
+ abort();
+#else
if (!onoff_test_and_set(e_onoff_reg_z80syntax))
{
tStrComp TmpComp;
EnterIntSymbol(&TmpComp, 0, SegNone, True);
}
AddInstTable(InstTable, "Z80SYNTAX", 0, DecodeZ80SYNTAX);
+#endif
}
static void DecodeSFR(Word Code)
{
+#if 1
+ abort();
+#else
UNUSED(Code);
CodeEquate(SegData, 0, 0xff);
+#endif
}
static void DecodeDSx(Word Shift)
{
+#if 1
+ abort();
+#else
if (ChkArgCnt(1, 1))
{
tSymbolFlags Flags;
BookKeeping();
}
}
+#endif
}
static void DecodeFx(Word Shift)
{
+#if 1
+ abort();
+#else
if (ChkArgCnt(2, 2))
{
tSymbolFlags Flags;
}
}
}
+#endif
}
Boolean DecodeNatPseudo(void)
{
+#if 1
+ abort();
+#else
static PInstTable InstTable = NULL;
if (!InstTable)
}
return LookupInstTable(InstTable, OpPart.str.p_str);
+#endif
}
static void check_capacity(const tStrComp *pComp)
{
+#if 1
+ abort();
+#else
if (!pComp->str.capacity)
{
fprintf(stderr, "copy to zero-capacity StrComp\n");
abort();
}
+#endif
}
static void check_no_capacity(const tStrComp *pComp)
{
+#if 1
+ abort();
+#else
if (pComp->str.capacity)
{
fprintf(stderr, "ptr move on non-zero-capacity StrComp\n");
abort();
}
+#endif
}
static size_t check_realloc(as_dynstr_t *p_str, size_t req_count)
{
+#if 1
+ abort();
+#else
if ((req_count >= p_str->capacity) && p_str->dynamic)
as_dynstr_realloc(p_str, as_dynstr_roundup_len(req_count));
if (req_count >= p_str->capacity)
req_count = p_str->capacity - 1;
return req_count;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompAlloc(tStrComp *pComp, size_t capacity)
{
+#if 1
+ abort();
+#else
as_dynstr_ini(&pComp->str, capacity);
StrCompReset(pComp);
+#endif
}
/*!------------------------------------------------------------------------
void StrCompReset(tStrComp *pComp)
{
+#if 1
+ abort();
+#else
LineCompReset(&pComp->Pos);
*pComp->str.p_str = '\0';
+#endif
}
/*!------------------------------------------------------------------------
void LineCompReset(tLineComp *pComp)
{
+#if 1
+ abort();
+#else
pComp->StartCol = -1;
pComp->Len = 0;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompFree(tStrComp *pComp)
{
+#if 1
+ abort();
+#else
LineCompReset(&pComp->Pos);
as_dynstr_free(&pComp->str);
+#endif
}
/*!------------------------------------------------------------------------
void StrCompMkTemp(tStrComp *pComp, char *pStr, size_t capacity)
{
+#if 1
+ abort();
+#else
LineCompReset(&pComp->Pos);
pComp->str.p_str = pStr;
pComp->str.capacity = capacity;
pComp->str.dynamic = 0;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompRefRight(tStrComp *pDest, const tStrComp *pSrc, size_t StartOffs)
{
+#if 1
+ abort();
+#else
pDest->str.p_str = pSrc->str.p_str + StartOffs;
pDest->str.capacity = 0;
pDest->str.dynamic = 0;
pDest->Pos.StartCol = pSrc->Pos.StartCol + StartOffs;
pDest->Pos.Len = pSrc->Pos.Len - StartOffs;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompCopy(tStrComp *pDest, const tStrComp *pSrc)
{
+#if 1
+ abort();
+#else
pDest->Pos = pSrc->Pos;
pDest->Pos.Len = as_dynstr_copy(&pDest->str, &pSrc->str);
+#endif
}
/*!------------------------------------------------------------------------
void StrCompCopySub(tStrComp *pDest, const tStrComp *pSrc, size_t Start, size_t Count)
{
+#if 1
+ abort();
+#else
unsigned l = strlen(pSrc->str.p_str);
if (Start >= l)
pDest->str.p_str[Count] = '\0';
pDest->Pos.StartCol = pSrc->Pos.StartCol + Start;
pDest->Pos.Len = Count;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompSplitRight(tStrComp *pSrc, tStrComp *pDest, char *pSrcSplitPos)
{
+#if 1
+ abort();
+#else
size_t SrcLen = strlen(pSrcSplitPos + 1);
check_capacity(pDest);
pDest->Pos.Len = SrcLen;
*pSrcSplitPos = '\0';
pSrc->Pos.Len = pSrcSplitPos - pSrc->str.p_str;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompSplitLeft(tStrComp *pSrc, tStrComp *pDest, char *pSrcSplitPos)
{
+#if 1
+ abort();
+#else
size_t SrcLen;
*pSrcSplitPos = '\0';
strmov(pSrc->str.p_str, pSrcSplitPos + 1);
pSrc->Pos.StartCol += pSrcSplitPos - pSrc->str.p_str + 1;
pSrc->Pos.Len -= pSrcSplitPos - pSrc->str.p_str + 1;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompSplitCopy(tStrComp *pLeft, tStrComp *pRight, const tStrComp *pSrc, char *pSplitPos)
{
+#if 1
+ abort();
+#else
/* pLeft may be equal to pSrc, use memmove() and save SrcLen */
size_t SrcLen = pSrc->Pos.Len;
pRight->Pos.Len = check_realloc(&pRight->str, SrcLen - (pLeft->Pos.Len + 1));
memcpy(pRight->str.p_str, pSplitPos + 1, pRight->Pos.Len);
pRight->str.p_str[pRight->Pos.Len] = '\0';
+#endif
}
/*!------------------------------------------------------------------------
char StrCompSplitRef(tStrComp *pLeft, tStrComp *pRight, const tStrComp *pSrc, char *pSplitPos)
{
+#if 1
+ abort();
+#else
char Old = *pSplitPos;
/* save because pLeft and pSrc might be equal */
tLineComp SrcPos = pSrc->Pos;
pRight->Pos.Len = SrcPos.Len - (pLeft->Pos.Len + 1);
return Old;
+#endif
}
/*!------------------------------------------------------------------------
void KillPrefBlanksStrComp(struct sStrComp *pComp)
{
+#if 1
+ abort();
+#else
int Delta = KillPrefBlanks(pComp->str.p_str);
pComp->Pos.StartCol += Delta;
pComp->Pos.Len -= Delta;
+#endif
}
/*!------------------------------------------------------------------------
void KillPrefBlanksStrCompRef(struct sStrComp *pComp)
{
+#if 1
+ abort();
+#else
check_no_capacity(pComp);
while (isspace(*pComp->str.p_str))
{
pComp->Pos.StartCol++;
pComp->Pos.Len--;
}
+#endif
}
/*!------------------------------------------------------------------------
void KillPostBlanksStrComp(struct sStrComp *pComp)
{
+#if 1
+ abort();
+#else
pComp->Pos.Len -= KillPostBlanks(pComp->str.p_str);
+#endif
}
/*!------------------------------------------------------------------------
void StrCompShorten(struct sStrComp *pComp, size_t Delta)
{
+#if 1
+ abort();
+#else
pComp->str.p_str[strlen(pComp->str.p_str) - Delta] = '\0';
pComp->Pos.Len -= Delta;
+#endif
}
/*!------------------------------------------------------------------------
size_t StrCompCutLeft(struct sStrComp *pComp, size_t Delta)
{
+#if 1
+ abort();
+#else
size_t len = strlen(pComp->str.p_str);
if (Delta > len)
pComp->Pos.StartCol += Delta;
pComp->Pos.Len -= Delta;
return Delta;
+#endif
}
/*!------------------------------------------------------------------------
void StrCompIncRefLeft(struct sStrComp *pComp, size_t Delta)
{
+#if 1
+ abort();
+#else
check_no_capacity(pComp);
pComp->str.p_str += Delta;
pComp->str.capacity = (pComp->str.capacity > Delta) ? pComp->str.capacity - Delta : 0;
pComp->Pos.StartCol += Delta;
pComp->Pos.Len -= Delta;
+#endif
}
/*!------------------------------------------------------------------------
void DumpStrComp(const char *pTitle, const struct sStrComp *pComp)
{
+#if 1
+ abort();
+#else
fprintf(stderr, "%s: @ col %u len %u '%s'\n", pTitle, pComp->Pos.StartCol, pComp->Pos.Len, pComp->str.p_str);
+#endif
}
const char *Blanks(int cnt)
{
+#if 1
+ abort();
+#else
static const char *BlkStr = " ";
static int BlkStrLen = 0;
cnt = BlkStrLen;
return BlkStr + (BlkStrLen - cnt);
+#endif
}
/*!------------------------------------------------------------------------
char *SysStringCore(char *pDest, char *pDestCurr, LargeWord Num, int System, int Stellen, char StartCharacter)
{
+#if 1
+ abort();
+#else
LargeWord Digit;
do
}
while ((Stellen > 0) || Num);
return pDestCurr;
+#endif
}
int SysString(char *pDest, size_t DestSize, LargeWord Num, int System, int Stellen, Boolean ForceLeadZero, char StartCharacter, char SplitCharacter)
{
+#if 1
+ abort();
+#else
int Len = 0;
char *pDestCurr, *pDestNext;
if (pDestCurr != pDest)
strmov(pDest, pDestCurr);
return Len;
+#endif
}
/*---------------------------------------------------------------------------*/
char *as_strdup(const char *s)
{
+#if 1
+ abort();
+#else
char *ptr;
if (!s)
if (ptr != 0)
strcpy(ptr, s);
return ptr;
+#endif
}
/*---------------------------------------------------------------------------*/
/* ...so is snprintf... */
static void ResetFormatContext(tFormatContext *pContext)
{
+#if 1
+ abort();
+#else
int z;
for (z = 0; z < 3; z++)
pContext->LeftAlign =
pContext->AddPlus =
pContext->ForceUpper = False;
+#endif
}
/*!------------------------------------------------------------------------
static size_t limit_minus_one(dest_format_context_t *p_dest_ctx, size_t cnt)
{
+#if 1
+ abort();
+#else
/* anyway still enough space? */
if (p_dest_ctx->dest_remlen > cnt)
else
return (cnt >= p_dest_ctx->dest_remlen) ? p_dest_ctx->dest_remlen - 1 : cnt;
+#endif
}
/*!------------------------------------------------------------------------
static size_t append_pad(dest_format_context_t *p_dest_ctx, char src, size_t cnt)
{
+#if 1
+ abort();
+#else
cnt = limit_minus_one(p_dest_ctx, cnt);
if (cnt > 0)
p_dest_ctx->dest_remlen -= cnt;
}
return cnt;
+#endif
}
#if 0
static int FloatConvert(char *pDest, size_t DestSize, double Src, int Digits, Boolean TruncateTrailingZeros, char FormatType)
{
+#if 1
+ abort();
+#else
int DecPt;
int Sign, Result = 0;
char *pBuf, *pEnd, *pRun;
Result = pRun - pDest;
Result += as_snprintf(pRun, DestSize - Result, "e%+02d", DecPt - 1);
return Result;
+#endif
}
#else
static int FloatConvert(char *pDest, size_t DestSize, double Src, int Digits, Boolean TruncateTrailingZeros, char FormatType)
{
+#if 1
+ abort();
+#else
char Format[10];
(void)DestSize;
Format[4] = (HexStartCharacter == 'a') ? FormatType : toupper(FormatType);
sprintf(pDest, Format, Digits, Src);
return strlen(pDest);
+#endif
}
#endif
static size_t append(dest_format_context_t *p_dest_ctx, const char *p_src, size_t cnt, tFormatContext *pFormatContext)
{
+#if 1
+ abort();
+#else
size_t pad_len, result = 0;
pad_len = (pFormatContext->Arg[0] > (int)cnt) ? pFormatContext->Arg[0] - cnt : 0;
ResetFormatContext(pFormatContext);
return result + cnt;
+#endif
}
/*!------------------------------------------------------------------------
static int vsprcatf_core(dest_format_context_t *p_dest_ctx, const char *pFormat, va_list ap)
{
+#if 1
+ abort();
+#else
const char *pFormatStart = pFormat;
int Result = 0;
size_t OrigLen = strlen(p_dest_ctx->p_dest);
if (p_dest_ctx->dest_remlen > 0)
*(p_dest_ctx->p_dest++) = '\0';
return Result;
+#endif
}
/*!------------------------------------------------------------------------
int as_vsdprcatf(as_dynstr_t *p_dest, const char *pFormat, va_list ap)
{
+#if 1
+ abort();
+#else
dest_format_context_t ctx;
ctx.p_dest = p_dest->p_str;
ctx.dest_remlen = p_dest->capacity;
ctx.p_dynstr = p_dest;
return vsprcatf_core(&ctx, pFormat, ap);
+#endif
}
/*!------------------------------------------------------------------------
int as_vsdprintf(as_dynstr_t *p_dest, const char *pFormat, va_list ap)
{
+#if 1
+ abort();
+#else
if (p_dest->capacity > 0)
p_dest->p_str[0] = '\0';
return as_vsdprcatf(p_dest, pFormat, ap);
+#endif
}
/*!------------------------------------------------------------------------
int as_sdprcatf(as_dynstr_t *p_dest, const char *pFormat, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
int ret;
ret = as_vsdprcatf(p_dest, pFormat, ap);
va_end(ap);
return ret;
+#endif
}
/*!------------------------------------------------------------------------
int as_sdprintf(as_dynstr_t *p_dest, const char *pFormat, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
int ret;
ret = as_vsdprintf(p_dest, pFormat, ap);
va_end(ap);
return ret;
+#endif
}
/*!------------------------------------------------------------------------
int as_vsnprcatf(char *pDest, size_t DestSize, const char *pFormat, va_list ap)
{
+#if 1
+ abort();
+#else
dest_format_context_t ctx;
if (DestSize == sizeof(char*))
ctx.dest_remlen = DestSize;
ctx.p_dynstr = NULL;
return vsprcatf_core(&ctx, pFormat, ap);
+#endif
}
/*!------------------------------------------------------------------------
int as_vsnprintf(char *pDest, size_t DestSize, const char *pFormat, va_list ap)
{
+#if 1
+ abort();
+#else
if (DestSize > 0)
*pDest = '\0';
return as_vsnprcatf(pDest, DestSize, pFormat, ap);
+#endif
}
/*!------------------------------------------------------------------------
int as_snprintf(char *pDest, size_t DestSize, const char *pFormat, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
int Result;
Result = as_vsnprcatf(pDest, DestSize, pFormat, ap);
va_end(ap);
return Result;
+#endif
}
/*!------------------------------------------------------------------------
int as_snprcatf(char *pDest, size_t DestSize, const char *pFormat, ...)
{
+#if 1
+ abort();
+#else
va_list ap;
int Result;
Result = as_vsnprcatf(pDest, DestSize, pFormat, ap);
va_end(ap);
return Result;
+#endif
}
int as_strcasecmp(const char *src1, const char *src2)
{
+#if 1
+ abort();
+#else
if (!src1)
src1 = "";
if (!src2)
src2++;
}
return ((int) tolower(*src1)) - ((int) tolower(*src2));
-}
+#endif
+}
int as_strncasecmp(const char *src1, const char *src2, size_t len)
{
+#if 1
+ abort();
+#else
if (!src1)
src1 = "";
if (!src2)
src2++;
}
return ((int) tolower(*src1)) - ((int) tolower(*src2));
-}
+#endif
+}
#ifdef NEEDS_STRSTR
char *strstr(const char *haystack, const char *needle)
{
+#if 1
+ abort();
+#else
int lh = strlen(haystack), ln = strlen(needle);
int z;
char *p;
if (strncmp(p = haystack + z, needle, ln) == 0)
return p;
return NULL;
+#endif
}
#endif
char *strrmultchr(const char *haystack, const char *needles)
{
+#if 1
+ abort();
+#else
const char *pPos;
for (pPos = haystack + strlen(haystack) - 1; pPos >= haystack; pPos--)
if (strchr(needles, *pPos))
return (char*)pPos;
return NULL;
+#endif
}
/*---------------------------------------------------------------------------*/
size_t strmaxcpy(char *dest, const char *src, size_t Max)
{
+#if 1
+ abort();
+#else
size_t cnt = strlen(src);
/* leave room for terminating NUL */
memcpy(dest, src, cnt);
dest[cnt] = '\0';
return cnt;
+#endif
}
/*---------------------------------------------------------------------------*/
size_t strmaxcat(char *Dest, const char *Src, size_t MaxLen)
{
+#if 1
+ abort();
+#else
int TLen = strlen(Src);
size_t DLen = strlen(Dest);
}
else
return DLen;
+#endif
}
void strprep(char *Dest, const char *Src)
{
+#if 1
+ abort();
+#else
memmove(Dest + strlen(Src), Dest, strlen(Dest) + 1);
memmove(Dest, Src, strlen(Src));
+#endif
}
/*!------------------------------------------------------------------------
void strmaxprep(char *p_dest, const char *p_src, size_t max_len)
{
+#if 1
+ abort();
+#else
size_t src_len = strlen(p_src),
dest_len = strlen(p_dest);
src_len = max_len - dest_len - 1;
memmove(p_dest + src_len, p_dest, dest_len + 1);
memmove(p_dest, p_src, src_len);
+#endif
}
/*!------------------------------------------------------------------------
void strmaxprep2(char *p_dest, const char *p_src, size_t max_len)
{
+#if 1
+ abort();
+#else
size_t src_len = strlen(p_src),
dest_len = strlen(p_dest);
dest_len = max_len - 1;
memmove(p_dest + src_len, p_dest, dest_len + 1);
memmove(p_dest, p_src, src_len);
+#endif
}
void strins(char *Dest, const char *Src, int Pos)
{
+#if 1
+ abort();
+#else
memmove(Dest + Pos + strlen(Src), Dest + Pos, strlen(Dest) + 1 - Pos);
memmove(Dest + Pos, Src, strlen(Src));
+#endif
}
void strmaxins(char *Dest, const char *Src, int Pos, size_t MaxLen)
{
+#if 1
+ abort();
+#else
size_t RLen;
RLen = strlen(Src);
RLen = MaxLen - strlen(Dest);
memmove(Dest + Pos + RLen, Dest + Pos, strlen(Dest) + 1 - Pos);
memmove(Dest + Pos, Src, RLen);
+#endif
}
int strlencmp(const char *pStr1, unsigned Str1Len,
const char *pStr2, unsigned Str2Len)
{
+#if 1
+ abort();
+#else
const char *p1, *p2, *p1End, *p2End;
int Diff;
return Diff;
}
return ((int)Str1Len) - ((int)Str2Len);
+#endif
}
unsigned fstrlenprint(FILE *pFile, const char *pStr, unsigned StrLen)
{
+#if 1
+ abort();
+#else
unsigned Result = 0;
const char *pRun, *pEnd;
}
return Result;
+#endif
}
size_t as_strnlen(const char *pStr, size_t MaxLen)
{
+#if 1
+ abort();
+#else
size_t Res = 0;
for (; (MaxLen > 0); MaxLen--, pStr++, Res++)
if (!*pStr)
break;
return Res;
+#endif
}
/*!------------------------------------------------------------------------
int strreplace(char *pHaystack, const char *pFrom, const char *pTo, size_t ToMaxLen, size_t HaystackSize)
{
+#if 1
+ abort();
+#else
int HaystackLen = -1, FromLen = -1, ToLen = -1, Count = 0;
int HeadLen, TailLen;
char *pSearch, *pPos;
Count++;
}
+#endif
}
/*---------------------------------------------------------------------------*/
void ReadLn(FILE *Datei, char *Zeile)
{
+#if 1
+ abort();
+#else
char *ptr;
int l;
Zeile[--l] = '\0';
if ((l > 0) && (Zeile[l - 1] == 26))
Zeile[--l] = '\0';
+#endif
}
#if 0
static void dump(const char *pLine, unsigned Cnt)
{
+#if 1
+ abort();
+#else
unsigned z;
fputc('\n', stderr);
fputc('\n', stderr);
}
fputc('\n', stderr);
+#endif
}
#endif
size_t ReadLnCont(FILE *Datei, as_dynstr_t *p_line)
{
+#if 1
+ abort();
+#else
char *ptr, *pDest;
size_t l, Count, LineCount;
Boolean Terminated;
}
return LineCount;
+#endif
}
/*!------------------------------------------------------------------------
int DigitVal(char ch, int Base)
{
+#if 1
+ abort();
+#else
int Result;
/* Ziffern 0..9 ergeben selbiges */
Result = -1;
return (Result >= Base) ? -1 : Result;
+#endif
}
/*--------------------------------------------------------------------*/
LargeInt ConstLongInt(const char *inp, Boolean *pErr, LongInt Base)
{
+#if 1
+ abort();
+#else
static const char Prefixes[4] = { '$', '@', '%', '\0' }; /* die moeglichen Zahlensysteme */
static const char Postfixes[4] = { 'H', 'O', '\0', '\0' };
static const LongInt Bases[3] = { 16, 8, 2 }; /* die dazugehoerigen Basen */
}
return erg;
+#endif
}
/*--------------------------------------------------------------------------*/
void KillBlanks(char *s)
{
+#if 1
+ abort();
+#else
char *z, *dest;
Boolean InSgl = False, InDbl = False, ThisEscaped = False, NextEscaped = False;
*dest++ = *z;
}
*dest = '\0';
+#endif
}
int CopyNoBlanks(char *pDest, const char *pSrc, size_t MaxLen)
{
+#if 1
+ abort();
+#else
const char *pSrcRun;
char *pDestRun = pDest;
size_t Cnt = 0;
*pDestRun = '\0';
return Cnt;
+#endif
}
/*--------------------------------------------------------------------------*/
int KillPrefBlanks(char *s)
{
+#if 1
+ abort();
+#else
char *z = s;
while ((*z != '\0') && as_isspace(*z))
if (z != s)
strmov(s, z);
return z - s;
+#endif
}
/*--------------------------------------------------------------------------*/
int KillPostBlanks(char *s)
{
+#if 1
+ abort();
+#else
char *z = s + strlen(s) - 1;
int count = 0;
count++;
}
return count;
+#endif
}
/*--------------------------------------------------------------------------*/
int strqcmp(const char *s1, const char *s2)
{
+#if 1
+ abort();
+#else
int erg = (*s1) - (*s2);
return (erg != 0) ? erg : strcmp(s1, s2);
+#endif
}
/*--------------------------------------------------------------------------*/
char *strmov(char *pDest, const char *pSrc)
{
+#if 1
+ abort();
+#else
memmove(pDest, pSrc, strlen(pSrc) + 1);
return pDest;
+#endif
}
#ifdef __GNUC__
#endif
char *strcpy(char *pDest, const char *pSrc)
{
+#if 1
+ abort();
+#else
int l = strlen(pSrc) + 1;
int Overlap = 0;
}
return strmov(pDest, pSrc);
+#endif
}
#endif
int strmemcpy(char *pDest, size_t DestSize, const char *pSrc, size_t SrcLen)
{
+#if 1
+ abort();
+#else
if (DestSize < SrcLen + 1)
SrcLen = DestSize - 1;
memmove(pDest, pSrc, SrcLen);
pDest[SrcLen] = '\0';
return SrcLen;
+#endif
}
/*--------------------------------------------------------------------------*/
char *ParenthPos(char *pHaystack, char Needle)
{
+#if 1
+ abort();
+#else
char *pRun;
int Level = 0;
}
}
return NULL;
+#endif
}
/*!------------------------------------------------------------------------
char TabCompressed(char in)
{
+#if 1
+ abort();
+#else
return (in == '\t') ? ' ' : (as_isprint(in) ? in : '*');
+#endif
}
/*--------------------------------------------------------------------------*/
void strutil_init(void)
{
+#if 1
+ abort();
+#else
HexStartCharacter = 'A';
+#endif
}