24 |
#ifndef PIPELINE_H |
#ifndef PIPELINE_H |
25 |
#define PIPELINE_H |
#define PIPELINE_H |
26 |
|
|
27 |
|
#include <stdio.h> |
28 |
#include <stdarg.h> |
#include <stdarg.h> |
29 |
#include <sys/types.h> |
#include <sys/types.h> |
30 |
|
|
53 |
|
|
54 |
/* See above. The caller should consider these read-only. */ |
/* See above. The caller should consider these read-only. */ |
55 |
int infd, outfd; |
int infd, outfd; |
56 |
|
|
57 |
|
/* Set by pipeline_get_infile() and pipeline_get_outfile() |
58 |
|
* respectively. |
59 |
|
*/ |
60 |
|
FILE *infile, *outfile; |
61 |
} pipeline; |
} pipeline; |
62 |
|
|
63 |
/* Construct a new command. */ |
/* Construct a new command. */ |
132 |
void pipeline_commandv (pipeline *p, va_list cmdv); |
void pipeline_commandv (pipeline *p, va_list cmdv); |
133 |
void pipeline_commands (pipeline *p, ...); |
void pipeline_commands (pipeline *p, ...); |
134 |
|
|
135 |
|
/* Get streams corresponding to infd and outfd respectively. The pipeline |
136 |
|
* must be started. |
137 |
|
*/ |
138 |
|
FILE *pipeline_get_infile (pipeline *p); |
139 |
|
FILE *pipeline_get_outfile (pipeline *p); |
140 |
|
|
141 |
/* Start the processes in a pipeline. Calls error(FATAL) on error. */ |
/* Start the processes in a pipeline. Calls error(FATAL) on error. */ |
142 |
void pipeline_start (pipeline *p); |
void pipeline_start (pipeline *p); |
143 |
|
|