mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-01 19:09:24 +01:00
+ .a writer
This commit is contained in:
parent
215e6cb22d
commit
461a11158e
@ -468,6 +468,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
b^.WriteBin;
|
b^.WriteBin;
|
||||||
dispose(b,done);
|
dispose(b,done);
|
||||||
|
if assigned(current_module^.ppufilename) then
|
||||||
|
begin
|
||||||
|
if (cs_smartlink in aktmoduleswitches) then
|
||||||
|
SynchronizeFileTime(current_module^.ppufilename^,current_module^.staticlibfilename^)
|
||||||
|
else
|
||||||
|
SynchronizeFileTime(current_module^.ppufilename^,current_module^.objfilename^);
|
||||||
|
end;
|
||||||
if assigned(current_module^.ppufilename) then
|
if assigned(current_module^.ppufilename) then
|
||||||
SynchronizeFileTime(current_module^.ppufilename^,current_module^.objfilename^);
|
SynchronizeFileTime(current_module^.ppufilename^,current_module^.objfilename^);
|
||||||
exit;
|
exit;
|
||||||
@ -534,7 +541,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.39 1999-03-01 15:43:48 peter
|
Revision 1.40 1999-03-18 20:30:44 peter
|
||||||
|
+ .a writer
|
||||||
|
|
||||||
|
Revision 1.39 1999/03/01 15:43:48 peter
|
||||||
* synchronize also the objfile for ag386bin
|
* synchronize also the objfile for ag386bin
|
||||||
|
|
||||||
Revision 1.38 1999/02/26 00:48:15 peter
|
Revision 1.38 1999/02/26 00:48:15 peter
|
||||||
|
|||||||
@ -152,27 +152,27 @@ unit cobjects;
|
|||||||
procedure clear;
|
procedure clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Pnamed_object=^Tnamed_object;
|
Pnamed_object=^Tnamed_object;
|
||||||
Pdictionary=^Tdictionary;
|
Pdictionary=^Tdictionary;
|
||||||
Pdictionaryhasharray=^Tdictionaryhasharray;
|
Pdictionaryhasharray=^Tdictionaryhasharray;
|
||||||
|
|
||||||
Tdictionaryhasharray=array[0..hasharraysize-1] of Pnamed_object;
|
Tdictionaryhasharray=array[0..hasharraysize-1] of Pnamed_object;
|
||||||
|
|
||||||
Tcallback = procedure(p:Pnamed_object);
|
Tcallback = procedure(p:Pnamed_object);
|
||||||
|
|
||||||
Tdictionary=object
|
Tdictionary=object
|
||||||
root:Pnamed_object;
|
root:Pnamed_object;
|
||||||
hasharray:Pdictionaryhasharray;
|
hasharray:Pdictionaryhasharray;
|
||||||
replace_existing : boolean;
|
replace_existing : boolean;
|
||||||
constructor init(usehash:boolean);
|
constructor init(usehash:boolean);
|
||||||
procedure clear;virtual;
|
procedure clear;virtual;
|
||||||
procedure foreach(proc2call:Tcallback);
|
procedure foreach(proc2call:Tcallback);
|
||||||
function insert(obj:Pnamed_object):Pnamed_object;virtual;
|
function insert(obj:Pnamed_object):Pnamed_object;virtual;
|
||||||
function search(const s:string):Pnamed_object;
|
function search(const s:string):Pnamed_object;
|
||||||
function speedsearch(const s:string;
|
function speedsearch(const s:string;
|
||||||
speedvalue:longint):Pnamed_object;virtual;
|
speedvalue:longint):Pnamed_object;virtual;
|
||||||
destructor done;virtual;
|
destructor done;virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Tnamed_object=object
|
Tnamed_object=object
|
||||||
_name:Pstring;
|
_name:Pstring;
|
||||||
@ -184,6 +184,28 @@ unit cobjects;
|
|||||||
function name:string;
|
function name:string;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
pdynamicarray = ^tdynamicarray;
|
||||||
|
tdynamicarray = object
|
||||||
|
posn,
|
||||||
|
count,
|
||||||
|
limit,
|
||||||
|
elemlen,
|
||||||
|
growcount : longint;
|
||||||
|
data : pchar;
|
||||||
|
constructor init(Aelemlen,Agrow:longint);
|
||||||
|
destructor done;
|
||||||
|
function size:longint;
|
||||||
|
function usedsize:longint;
|
||||||
|
procedure grow;
|
||||||
|
procedure align(i:longint);
|
||||||
|
procedure seek(i:longint);
|
||||||
|
procedure write(var d;len:longint);
|
||||||
|
procedure read(var d;len:longint);
|
||||||
|
procedure writepos(pos:longint;var d;len:longint);
|
||||||
|
procedure readpos(pos:longint;var d;len:longint);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ifdef BUFFEREDFILE}
|
{$ifdef BUFFEREDFILE}
|
||||||
{ this is implemented to allow buffered binary I/O }
|
{ this is implemented to allow buffered binary I/O }
|
||||||
pbufferedfile = ^tbufferedfile;
|
pbufferedfile = ^tbufferedfile;
|
||||||
@ -1036,6 +1058,119 @@ begin
|
|||||||
dispose(hasharray);
|
dispose(hasharray);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{****************************************************************************
|
||||||
|
tdynamicarray
|
||||||
|
****************************************************************************}
|
||||||
|
|
||||||
|
constructor tdynamicarray.init(Aelemlen,Agrow:longint);
|
||||||
|
begin
|
||||||
|
posn:=0;
|
||||||
|
count:=0;
|
||||||
|
limit:=0;
|
||||||
|
data:=nil;
|
||||||
|
elemlen:=Aelemlen;
|
||||||
|
growcount:=Agrow;
|
||||||
|
grow;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function tdynamicarray.size:longint;
|
||||||
|
begin
|
||||||
|
size:=limit*elemlen;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function tdynamicarray.usedsize:longint;
|
||||||
|
begin
|
||||||
|
usedsize:=count*elemlen;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.grow;
|
||||||
|
var
|
||||||
|
osize : longint;
|
||||||
|
odata : pchar;
|
||||||
|
begin
|
||||||
|
osize:=size;
|
||||||
|
odata:=data;
|
||||||
|
inc(limit,growcount);
|
||||||
|
getmem(data,size);
|
||||||
|
if assigned(odata) then
|
||||||
|
begin
|
||||||
|
move(odata^,data^,osize);
|
||||||
|
freemem(odata,osize);
|
||||||
|
end;
|
||||||
|
fillchar(data[osize],growcount*elemlen,0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.align(i:longint);
|
||||||
|
var
|
||||||
|
j : longint;
|
||||||
|
begin
|
||||||
|
j:=(posn*elemlen mod i);
|
||||||
|
if j<>0 then
|
||||||
|
begin
|
||||||
|
j:=i-j;
|
||||||
|
while limit<(posn+j) do
|
||||||
|
grow;
|
||||||
|
inc(posn,j);
|
||||||
|
if (posn>count) then
|
||||||
|
count:=posn;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.seek(i:longint);
|
||||||
|
begin
|
||||||
|
while limit<i do
|
||||||
|
grow;
|
||||||
|
posn:=i;
|
||||||
|
if (posn>count) then
|
||||||
|
count:=posn;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.write(var d;len:longint);
|
||||||
|
begin
|
||||||
|
while limit<(posn+len) do
|
||||||
|
grow;
|
||||||
|
move(d,data[posn*elemlen],len*elemlen);
|
||||||
|
inc(posn,len);
|
||||||
|
if (posn>count) then
|
||||||
|
count:=posn;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.read(var d;len:longint);
|
||||||
|
begin
|
||||||
|
move(data[posn*elemlen],d,len*elemlen);
|
||||||
|
inc(posn,len);
|
||||||
|
if (posn>count) then
|
||||||
|
count:=posn;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.writepos(pos:longint;var d;len:longint);
|
||||||
|
begin
|
||||||
|
while limit<(pos+len) do
|
||||||
|
grow;
|
||||||
|
move(d,data[pos*elemlen],len*elemlen);
|
||||||
|
posn:=pos+len;
|
||||||
|
if (posn>count) then
|
||||||
|
count:=posn;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure tdynamicarray.readpos(pos:longint;var d;len:longint);
|
||||||
|
begin
|
||||||
|
while limit<(pos+len) do
|
||||||
|
grow;
|
||||||
|
move(data[pos*elemlen],d,len*elemlen);
|
||||||
|
posn:=pos+len;
|
||||||
|
if (posn>count) then
|
||||||
|
count:=posn;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor tdynamicarray.done;
|
||||||
|
begin
|
||||||
|
if assigned(data) then
|
||||||
|
freemem(data,size);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ifdef BUFFEREDFILE}
|
{$ifdef BUFFEREDFILE}
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
@ -1424,7 +1559,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.19 1999-03-01 13:32:00 pierre
|
Revision 1.20 1999-03-18 20:30:45 peter
|
||||||
|
+ .a writer
|
||||||
|
|
||||||
|
Revision 1.19 1999/03/01 13:32:00 pierre
|
||||||
* external used before implemented problem fixed
|
* external used before implemented problem fixed
|
||||||
|
|
||||||
Revision 1.18 1999/02/24 00:59:13 peter
|
Revision 1.18 1999/02/24 00:59:13 peter
|
||||||
|
|||||||
@ -66,8 +66,11 @@ unit pmodules;
|
|||||||
if (cs_create_sharedlib in aktmoduleswitches) then
|
if (cs_create_sharedlib in aktmoduleswitches) then
|
||||||
Linker.MakeSharedLibrary
|
Linker.MakeSharedLibrary
|
||||||
else
|
else
|
||||||
if (cs_create_staticlib in aktmoduleswitches) or
|
if (cs_create_staticlib in aktmoduleswitches)
|
||||||
(cs_smartlink in aktmoduleswitches) then
|
{$ifndef AG386BIN}
|
||||||
|
or (cs_smartlink in aktmoduleswitches)
|
||||||
|
{$endif}
|
||||||
|
then
|
||||||
Linker.MakeStaticLibrary(SmartLinkFilesCnt);
|
Linker.MakeStaticLibrary(SmartLinkFilesCnt);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1256,7 +1259,10 @@ unit pmodules;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.102 1999-03-16 21:07:25 peter
|
Revision 1.103 1999-03-18 20:30:46 peter
|
||||||
|
+ .a writer
|
||||||
|
|
||||||
|
Revision 1.102 1999/03/16 21:07:25 peter
|
||||||
* check for dup uses
|
* check for dup uses
|
||||||
|
|
||||||
Revision 1.101 1999/02/25 21:02:43 peter
|
Revision 1.101 1999/02/25 21:02:43 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user