Author: jgg
Date: 1998-11-03 01:39:43 GMT
Method test program
# Bring in the default rules
include ../buildlib/defaults.mak
+# Program for testing methods
+PROGRAM=mthdcat
+SLIBS =
+SOURCE = mthdcat.cc
+include $(PROGRAM_H)
+
# Scratch program to test incomplete code fragments in
PROGRAM=scratch-test
SLIBS = -lapt-pkg
--- /dev/null
+/* Usage, mthdcat < cmds | methods/mthd
+ All this does is cat a file into the method without closing the FD when
+ the file ends */
+
+#include <unistd.h>
+
+int main()
+{
+ char Buffer[4096];
+
+ while (1)
+ {
+ int Res = read(STDIN_FILENO,Buffer,sizeof(Buffer));
+ if (Res <= 0)
+ while (1) sleep(100);
+ if (write(STDOUT_FILENO,Buffer,Res) != Res)
+ break;
+ }
+ return 0;
+}