6 #include <grass/dbmi.h>
7 #include <grass/form.h>
10 #include <sys/types.h>
15 #include <sys/socket.h>
16 #include <netinet/in.h>
22 static int make_socketpair(
int *);
43 int F_open(
char *title,
char *html)
58 static int p1[2], p2[2];
64 G_debug(2,
"F_open(): title = %s", title);
68 if (make_socketpair(pipefd) < 0)
71 if (pipe(p1) < 0 || pipe(p2) < 0)
75 if ((pid = fork()) < 0)
80 char command[2000], script[2000];
113 execl(command,
"form",
"-f", script,
NULL);
136 G_debug(2,
"PARENT HTML:\n%s\n", html);
139 length = strlen(title);
142 length = strlen(html);
146 G_debug(2,
"PARENT: Request sent\n");
150 G_debug(2,
"PARENT: received %c\n", c);
172 G_debug(2,
"PARENT: received %c\n", c);
187 G_debug(2,
"PARENT: received %c\n", c);
193 static int make_socketpair(
int *
fd)
197 if ((n = socketpair(AF_UNIX, SOCK_STREAM, IPPROTO_IP, fd)) < 0)
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int G_debug(int level, const char *msg,...)
Print debugging message.
char * G_gisbase(void)
top level module directory
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.