mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 22:25:28 +00:00
Export NewSpan() - this will be needed later.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5206 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -66,18 +66,21 @@ struct Span {
|
||||
|
||||
|
||||
|
||||
static Span* NewSpan (unsigned Id, unsigned SecId, unsigned long Offs, unsigned long Size)
|
||||
Span* NewSpan (ObjData* Obj, unsigned SecId, unsigned long Offs, unsigned long Size)
|
||||
/* Create and return a new span */
|
||||
{
|
||||
/* Allocate memory */
|
||||
Span* S = xmalloc (sizeof (*S));
|
||||
|
||||
/* Initialize the fields */
|
||||
S->Id = Id;
|
||||
S->Id = CollCount (&Obj->Spans);
|
||||
S->Sec = SecId;
|
||||
S->Offs = Offs;
|
||||
S->Size = Size;
|
||||
|
||||
/* Insert it into the collection of all spans of this object file */
|
||||
CollAppend (&Obj->Spans, S);
|
||||
|
||||
/* Return the result */
|
||||
return S;
|
||||
}
|
||||
@@ -87,17 +90,11 @@ static Span* NewSpan (unsigned Id, unsigned SecId, unsigned long Offs, unsigned
|
||||
Span* ReadSpan (FILE* F, ObjData* O)
|
||||
/* Read a Span from a file and return it */
|
||||
{
|
||||
/* Create a new Span */
|
||||
/* Create a new Span and return it */
|
||||
unsigned SecId = ReadVar (F);
|
||||
unsigned long Offs = ReadVar (F);
|
||||
unsigned Size = ReadVar (F);
|
||||
Span* S = NewSpan (CollCount (&O->Spans), SecId, Offs, Size);
|
||||
|
||||
/* Insert it into the collection of all spans of this object file */
|
||||
CollAppend (&O->Spans, S);
|
||||
|
||||
/* And return it */
|
||||
return S;
|
||||
return NewSpan (O, SecId, Offs, Size);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -73,6 +73,10 @@ typedef struct Span Span;
|
||||
|
||||
|
||||
|
||||
Span* NewSpan (struct ObjData* Obj, unsigned SecId, unsigned long Offs,
|
||||
unsigned long Size);
|
||||
/* Create and return a new span */
|
||||
|
||||
Span* ReadSpan (FILE* F, struct ObjData* O);
|
||||
/* Read a Span from a file and return it */
|
||||
|
||||
|
Reference in New Issue
Block a user