-rw-r--r-- | libopie/oprocess.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/libopie/oprocess.h b/libopie/oprocess.h index f2853b0..af7cddb 100644 --- a/libopie/oprocess.h +++ b/libopie/oprocess.h | |||
@@ -117,390 +117,384 @@ class OProcessPrivate; | |||
117 | *Returns false if you try to close stdin for a process that has been started | 117 | *Returns false if you try to close stdin for a process that has been started |
118 | *without a communication channel to stdin. | 118 | *without a communication channel to stdin. |
119 | * | 119 | * |
120 | *@li bool @ref closeStdout(); | 120 | *@li bool @ref closeStdout(); |
121 | *@li -- Closes the child process's stdout. | 121 | *@li -- Closes the child process's stdout. |
122 | *Returns false if you try to close stdout for a process that has been started | 122 | *Returns false if you try to close stdout for a process that has been started |
123 | *without a communication channel to stdout. | 123 | *without a communication channel to stdout. |
124 | * | 124 | * |
125 | *@li bool @ref closeStderr(); | 125 | *@li bool @ref closeStderr(); |
126 | *@li -- Closes the child process's stderr. | 126 | *@li -- Closes the child process's stderr. |
127 | *Returns false if you try to close stderr for a process that has been started | 127 | *Returns false if you try to close stderr for a process that has been started |
128 | *without a communication channel to stderr. | 128 | *without a communication channel to stderr. |
129 | * | 129 | * |
130 | * | 130 | * |
131 | *@sect QT signals: | 131 | *@sect QT signals: |
132 | * | 132 | * |
133 | *@li void @ref receivedStdout(OProcess *proc, char *buffer, int buflen); | 133 | *@li void @ref receivedStdout(OProcess *proc, char *buffer, int buflen); |
134 | *@li void @ref receivedStderr(OProcess *proc, char *buffer, int buflen); | 134 | *@li void @ref receivedStderr(OProcess *proc, char *buffer, int buflen); |
135 | *@li -- Indicates that new data has arrived from either the | 135 | *@li -- Indicates that new data has arrived from either the |
136 | *child process's stdout or stderr. | 136 | *child process's stdout or stderr. |
137 | * | 137 | * |
138 | *@li void @ref wroteStdin(OProcess *proc); | 138 | *@li void @ref wroteStdin(OProcess *proc); |
139 | *@li -- Indicates that all data that has been sent to the child process | 139 | *@li -- Indicates that all data that has been sent to the child process |
140 | *by a prior call to @ref writeStdin() has actually been transmitted to the | 140 | *by a prior call to @ref writeStdin() has actually been transmitted to the |
141 | *client . | 141 | *client . |
142 | * | 142 | * |
143 | *@author Christian Czezakte e9025461@student.tuwien.ac.at | 143 | *@author Christian Czezakte e9025461@student.tuwien.ac.at |
144 | * | 144 | * |
145 | * | 145 | * |
146 | **/ | 146 | **/ |
147 | class OProcess : public QObject | 147 | class OProcess : public QObject |
148 | { | 148 | { |
149 | Q_OBJECT | 149 | Q_OBJECT |
150 | 150 | ||
151 | public: | 151 | public: |
152 | 152 | ||
153 | /** | 153 | /** |
154 | * Modes in which the communication channel can be opened. | 154 | * Modes in which the communication channel can be opened. |
155 | * | 155 | * |
156 | * If communication for more than one channel is required, | 156 | * If communication for more than one channel is required, |
157 | * the values have to be or'ed together, for example to get | 157 | * the values have to be or'ed together, for example to get |
158 | * communication with stdout as well as with stdin, you would | 158 | * communication with stdout as well as with stdin, you would |
159 | * specify @p Stdin @p | @p Stdout | 159 | * specify @p Stdin @p | @p Stdout |
160 | * | 160 | * |
161 | * If @p NoRead is specified in conjunction with @p Stdout, | 161 | * If @p NoRead is specified in conjunction with @p Stdout, |
162 | * no data is actually read from @p Stdout but only | 162 | * no data is actually read from @p Stdout but only |
163 | * the signal @ref childOutput(int fd) is emitted. | 163 | * the signal @ref childOutput(int fd) is emitted. |
164 | */ | 164 | */ |
165 | enum Communication { NoCommunication = 0, Stdin = 1, Stdout = 2, Stderr = 4, | 165 | enum Communication { NoCommunication = 0, Stdin = 1, Stdout = 2, Stderr = 4, |
166 | AllOutput = 6, All = 7, | 166 | AllOutput = 6, All = 7, |
167 | NoRead }; | 167 | NoRead }; |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * Run-modes for a child process. | 170 | * Run-modes for a child process. |
171 | */ | 171 | */ |
172 | enum RunMode { | 172 | enum RunMode { |
173 | /** | 173 | /** |
174 | * The application does not receive notifications from the subprocess when | 174 | * The application does not receive notifications from the subprocess when |
175 | * it is finished or aborted. | 175 | * it is finished or aborted. |
176 | */ | 176 | */ |
177 | DontCare, | 177 | DontCare, |
178 | /** | 178 | /** |
179 | * The application is notified when the subprocess dies. | 179 | * The application is notified when the subprocess dies. |
180 | */ | 180 | */ |
181 | NotifyOnExit, | 181 | NotifyOnExit, |
182 | /** | 182 | /** |
183 | * The application is suspended until the started process is finished. | 183 | * The application is suspended until the started process is finished. |
184 | */ | 184 | */ |
185 | Block }; | 185 | Block }; |
186 | 186 | ||
187 | /** | 187 | /** |
188 | * Constructor | 188 | * Constructor |
189 | */ | 189 | */ |
190 | OProcess(QObject *parent = 0, const char *name = 0); | 190 | OProcess(QObject *parent = 0, const char *name = 0); |
191 | /** | 191 | /** |
192 | * Constructor | 192 | * Constructor |
193 | */ | 193 | */ |
194 | OProcess(const QString &arg0, QObject *parent = 0, const char *name = 0); | 194 | OProcess(const QString &arg0, QObject *parent = 0, const char *name = 0); |
195 | /** | 195 | /** |
196 | * Constructor | 196 | * Constructor |
197 | */ | 197 | */ |
198 | OProcess(const QStringList &args, QObject *parent = 0, const char *name = 0); | 198 | OProcess(const QStringList &args, QObject *parent = 0, const char *name = 0); |
199 | 199 | ||
200 | /** | 200 | /** |
201 | *Destructor: | 201 | *Destructor: |
202 | * | 202 | * |
203 | * If the process is running when the destructor for this class | 203 | * If the process is running when the destructor for this class |
204 | * is called, the child process is killed with a SIGKILL, but | 204 | * is called, the child process is killed with a SIGKILL, but |
205 | * only if the run mode is not of type @p DontCare. | 205 | * only if the run mode is not of type @p DontCare. |
206 | * Processes started as @p DontCare keep running anyway. | 206 | * Processes started as @p DontCare keep running anyway. |
207 | */ | 207 | */ |
208 | virtual ~OProcess(); | 208 | virtual ~OProcess(); |
209 | 209 | ||
210 | /** | 210 | /** |
211 | @deprecated | 211 | @deprecated |
212 | 212 | ||
213 | The use of this function is now deprecated. -- Please use the | 213 | The use of this function is now deprecated. -- Please use the |
214 | "operator<<" instead of "setExecutable". | 214 | "operator<<" instead of "setExecutable". |
215 | 215 | ||
216 | Sets the executable to be started with this OProcess object. | 216 | Sets the executable to be started with this OProcess object. |
217 | Returns false if the process is currently running (in that | 217 | Returns false if the process is currently running (in that |
218 | case the executable remains unchanged.) | 218 | case the executable remains unchanged.) |
219 | 219 | ||
220 | @see operator<< | 220 | @see operator<< |
221 | 221 | ||
222 | */ | 222 | */ |
223 | bool setExecutable(const QString& proc); | 223 | bool setExecutable(const QString& proc); |
224 | 224 | ||
225 | 225 | ||
226 | /** | 226 | /** |
227 | * Sets the executable and the command line argument list for this process. | 227 | * Sets the executable and the command line argument list for this process. |
228 | * | 228 | * |
229 | * For example, doing an "ls -l /usr/local/bin" can be achieved by: | 229 | * For example, doing an "ls -l /usr/local/bin" can be achieved by: |
230 | * <pre> | 230 | * <pre> |
231 | * OProcess p; | 231 | * OProcess p; |
232 | * ... | 232 | * ... |
233 | * p << "ls" << "-l" << "/usr/local/bin" | 233 | * p << "ls" << "-l" << "/usr/local/bin" |
234 | * </pre> | 234 | * </pre> |
235 | * | 235 | * |
236 | **/ | 236 | **/ |
237 | OProcess &operator<<(const QString& arg); | 237 | OProcess &operator<<(const QString& arg); |
238 | /** | 238 | /** |
239 | * Similar to previous method, takes a char *, supposed to be in locale 8 bit already. | 239 | * Similar to previous method, takes a char *, supposed to be in locale 8 bit already. |
240 | */ | 240 | */ |
241 | OProcess &operator<<(const char * arg); | 241 | OProcess &operator<<(const char * arg); |
242 | /** | 242 | /** |
243 | * Similar to previous method, takes a QCString, supposed to be in locale 8 bit already. | 243 | * Similar to previous method, takes a QCString, supposed to be in locale 8 bit already. |
244 | */ | 244 | */ |
245 | OProcess &operator<<(const QCString & arg); | 245 | OProcess &operator<<(const QCString & arg); |
246 | 246 | ||
247 | /** | 247 | /** |
248 | * Sets the executable and the command line argument list for this process, | 248 | * Sets the executable and the command line argument list for this process, |
249 | * in a single method call, or add a list of arguments. | 249 | * in a single method call, or add a list of arguments. |
250 | **/ | 250 | **/ |
251 | OProcess &operator<<(const QStringList& args); | 251 | OProcess &operator<<(const QStringList& args); |
252 | 252 | ||
253 | /** | 253 | /** |
254 | * Clear a command line argument list that has been set by using | 254 | * Clear a command line argument list that has been set by using |
255 | * the "operator<<". | 255 | * the "operator<<". |
256 | */ | 256 | */ |
257 | void clearArguments(); | 257 | void clearArguments(); |
258 | 258 | ||
259 | /** | 259 | /** |
260 | * Starts the process. | 260 | * Starts the process. |
261 | * For a detailed description of the | 261 | * For a detailed description of the |
262 | * various run modes and communication semantics, have a look at the | 262 | * various run modes and communication semantics, have a look at the |
263 | * general description of the OProcess class. | 263 | * general description of the OProcess class. |
264 | * | 264 | * |
265 | * The following problems could cause this function to | 265 | * The following problems could cause this function to |
266 | * return false: | 266 | * return false: |
267 | * | 267 | * |
268 | * @li The process is already running. | 268 | * @li The process is already running. |
269 | * @li The command line argument list is empty. | 269 | * @li The command line argument list is empty. |
270 | * @li The starting of the process failed (could not fork). | 270 | * @li The starting of the process failed (could not fork). |
271 | * @li The executable was not found. | 271 | * @li The executable was not found. |
272 | * | 272 | * |
273 | * @param comm Specifies which communication links should be | 273 | * @param comm Specifies which communication links should be |
274 | * established to the child process (stdin/stdout/stderr). By default, | 274 | * established to the child process (stdin/stdout/stderr). By default, |
275 | * no communication takes place and the respective communication | 275 | * no communication takes place and the respective communication |
276 | * signals will never get emitted. | 276 | * signals will never get emitted. |
277 | * | 277 | * |
278 | * @return true on success, false on error | 278 | * @return true on success, false on error |
279 | * (see above for error conditions) | 279 | * (see above for error conditions) |
280 | **/ | 280 | **/ |
281 | virtual bool start(RunMode runmode = NotifyOnExit, | 281 | virtual bool start(RunMode runmode = NotifyOnExit, |
282 | Communication comm = NoCommunication); | 282 | Communication comm = NoCommunication); |
283 | 283 | ||
284 | /** | 284 | /** |
285 | * Stop the process (by sending it a signal). | 285 | * Stop the process (by sending it a signal). |
286 | * | 286 | * |
287 | * @param signoThe signal to send. The default is SIGTERM. | 287 | * @param signoThe signal to send. The default is SIGTERM. |
288 | * @return @p true if the signal was delivered successfully. | 288 | * @return @p true if the signal was delivered successfully. |
289 | */ | 289 | */ |
290 | virtual bool kill(int signo = SIGTERM); | 290 | virtual bool kill(int signo = SIGTERM); |
291 | 291 | ||
292 | /** | 292 | /** |
293 | @return @p true if the process is (still) considered to be running | 293 | @return @p true if the process is (still) considered to be running |
294 | */ | 294 | */ |
295 | bool isRunning() const; | 295 | bool isRunning() const; |
296 | 296 | ||
297 | /** Returns the process id of the process. | 297 | /** Returns the process id of the process. |
298 | * | 298 | * |
299 | * If it is called after | 299 | * If it is called after |
300 | * the process has exited, it returns the process id of the last | 300 | * the process has exited, it returns the process id of the last |
301 | * child process that was created by this instance of OProcess. | 301 | * child process that was created by this instance of OProcess. |
302 | * | 302 | * |
303 | * Calling it before any child process has been started by this | 303 | * Calling it before any child process has been started by this |
304 | * OProcess instance causes pid() to return 0. | 304 | * OProcess instance causes pid() to return 0. |
305 | **/ | 305 | **/ |
306 | pid_t pid() const; | 306 | pid_t pid() const; |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * Use pid(). | ||
310 | * @deprecated | ||
311 | */ | ||
312 | pid_t getPid() const { return pid(); } | ||
313 | |||
314 | /** | ||
315 | * Suspend processing of data from stdout of the child process. | 309 | * Suspend processing of data from stdout of the child process. |
316 | */ | 310 | */ |
317 | void suspend(); | 311 | void suspend(); |
318 | 312 | ||
319 | /** | 313 | /** |
320 | * Resume processing of data from stdout of the child process. | 314 | * Resume processing of data from stdout of the child process. |
321 | */ | 315 | */ |
322 | void resume(); | 316 | void resume(); |
323 | 317 | ||
324 | /** | 318 | /** |
325 | * @return @p true if the process has already finished and has exited | 319 | * @return @p true if the process has already finished and has exited |
326 | * "voluntarily", ie: it has not been killed by a signal. | 320 | * "voluntarily", ie: it has not been killed by a signal. |
327 | * | 321 | * |
328 | * Note that you should check @ref OProcess::exitStatus() to determine | 322 | * Note that you should check @ref OProcess::exitStatus() to determine |
329 | * whether the process completed its task successful or not. | 323 | * whether the process completed its task successful or not. |
330 | */ | 324 | */ |
331 | bool normalExit() const; | 325 | bool normalExit() const; |
332 | 326 | ||
333 | /** | 327 | /** |
334 | * Returns the exit status of the process. | 328 | * Returns the exit status of the process. |
335 | * | 329 | * |
336 | * Please use | 330 | * Please use |
337 | * @ref OProcess::normalExit() to check whether the process has exited | 331 | * @ref OProcess::normalExit() to check whether the process has exited |
338 | * cleanly (i.e., @ref OProcess::normalExit() returns @p true) before calling | 332 | * cleanly (i.e., @ref OProcess::normalExit() returns @p true) before calling |
339 | * this function because if the process did not exit normally, | 333 | * this function because if the process did not exit normally, |
340 | * it does not have a valid exit status. | 334 | * it does not have a valid exit status. |
341 | */ | 335 | */ |
342 | int exitStatus() const; | 336 | int exitStatus() const; |
343 | 337 | ||
344 | 338 | ||
345 | /** | 339 | /** |
346 | * Transmit data to the child process's stdin. | 340 | * Transmit data to the child process's stdin. |
347 | * | 341 | * |
348 | * OProcess::writeStdin may return false in the following cases: | 342 | * OProcess::writeStdin may return false in the following cases: |
349 | * | 343 | * |
350 | * @li The process is not currently running. | 344 | * @li The process is not currently running. |
351 | * | 345 | * |
352 | * @li Communication to stdin has not been requested in the @ref start() call. | 346 | * @li Communication to stdin has not been requested in the @ref start() call. |
353 | * | 347 | * |
354 | * @li Transmission of data to the child process by a previous call to | 348 | * @li Transmission of data to the child process by a previous call to |
355 | * @ref writeStdin() is still in progress. | 349 | * @ref writeStdin() is still in progress. |
356 | * | 350 | * |
357 | * Please note that the data is sent to the client asynchronously, | 351 | * Please note that the data is sent to the client asynchronously, |
358 | * so when this function returns, the data might not have been | 352 | * so when this function returns, the data might not have been |
359 | * processed by the child process. | 353 | * processed by the child process. |
360 | * | 354 | * |
361 | * If all the data has been sent to the client, the signal | 355 | * If all the data has been sent to the client, the signal |
362 | * @ref wroteStdin() will be emitted. | 356 | * @ref wroteStdin() will be emitted. |
363 | * | 357 | * |
364 | * Please note that you must not free "buffer" or call @ref writeStdin() | 358 | * Please note that you must not free "buffer" or call @ref writeStdin() |
365 | * again until either a @ref wroteStdin() signal indicates that the | 359 | * again until either a @ref wroteStdin() signal indicates that the |
366 | * data has been sent or a @ref processHasExited() signal shows that | 360 | * data has been sent or a @ref processHasExited() signal shows that |
367 | * the child process is no longer alive... | 361 | * the child process is no longer alive... |
368 | **/ | 362 | **/ |
369 | bool writeStdin(const char *buffer, int buflen); | 363 | bool writeStdin(const char *buffer, int buflen); |
370 | 364 | ||
371 | void flushStdin(); | 365 | void flushStdin(); |
372 | 366 | ||
373 | /** | 367 | /** |
374 | * This causes the stdin file descriptor of the child process to be | 368 | * This causes the stdin file descriptor of the child process to be |
375 | * closed indicating an "EOF" to the child. | 369 | * closed indicating an "EOF" to the child. |
376 | * | 370 | * |
377 | * @return @p false if no communication to the process's stdin | 371 | * @return @p false if no communication to the process's stdin |
378 | * had been specified in the call to @ref start(). | 372 | * had been specified in the call to @ref start(). |
379 | */ | 373 | */ |
380 | bool closeStdin(); | 374 | bool closeStdin(); |
381 | 375 | ||
382 | /** | 376 | /** |
383 | * This causes the stdout file descriptor of the child process to be | 377 | * This causes the stdout file descriptor of the child process to be |
384 | * closed. | 378 | * closed. |
385 | * | 379 | * |
386 | * @return @p false if no communication to the process's stdout | 380 | * @return @p false if no communication to the process's stdout |
387 | * had been specified in the call to @ref start(). | 381 | * had been specified in the call to @ref start(). |
388 | */ | 382 | */ |
389 | bool closeStdout(); | 383 | bool closeStdout(); |
390 | 384 | ||
391 | /** | 385 | /** |
392 | * This causes the stderr file descriptor of the child process to be | 386 | * This causes the stderr file descriptor of the child process to be |
393 | * closed. | 387 | * closed. |
394 | * | 388 | * |
395 | * @return @p false if no communication to the process's stderr | 389 | * @return @p false if no communication to the process's stderr |
396 | * had been specified in the call to @ref start(). | 390 | * had been specified in the call to @ref start(). |
397 | */ | 391 | */ |
398 | bool closeStderr(); | 392 | bool closeStderr(); |
399 | 393 | ||
400 | /** | 394 | /** |
401 | * Lets you see what your arguments are for debugging. | 395 | * Lets you see what your arguments are for debugging. |
402 | */ | 396 | */ |
403 | 397 | ||
404 | const QValueList<QCString> &args() { return arguments; } | 398 | const QValueList<QCString> &args() { return arguments; } |
405 | 399 | ||
406 | /** | 400 | /** |
407 | * Controls whether the started process should drop any | 401 | * Controls whether the started process should drop any |
408 | * setuid/segid privileges or whether it should keep them | 402 | * setuid/segid privileges or whether it should keep them |
409 | * | 403 | * |
410 | * The default is @p false : drop privileges | 404 | * The default is @p false : drop privileges |
411 | */ | 405 | */ |
412 | void setRunPrivileged(bool keepPrivileges); | 406 | void setRunPrivileged(bool keepPrivileges); |
413 | 407 | ||
414 | /** | 408 | /** |
415 | * Returns whether the started process will drop any | 409 | * Returns whether the started process will drop any |
416 | * setuid/segid privileges or whether it will keep them | 410 | * setuid/segid privileges or whether it will keep them |
417 | */ | 411 | */ |
418 | bool runPrivileged() const; | 412 | bool runPrivileged() const; |
419 | 413 | ||
420 | /** | 414 | /** |
421 | * Modifies the environment of the process to be started. | 415 | * Modifies the environment of the process to be started. |
422 | * This function must be called before starting the process. | 416 | * This function must be called before starting the process. |
423 | */ | 417 | */ |
424 | void setEnvironment(const QString &name, const QString &value); | 418 | void setEnvironment(const QString &name, const QString &value); |
425 | 419 | ||
426 | /** | 420 | /** |
427 | * Changes the current working directory (CWD) of the process | 421 | * Changes the current working directory (CWD) of the process |
428 | * to be started. | 422 | * to be started. |
429 | * This function must be called before starting the process. | 423 | * This function must be called before starting the process. |
430 | */ | 424 | */ |
431 | void setWorkingDirectory(const QString &dir); | 425 | void setWorkingDirectory(const QString &dir); |
432 | 426 | ||
433 | /** | 427 | /** |
434 | * Specify whether to start the command via a shell or directly. | 428 | * Specify whether to start the command via a shell or directly. |
435 | * The default is to start the command directly. | 429 | * The default is to start the command directly. |
436 | * If @p useShell is true @p shell will be used as shell, or | 430 | * If @p useShell is true @p shell will be used as shell, or |
437 | * if shell is empty, the standard shell is used. | 431 | * if shell is empty, the standard shell is used. |
438 | * @p quote A flag indicating whether to quote the arguments. | 432 | * @p quote A flag indicating whether to quote the arguments. |
439 | * | 433 | * |
440 | * When using a shell, the caller should make sure that all filenames etc. | 434 | * When using a shell, the caller should make sure that all filenames etc. |
441 | * are properly quoted when passed as argument. | 435 | * are properly quoted when passed as argument. |
442 | * @see quote() | 436 | * @see quote() |
443 | */ | 437 | */ |
444 | void setUseShell(bool useShell, const char *shell = 0); | 438 | void setUseShell(bool useShell, const char *shell = 0); |
445 | 439 | ||
446 | /** | 440 | /** |
447 | * This function can be used to quote an argument string such that | 441 | * This function can be used to quote an argument string such that |
448 | * the shell processes it properly. This is e. g. necessary for | 442 | * the shell processes it properly. This is e. g. necessary for |
449 | * user-provided file names which may contain spaces or quotes. | 443 | * user-provided file names which may contain spaces or quotes. |
450 | * It also prevents expansion of wild cards and environment variables. | 444 | * It also prevents expansion of wild cards and environment variables. |
451 | */ | 445 | */ |
452 | static QString quote(const QString &arg); | 446 | static QString quote(const QString &arg); |
453 | 447 | ||
454 | /** | 448 | /** |
455 | * Detaches OProcess from child process. All communication is closed. | 449 | * Detaches OProcess from child process. All communication is closed. |
456 | * No exit notification is emitted any more for the child process. | 450 | * No exit notification is emitted any more for the child process. |
457 | * Deleting the OProcess will no longer kill the child process. | 451 | * Deleting the OProcess will no longer kill the child process. |
458 | * Note that the current process remains the parent process of the | 452 | * Note that the current process remains the parent process of the |
459 | * child process. | 453 | * child process. |
460 | */ | 454 | */ |
461 | void detach(); | 455 | void detach(); |
462 | 456 | ||
463 | 457 | ||
464 | 458 | ||
465 | signals: | 459 | signals: |
466 | 460 | ||
467 | /** | 461 | /** |
468 | * Emitted after the process has terminated when | 462 | * Emitted after the process has terminated when |
469 | * the process was run in the @p NotifyOnExit (==default option to | 463 | * the process was run in the @p NotifyOnExit (==default option to |
470 | * @ref start()) or the @ref Block mode. | 464 | * @ref start()) or the @ref Block mode. |
471 | **/ | 465 | **/ |
472 | void processExited(OProcess *proc); | 466 | void processExited(OProcess *proc); |
473 | 467 | ||
474 | 468 | ||
475 | /** | 469 | /** |
476 | * Emitted, when output from the child process has | 470 | * Emitted, when output from the child process has |
477 | * been received on stdout. | 471 | * been received on stdout. |
478 | * | 472 | * |
479 | * To actually get | 473 | * To actually get |
480 | * these signals, the respective communication link (stdout/stderr) | 474 | * these signals, the respective communication link (stdout/stderr) |
481 | * has to be turned on in @ref start(). | 475 | * has to be turned on in @ref start(). |
482 | * | 476 | * |
483 | * @param buffer The data received. | 477 | * @param buffer The data received. |
484 | * @param buflen The number of bytes that are available. | 478 | * @param buflen The number of bytes that are available. |
485 | * | 479 | * |
486 | * You should copy the information contained in @p buffer to your private | 480 | * You should copy the information contained in @p buffer to your private |
487 | * data structures before returning from this slot. | 481 | * data structures before returning from this slot. |
488 | **/ | 482 | **/ |
489 | void receivedStdout(OProcess *proc, char *buffer, int buflen); | 483 | void receivedStdout(OProcess *proc, char *buffer, int buflen); |
490 | 484 | ||
491 | /** | 485 | /** |
492 | * Emitted when output from the child process has | 486 | * Emitted when output from the child process has |
493 | * been received on stdout. | 487 | * been received on stdout. |
494 | * | 488 | * |
495 | * To actually get these signals, the respective communications link | 489 | * To actually get these signals, the respective communications link |
496 | * (stdout/stderr) has to be turned on in @ref start() and the | 490 | * (stdout/stderr) has to be turned on in @ref start() and the |
497 | * @p NoRead flag should have been passed. | 491 | * @p NoRead flag should have been passed. |
498 | * | 492 | * |
499 | * You will need to explicitly call resume() after your call to start() | 493 | * You will need to explicitly call resume() after your call to start() |
500 | * to begin processing data from the child process's stdout. This is | 494 | * to begin processing data from the child process's stdout. This is |
501 | * to ensure that this signal is not emitted when no one is connected | 495 | * to ensure that this signal is not emitted when no one is connected |
502 | * to it, otherwise this signal will not be emitted. | 496 | * to it, otherwise this signal will not be emitted. |
503 | * | 497 | * |
504 | * The data still has to be read from file descriptor @p fd. | 498 | * The data still has to be read from file descriptor @p fd. |
505 | **/ | 499 | **/ |
506 | void receivedStdout(int fd, int &len); | 500 | void receivedStdout(int fd, int &len); |