initial checkin

This commit is contained in:
oscarl-2
2003-11-16 08:23:56 +00:00
parent eb242cfcb9
commit d1cab9c647
2 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Description: path->alias->path functions
unit Alias;
interface
uses
DataIO, Path, SupportDefs;
{.$define SupDefParm}
function resolve_link(const path : PChar; result : BPath;
block : Boolean {$ifdef SupDefParm}= False{$endif})
: status_t; cdecl; external 'be' name 'resolve_link__FPCcP5BPathb';
function write_alias(const path : PChar; s : BDataIO;
len : size_t {$ifdef SupDefParm}= nil{$endif})
: status_t; cdecl; external 'be' name 'write_alias__FPCcP7BDataIOPUl';
function write_alias(const path : PChar; buf : Pointer; len : size_t)
: status_t; cdecl; external 'be' name 'write_alias__FPCcPvPUl';
function read_alias(s : BDataIO; result : BPath;
len : size_t {$ifdef SupDefParm}= nil{$endif};
block : Boolean {$ifdef SupDefParm}= False{$endif})
: status_t; cdecl; external 'be' name 'read_alias__FP7BDataIOP5BPathPUlb';
function read_alias(const buf : Pointer; result : BPath; len : size_t;
block : Boolean {$ifdef SupDefParm}= False{$endif})
: status_t; cdecl; external 'be' name 'read_alias__FPCvP5BPathPUlb';
implementation
end.

View File

@@ -0,0 +1,41 @@
program BeepTest;
uses
_Beep;
const
kUnitName = '_Beep';
var
Errors : Byte;
begin
Errors := 0;
WriteLn('Testing unit: ' + kUnitName);
WriteLn('===================');
WriteLn('Beeping..');
if beep < 0 then
begin
Inc(Errors);
WriteLn('Failed.');
end;
WriteLn('Now the system beeps...');
if system_beep('bla') < 0 then
begin
WriteLn('Failed (ok).');
end
else
Inc(Errors);
if system_beep('Beep') < 0 then
begin
Inc(Errors);
WriteLn('Failed (shouldn''t).');
end;
if Errors = 0 then
WriteLn('Test of unit ' + kUnitName + ' PASSED')
else
WriteLn('Test of unit ' + kUnitName + ' FAILED with ', Errors, ' Error(s)');
end.