projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sistemazione della bibliografia
[gapil.git]
/
sources
/
BarCodePage.c
diff --git
a/sources/BarCodePage.c
b/sources/BarCodePage.c
index ef48ce77bcd4d2d6c2fb43e7e9673d47b935fc08..419e9c0e1898ae9dacd460716dba303d9f70ce4d 100644
(file)
--- a/
sources/BarCodePage.c
+++ b/
sources/BarCodePage.c
@@
-1,4
+1,4
@@
-/* BarCode
Old
.c
+/* BarCode
Page
.c
*
* Copyright (C) 2002 Simone Piccardi
*
*
* Copyright (C) 2002 Simone Piccardi
*
@@
-29,7
+29,7
@@
* http://localhost/cgi-bin/barcode?string
* where string is the code to be converted
*
* http://localhost/cgi-bin/barcode?string
* where string is the code to be converted
*
- * $Id: BarCodePage.c,v 1.
1 2002/06/30 13:26:17
piccardi Exp $
+ * $Id: BarCodePage.c,v 1.
2 2002/08/10 14:22:53
piccardi Exp $
*
****************************************************************/
/*
*
****************************************************************/
/*
@@
-38,7
+38,6
@@
#include <sys/types.h> /* predefined types */
#include <sys/stat.h> /* stat deinitiions */
#include <unistd.h> /* include unix standard library */
#include <sys/types.h> /* predefined types */
#include <sys/stat.h> /* stat deinitiions */
#include <unistd.h> /* include unix standard library */
-/* */
#include <stdio.h> /* include standard I/O library */
#include <stdlib.h> /* include standard library */
#include <string.h> /* include string library */
#include <stdio.h> /* include standard I/O library */
#include <stdlib.h> /* include standard library */
#include <string.h> /* include string library */
@@
-50,7
+49,6
@@
#include"macros.h"
void WriteMess(char *mess);
#include"macros.h"
void WriteMess(char *mess);
-
/* Program begin */
int main(int argc, char *argv[], char *envp[])
{
/* Program begin */
int main(int argc, char *argv[], char *envp[])
{
@@
-66,7
+64,7
@@
int main(int argc, char *argv[], char *envp[])
/*
* Begin
*/
/*
* Begin
*/
- /* create two pipes
to handle process
communication */
+ /* create two pipes
, pipein and pipeout, to handle
communication */
if ( (retval = pipe(pipein)) ) {
WriteMess("input pipe creation error");
exit(0);
if ( (retval = pipe(pipein)) ) {
WriteMess("input pipe creation error");
exit(0);
@@
-75,11
+73,10
@@
int main(int argc, char *argv[], char *envp[])
WriteMess("output pipe creation error");
exit(0);
}
WriteMess("output pipe creation error");
exit(0);
}
- /* fork child to run barcode program */
- pid = fork();
- if (pid == -1) {
+ /* First fork: use child to run barcode program */
+ if ( (pid = fork()) == -1 ) {
WriteMess("child creation error");
WriteMess("child creation error");
- exit(0);
+ exit(0);
}
/* if child */
if (pid == 0) {
}
/* if child */
if (pid == 0) {
@@
-92,7
+89,7
@@
int main(int argc, char *argv[], char *envp[])
dup2(pipein[0], STDIN_FILENO); /* remap stdin in pipe input */
close(pipeout[0]);
dup2(pipeout[1], STDOUT_FILENO); /* remap stdout in pipe output */
dup2(pipein[0], STDIN_FILENO); /* remap stdin in pipe input */
close(pipeout[0]);
dup2(pipeout[1], STDOUT_FILENO); /* remap stdout in pipe output */
- execlp("barcode", "barcode", size, NULL);
//"-o", "-", NULL);
+ execlp("barcode", "barcode", size, NULL);
}
/*
* Parent write string to pipe input and close it,
}
/*
* Parent write string to pipe input and close it,
@@
-103,9
+100,8
@@
int main(int argc, char *argv[], char *envp[])
write(pipein[1], argv[1], strlen(argv[1]));
close(pipein[1]);
waitpid(pid, NULL, 0);
write(pipein[1], argv[1], strlen(argv[1]));
close(pipein[1]);
waitpid(pid, NULL, 0);
- /* Second fork use child to run ghostscript*/
- pid = fork();
- if (pid == -1) {
+ /* Second fork: use child to run ghostscript*/
+ if ( (pid = fork()) == -1) {
WriteMess("child creation error");
exit(0);
}
WriteMess("child creation error");
exit(0);
}