Place shared modules into the common dir

git-svn-id: svn://svn.cc65.org/cc65/trunk@71 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-06-14 09:57:42 +00:00
parent 6a482b59fa
commit 2767f66146
17 changed files with 181 additions and 197 deletions

View File

@@ -36,8 +36,8 @@
#include <string.h>
#include "../common/hashstr.h"
#include "../common/xmalloc.h"
#include "mem.h"
#include "error.h"
#include "extsyms.h"
@@ -88,11 +88,11 @@ ExtSym* NewExtSym (ExtSymTab* Tab, const char* Name)
ExtSym* E = GetExtSym (Tab, Name); /* Don't care about duplicate hash here... */
if (E != 0) {
/* We do already have a symbol with this name */
Error ("Duplicate external symbol `%s'", Name);
Error ("Duplicate external symbol `%s'", Name);
}
/* Allocate memory for the structure */
E = Xmalloc (sizeof (ExtSym) + Len);
E = xmalloc (sizeof (ExtSym) + Len);
/* Initialize the structure */
E->List = 0;
@@ -102,10 +102,10 @@ ExtSym* NewExtSym (ExtSymTab* Tab, const char* Name)
/* Insert the entry into the list of all symbols */
if (Tab->Last == 0) {
/* List is empty */
Tab->Root = E;
/* List is empty */
Tab->Root = E;
} else {
/* List not empty */
/* List not empty */
Tab->Last->List = E;
}
Tab->Last = E;
@@ -120,13 +120,13 @@ ExtSym* NewExtSym (ExtSymTab* Tab, const char* Name)
}
static void FreeExtSym (ExtSym* E)
/* Free an external symbol structure. Will not unlink the entry, so internal
* use only.
*/
{
Xfree (E);
xfree (E);
}
@@ -137,14 +137,14 @@ ExtSymTab* NewExtSymTab (void)
unsigned I;
/* Allocate memory */
ExtSymTab* Tab = Xmalloc (sizeof (ExtSymTab));
ExtSymTab* Tab = xmalloc (sizeof (ExtSymTab));
/* Initialize the fields */
Tab->Root = 0;
Tab->Last = 0;
Tab->Count = 0;
for (I = 0; I < HASHTAB_SIZE; ++I) {
Tab->HashTab [I] = 0;
Tab->HashTab [I] = 0;
}
/* Done, return the hash table */
@@ -158,13 +158,13 @@ void FreeExtSymTab (ExtSymTab* Tab)
{
/* Free all entries */
while (Tab->Root) {
ExtSym* E = Tab->Root;
Tab->Root = E->Next;
FreeExtSym (E);
ExtSym* E = Tab->Root;
Tab->Root = E->Next;
FreeExtSym (E);
}
/* Free the struct itself */
Xfree (Tab);
xfree (Tab);
}