fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kde3support / tests / k3processtest.h
blobcad7d97ce65fe7547b1a1b48e7915b3ce20354ee
1 //
2 // DUMMY -- A dummy class with a slot to demonstrate K3Process signals
3 //
4 // version 0.2, Aug 2nd 1997
5 //
6 // Copyright 1997 Christian Czezatke <e9025461@student.tuwien.ac.at>
7 //
10 #ifndef DUMMY_H
11 #define DUMMY_H
13 #include <stdio.h>
14 #include <QtCore/QObject>
15 #include "k3process.h"
17 class Dummy : public QObject
19 Q_OBJECT
21 public Q_SLOTS:
22 void printMessage(K3Process *proc)
24 printf("Process %d exited!\n", (int)proc->pid());
27 void gotOutput(K3Process*, char *buffer, int len)
29 char result[1025]; // this is ugly since it relys on the internal buffer size of K3Process,
30 memcpy(result, buffer, len); // NEVER do that in your own application... ;-)
31 result[len] = '\0';
32 printf("OUTPUT>>%s", result);
35 void outputDone(K3Process *proc)
37 Slot Procedure for the "sort" example. -- If it is indicated that the "sort" command has
38 absorbed all its input, we send an "EOF" to it to indicate that there is no more
39 data to be processed.
42 proc->closeStdin();
47 #endif