initial checkin
This commit is contained in:
31
bepascal/source/bepascal/pas/src/be/storage/alias.pp
Normal file
31
bepascal/source/bepascal/pas/src/be/storage/alias.pp
Normal 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.
|
||||
41
bepascal/source/bepascal/test/beeptest.pas
Normal file
41
bepascal/source/bepascal/test/beeptest.pas
Normal 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.
|
||||
Reference in New Issue
Block a user