unit xdos;
{$X+,S-}

interface

const
	SEPARATOR	='/';
	ReadOnly	=$01;
	Hidden		=$02;
	SysFile		=$04;
	VolumeID	=$08;
	Directory	=$10;
	Archive		=$20;
	AnyFile		=$3f;

	DENOENT		=2;
	DENOMOREFILES=18;
	
	name_max=255;

var
	doserror:word(32);external;

	

type
	StatRec = record
		st_dev:word(64);
		__pad1:word(16);
		st_ino:word(32);
		st_mode:word(32);
		st_nlink:word(32);
		st_uid:word(32);
		st_gid:word(32);
		st_rdev:word(32);
		__pad2:word(16);
		st_size:word(64);
		st_blksize:word(32);
		st_blocks:word(32);
		st_atime:word(32);
		__unused1:word(32);
		st_mtime:word(32);
		__unused2:word(32);
		st_ctime:word(32);
		__unused3:word(32);
		__unused4:word(32);
		__unused5:word(32);
	end;
	SearchRec = record
		Time,
		Size:		word(64);
		name:		string(12);
		match:		array[0..10] of char;
		Attr:		byte;
		path:		array[0..NAME_MAX] of char;
		longname:	array[0..NAME_MAX] of char;
		st:			StatRec;
	end;

procedure FindFirst(path:CString; attr:word; var s:SearchRec);
asmname 'FindFirst';
procedure FindNext(var s:SearchRec);
asmname 'FindNext';

implementation

{$L xdosc.c}

{var
	sr:SearchRec;
begin
	FindFirst('*.pas',Anyfile,sr);
	while doserror=0 do begin
		writeln(sr.size,#9,sr.name);
		findnext(sr);
	end;}
end.