* fix error in AutocleanInterval, closes: #319339
[ntk/apt.git] / apt-pkg / contrib / fileutl.h
index 74e0d54..48bd955 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: fileutl.h,v 1.24 2001/03/03 22:36:20 tausq Exp $
+// $Id: fileutl.h,v 1.26 2001/05/07 05:06:52 jgg Exp $
 /* ######################################################################
    
    File Utilities
 #ifndef PKGLIB_FILEUTL_H
 #define PKGLIB_FILEUTL_H
 
-#ifdef __GNUG__
-#pragma interface "apt-pkg/fileutl.h"
-#endif 
 
 #include <string>
 
+using std::string;
+
 class FileFd
 {
    protected:
@@ -40,7 +39,14 @@ class FileFd
    public:
    enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp};
    
-   bool Read(void *To,unsigned long Size,bool AllowEof = false);
+   inline bool Read(void *To,unsigned long Size,bool AllowEof)
+   {
+      unsigned long Jnk;
+      if (AllowEof)
+        return Read(To,Size,&Jnk);
+      return Read(To,Size);
+   }   
+   bool Read(void *To,unsigned long Size,unsigned long *Actual = 0);
    bool Write(const void *From,unsigned long Size);
    bool Seek(unsigned long To);
    bool Skip(unsigned long To);
@@ -78,8 +84,8 @@ string SafeGetCWD();
 void SetCloseExec(int Fd,bool Close);
 void SetNonBlock(int Fd,bool Block);
 bool WaitFd(int Fd,bool write = false,unsigned long timeout = 0);
-int ExecFork();
-bool ExecWait(int Pid,const char *Name,bool Reap = false);
+pid_t ExecFork();
+bool ExecWait(pid_t Pid,const char *Name,bool Reap = false);
 
 // File string manipulators
 string flNotDir(string File);