Commit 2dab614b authored by Frank B. Brokken's avatar Frank B. Brokken

Standardized Process's eoi manipulator's implementation (via Eoi)

parent ab59f144
...@@ -157,6 +157,14 @@ bobcat (5.00.00) ...@@ -157,6 +157,14 @@ bobcat (5.00.00)
must be a Process::IOMode value. The same applies to the function must be a Process::IOMode value. The same applies to the function
call operator previously accespting a size_t argument. call operator previously accespting a size_t argument.
- cerr() is replaced by childErrStream() - cerr() is replaced by childErrStream()
- the eoi() member calls eoi_(). Alternatively the eoi manipulator can
be inserted into Process objects to indicate the process's
end-of-information.
- the eoi manipulator, defined for Process only, is superfluous and is
discontinued. Existing code now uses the Eoi-manipulator after
recompilation. Changes to the source code are not required.
- the std::ostream &operator<<(std::ostream &(*pf)(std::ostream &))
is superfluous and is discontinued.
* RandBuf: * RandBuf:
- expects a size_t seed (used to be: long seed); - expects a size_t seed (used to be: long seed);
......
...@@ -25,7 +25,7 @@ class DigestBuf: public EoiBuf ...@@ -25,7 +25,7 @@ class DigestBuf: public EoiBuf
private: private:
int overflow(int c) override; int overflow(int c) override;
void eoi_(); // .cc void eoi_() override; // .cc
}; };
#include "eoi.f" #include "eoi.f"
......
...@@ -19,15 +19,15 @@ GPP="g++ --std=c++2a" ...@@ -19,15 +19,15 @@ GPP="g++ --std=c++2a"
CMD="$GPP -o driver -Wall *.cc -L../tmp -lhmacbuf -L /tmp -lbob -lcrypto -s" CMD="$GPP -o driver -Wall *.cc -L../tmp -lhmacbuf -L /tmp -lbob -lcrypto -s"
# Using the library in ../tmp/ # Using the library in ../tmp/
# CMD="$GPP -o driver -Wall *.cc -L../tmp -lhmacbuf ${LIBS} -s" CMD="$GPP -o driver -Wall *.cc -L../tmp -ldigestbuf ${LIBS} -s"
# Using tmp libraries and bobcat # # Using tmp libraries and bobcat
CMD="$GPP -o driver -Wall -I../tmp driver.cc \ # CMD="$GPP -o driver -Wall -I../tmp driver.cc \
-L../tmp -ldigestbuf \ # -L../tmp -ldigestbuf \
-L../../ohexbuf/tmp -lohexbuf \ # -L../../ohexbuf/tmp -lohexbuf \
-L../../eoibuf/tmp -leoibuf \ # -L../../eoibuf/tmp -leoibuf \
-L../../eoi/tmp -leoi \ # -L../../eoi/tmp -leoi \
${LIBS} -s" # ${LIBS} -s"
echo ${CMD} echo ${CMD}
${CMD} ${CMD}
......
#include "digestbuf.ih" #include "digestbuf.ih"
#include <iostream>
void DigestBuf::eoi_() void DigestBuf::eoi_()
{ {
cerr << __FILE__"\n";
if (d_ctx == 0) if (d_ctx == 0)
return; return;
......
...@@ -93,7 +93,7 @@ includefile(include/namespace) ...@@ -93,7 +93,7 @@ includefile(include/namespace)
manpagesection(INHERITS FROM) manpagesection(INHERITS FROM)
bf(FBB::Fork)(3bobcat) (private), nl() bf(FBB::Fork)(3bobcat) (private), nl()
bf(FBB:IOStream)(3bobcat) bf(FBB:IOStream)(3bobcat), and by implication: bf(FBB::Eoi), nl()
bf(FBB:ProcessEnums) bf(FBB:ProcessEnums)
The tt(struct ProcessEnums) defines enumerations and support functions which The tt(struct ProcessEnums) defines enumerations and support functions which
...@@ -323,7 +323,6 @@ followed by tt(setCommand), followed by calling an appropriate overloaded ...@@ -323,7 +323,6 @@ followed by tt(setCommand), followed by calling an appropriate overloaded
version of the member tt(start) (tt(start()) uses the object's current version of the member tt(start) (tt(start()) uses the object's current
tt(IOMode, ProcessType,) and time limit). tt(IOMode, ProcessType,) and time limit).
itb(Process &operator()(IOMode mode)) itb(Process &operator()(IOMode mode))
This operator changes the the tt(Process) object's tt(IOMode) This operator changes the the tt(Process) object's tt(IOMode)
parameter. A reference to the tt(Process) object is returned, allowing parameter. A reference to the tt(Process) object is returned, allowing
...@@ -436,9 +435,6 @@ the value that was actually used when starting the child process, as the ...@@ -436,9 +435,6 @@ the value that was actually used when starting the child process, as the
default value may be altered by a function call operator just before starting default value may be altered by a function call operator just before starting
the child process. the child process.
itb(std::istream &cerr())
This member should be avoided. Use tt(childErrStream) instead.nl()
itb(std::istream &childErrStream()) itb(std::istream &childErrStream())
If tt(Process::CERR) was specified then this member interfaces If tt(Process::CERR) was specified then this member interfaces
to the child's standard error stream. By extracting the information from to the child's standard error stream. By extracting the information from
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
#define INCLUDED_BOBCAT_IOBUF_ #define INCLUDED_BOBCAT_IOBUF_
#include <fstream> #include <fstream>
#include <streambuf> #include <bobcat/eoi>
namespace FBB namespace FBB
{ {
class IOBuf: public std::streambuf class IOBuf: public Eoi
{ {
char d_buf; char d_buf;
std::istream *d_in; std::istream *d_in;
......
#define LIBRARY "iostream"
#define AUXFLAGS "-I../tmp"
#include "../icmconf"
inline std::ostream &eoi(std::ostream &str)
{
return str;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
int Process::eoi() int Process::eoi()
{ {
*this << FBB::eoi; eoi_(); // *this << FBB::eoi;
return exitStatus(); return exitStatus();
} }
#include "process.ih"
void Process::eoi_()
{
if (active())
{
close();
d_data->d_exitStatus = waitForChild();
}
}
#define LIBRARY "process" #define LIBRARY "process"
#define AUXFLAGS "-pthread"
#define AUXFLAGS "-I../tmp -pthread"
#include "../icmconf" #include "../icmconf"
#include "process.ih"
Process &Process::operator<<(std::ostream &(*pf)(std::ostream &))
{
if (active())
{
if (pf != FBB::eoi)
static_cast<std::ostream &>(*this) << pf;
else
{
close();
d_data->d_exitStatus = waitForChild();
}
}
return *this;
}
...@@ -144,8 +144,6 @@ struct Process: private Fork, public IOStream, public ProcessEnums ...@@ -144,8 +144,6 @@ struct Process: private Fork, public IOStream, public ProcessEnums
template <typename Type> template <typename Type>
Process &operator<<(Type const &value); // opinsert.f Process &operator<<(Type const &value); // opinsert.f
Process &operator<<(std::ostream &(*pf)(std::ostream &));
template <typename Type> template <typename Type>
Process &operator>>(Type &value); // opextract.f Process &operator>>(Type &value); // opextract.f
...@@ -187,6 +185,8 @@ struct Process: private Fork, public IOStream, public ProcessEnums ...@@ -187,6 +185,8 @@ struct Process: private Fork, public IOStream, public ProcessEnums
void parentProcess() override; void parentProcess() override;
void parentRedirections() override; void parentRedirections() override;
void eoi_() override;
void newPipe(Pipe &pipe); void newPipe(Pipe &pipe);
pid_t discontinue(RetPid &proc); pid_t discontinue(RetPid &proc);
ChildOutput whichStream(); ChildOutput whichStream();
...@@ -210,7 +210,6 @@ struct Process: private Fork, public IOStream, public ProcessEnums ...@@ -210,7 +210,6 @@ struct Process: private Fork, public IOStream, public ProcessEnums
}; };
#include "childoutstream.f" #include "childoutstream.f"
#include "eoi.f"
#include "iomode.f" #include "iomode.f"
#include "opaddis.f" #include "opaddis.f"
#include "opextract.f" #include "opextract.f"
......
D: programs in Debian D: programs in Debian
d: programs planned for Debian d: local debian package
(): programs not maintained by me (): programs not maintained by me
X: not actively maintained anymore X: not actively maintained anymore
...@@ -12,33 +12,30 @@ X: not actively maintained anymore ...@@ -12,33 +12,30 @@ X: not actively maintained anymore
natlog D updated natlog D updated
oxref D oxref D
ssh-cron D updated ssh-cron D updated
stealth D updated stealth D updated
xd D updated xd D updated
cidr cidr
countrymil countrymil d
edu/mailhandler edu/mailhandler
git/cursist/* git/cursist/cursist
imgx git/cursist/ids
ip2country imgx
logconvert ip2country
logconvert
nk nk
oostum/* oostum/*
pause updated pause updated
returned
returned soham WIP, can't check yet
spamgrep spamgrep
syslog syslog
wifi wifi
xpointer xpointer
xrun xrun
zp zp
3ppq/support updated 3ppq/recomp -f
3ppq/form updated (support updated, form updated)
3ppq/fsplot
3ppq/psychrm
3ppq/psychrecords
---------------------------------- ----------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment