X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/f08fcf34cacb98d46cd8ee85398994db26a80a56..1ce0597f39134fe2948d621d566b7c3c8f278d91:/apt-pkg/contrib/fileutl.h?ds=sidebyside diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 74e0d542f..48bd95537 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -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 @@ -21,12 +21,11 @@ #ifndef PKGLIB_FILEUTL_H #define PKGLIB_FILEUTL_H -#ifdef __GNUG__ -#pragma interface "apt-pkg/fileutl.h" -#endif #include +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);