1 int main(int argc, char *argv[], char *envp[])
9 "gs -sDEVICE=ppmraw -sOutputFile=- -sNOPAUSE -q - -c showpage -c quit"
11 char content[]="Content-type: image/png\n\n";
13 /* write mime-type to stdout */
14 write(STDOUT_FILENO, content, strlen(content));
15 /* execute chain of command */
17 pipe[i] = popen(cmd_string[i], "w");
18 dup2(fileno(pipe[i]), STDOUT_FILENO);
20 /* create barcode (in PS) */
21 pipein = popen("barcode", "w");
22 /* send barcode string to barcode program */
23 write(fileno(pipein), argv[1], strlen(argv[1]));
24 /* close all pipes (in reverse order) */
25 for (i=4; i==0; i--) {