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)
must be a Process::IOMode value. The same applies to the function
call operator previously accespting a size_t argument.
- 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:
- expects a size_t seed (used to be: long seed);
......
......@@ -25,7 +25,7 @@ class DigestBuf: public EoiBuf
private:
int overflow(int c) override;
void eoi_(); // .cc
void eoi_() override; // .cc
};
#include "eoi.f"
......
......@@ -19,15 +19,15 @@ GPP="g++ --std=c++2a"
CMD="$GPP -o driver -Wall *.cc -L../tmp -lhmacbuf -L /tmp -lbob -lcrypto -s"
# Using the library in ../tmp/
# CMD="$GPP -o driver -Wall *.cc -L../tmp -lhmacbuf ${LIBS} -s"
# Using tmp libraries and bobcat
CMD="$GPP -o driver -Wall -I../tmp driver.cc \
-L../tmp -ldigestbuf \
-L../../ohexbuf/tmp -lohexbuf \
-L../../eoibuf/tmp -leoibuf \
-L../../eoi/tmp -leoi \
${LIBS} -s"
CMD="$GPP -o driver -Wall *.cc -L../tmp -ldigestbuf ${LIBS} -s"
# # Using tmp libraries and bobcat
# CMD="$GPP -o driver -Wall -I../tmp driver.cc \
# -L../tmp -ldigestbuf \
# -L../../ohexbuf/tmp -lohexbuf \
# -L../../eoibuf/tmp -leoibuf \
# -L../../eoi/tmp -leoi \
# ${LIBS} -s"
echo ${CMD}
${CMD}
......
#include "digestbuf.ih"
#include <iostream>
void DigestBuf::eoi_()
{
cerr << __FILE__"\n";
if (d_ctx == 0)
return;
......
......@@ -93,7 +93,7 @@ includefile(include/namespace)
manpagesection(INHERITS FROM)
bf(FBB::Fork)(3bobcat) (private), nl()
bf(FBB:IOStream)(3bobcat)
bf(FBB:IOStream)(3bobcat), and by implication: bf(FBB::Eoi), nl()
bf(FBB:ProcessEnums)
The tt(struct ProcessEnums) defines enumerations and support functions which
......@@ -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
tt(IOMode, ProcessType,) and time limit).
itb(Process &operator()(IOMode mode))
This operator changes the the tt(Process) object's tt(IOMode)
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
default value may be altered by a function call operator just before starting
the child process.
itb(std::istream &cerr())
This member should be avoided. Use tt(childErrStream) instead.nl()
itb(std::istream &childErrStream())
If tt(Process::CERR) was specified then this member interfaces
to the child's standard error stream. By extracting the information from
......
......@@ -2,12 +2,12 @@
#define INCLUDED_BOBCAT_IOBUF_
#include <fstream>
#include <streambuf>
#include <bobcat/eoi>
namespace FBB
{
class IOBuf: public std::streambuf
class IOBuf: public Eoi
{
char d_buf;
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 @@
int Process::eoi()
{
*this << FBB::eoi;
eoi_(); // *this << FBB::eoi;
return exitStatus();
}
#include "process.ih"
void Process::eoi_()
{
if (active())
{
close();
d_data->d_exitStatus = waitForChild();
}
}
#define LIBRARY "process"
#define AUXFLAGS "-pthread"
#define AUXFLAGS "-I../tmp -pthread"
#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
template <typename Type>
Process &operator<<(Type const &value); // opinsert.f
Process &operator<<(std::ostream &(*pf)(std::ostream &));
template <typename Type>
Process &operator>>(Type &value); // opextract.f
......@@ -187,6 +185,8 @@ struct Process: private Fork, public IOStream, public ProcessEnums
void parentProcess() override;
void parentRedirections() override;
void eoi_() override;
void newPipe(Pipe &pipe);
pid_t discontinue(RetPid &proc);
ChildOutput whichStream();
......@@ -210,7 +210,6 @@ struct Process: private Fork, public IOStream, public ProcessEnums
};
#include "childoutstream.f"
#include "eoi.f"
#include "iomode.f"
#include "opaddis.f"
#include "opextract.f"
......
D: programs in Debian
d: programs planned for Debian
d: local debian package
(): programs not maintained by me
X: not actively maintained anymore
......@@ -12,33 +12,30 @@ X: not actively maintained anymore
natlog D updated
oxref D
ssh-cron D updated
stealth D updated
xd D updated
stealth D updated
xd D updated
cidr
countrymil
edu/mailhandler
git/cursist/*
imgx
ip2country
logconvert
nk
oostum/*
pause updated
returned
spamgrep
syslog
wifi
xpointer
cidr
countrymil d
edu/mailhandler
git/cursist/cursist
git/cursist/ids
imgx
ip2country
logconvert
nk
oostum/*
pause updated
returned
soham WIP, can't check yet
spamgrep
syslog
wifi
xpointer
xrun
zp
3ppq/support updated
3ppq/form updated
3ppq/fsplot
3ppq/psychrm
3ppq/psychrecords
zp
3ppq/recomp -f
(support updated, form updated)
----------------------------------
......
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