mirror of
https://github.com/cc65/cc65.git
synced 2025-02-06 12:31:12 +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:
parent
4160505c59
commit
11d46e93b2
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -178,9 +175,9 @@ void PrintDbgSpans (FILE* F)
|
||||
|
||||
/* Output the data */
|
||||
fprintf (F, "span\tid=%u,seg=%u,start=%lu,size=%lu\n",
|
||||
O->SpanBaseId + S->Id,
|
||||
Sec->Seg->Id,
|
||||
Sec->Offs + S->Offs,
|
||||
O->SpanBaseId + S->Id,
|
||||
Sec->Seg->Id,
|
||||
Sec->Offs + S->Offs,
|
||||
S->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 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user