program pFileManager;
uses
{$IFDEF LINUX}
  cthreads,
  cmem,
  uemuladorwinipc in '../../../src_libnettopos/fctopos/IPC/Linux/uemuladorwinipc.pas',
  usemaforopolenta in '../../../src_libnettopos/fctopos/IPC/Linux/usemaforopolenta.pas',
  ipcobjs in '../../../src_libnettopos/fctopos/IPC/Linux/ipcobjs.pas',
  ukeydir in '../../../src_libnettopos/libnettopos/ukeydir.pas',
  uwinmsgs in '../../../src_libnettopos/fctopos/IPC/Linux/uwinmsgs.pas',
{$ELSE}
  ipcthrd in '../../../src_libnettopos/fctopos/IPC/Win32/ipcthrd.pas',
{$ENDIF}
{$IFDEF NETTOPOS_DLL}
  uimportnettopos in '../../../src_libnettopos/libnettopos/uimportnettopos.pas',
{$ELSE}
  unettopos in '../../../src_libnettopos/libnettopos/unettopos.pas',
  unettopostypes in '../../../src_libnettopos/libnettopos/unettopostypes.pas',
  uglobsharedmem in '../../../src_libnettopos/libnettopos/uglobsharedmem.pas',
  uHeapManager in '../../../src_libnettopos/libnettopos/uHeapManager.pas',
{$ENDIF}
  uconstantes_nettopos in '../../../src_libnettopos/libnettopos/uconstantes_nettopos.pas',
  ubuffrw in '../../../src_libnettopos/fctopos/ubuffrw.pas',
  Classes,
  uFormFileManager in 'uFormFileManager.pas' {FileManager},
  uFichasFileManager in 'uFichasFileManager.pas',
  uMsgsFileManager in 'uMsgsFileManager.pas',
  MD5 in './FileHandler/MD5.pas',
  xmatdefs in '..\..\fc\rch30\xmatdefs.pas',
  uauxiliares in '..\..\fc\base\uauxiliares.pas',
  winLinuxUtils in '..\..\fc\PA10\winLinuxUtils.pas',
  uevaluador in '..\..\fc\rch30\uevaluador.pas';

procedure TFmth_execute;
var
	m: TWinMsg;
begin
//writeln('TFmth_execute->TFileManager.Create');
  FileManager:= TFileManager.Create(NIL);
  while FileManager.recolectar do
  begin
   if xGetMessage_WAIT( m ) = 0 then
   begin
//     writeln('FileManager mensaje: ', m.msgCode,' : ',m.wParam,' : ',m.lParam);
     FileManager.Dispatch(m);
   end
   else
    write('.');
  end;
//writeln('TFmth_execute->TFileManager.Free');
  FileManager.Free;
//writeln('TFmth_execute->TFileManager.fin.');
end;

begin

  //writeln(' Paso a modo SUBTERRANEO !');
  // test;
//  daemon(0,0);

//  tf:= TFmth.Create;
  TFmth_execute;

end.
