|
From: Daniel K. O. <dan...@ya...> - 2002-04-04 03:11:48
|
Hello again people
Now I'm having problems with a small program, originally written for
GNU/Linux. It uses some headers that are not present on Dev-C++, and I never
used Linux here on my machine (lack of disk space); maybe the biggest
problem is that I don't even know what's written on those headers, so I have
no idea of what I need to substitute.
(The questions are numbered)
1)) Then here goes my first question: there is a online database/port of
linux's headers (with also some documentation or explanation, not just the
source code)?
And now some doubts:
2)) Look to this error:
"144 callbacks.c
warning: passing arg 2 of `create_dir_browser' discards qualifiers from
pointer target type"
Here is the code:
///
/* Function prototype */
GtkWidget *create_dir_browser(gchar * title, gchar * current_path,
GtkSelectionMode mode, void (*handler) (gchar *));
124: void on_dir_select29(gchar * dir);
...
141: GtkWidget *win;
142:
143: win = create_dir_browser(_("Select Directory"), g_get_home_dir(),
144: GTK_SELECTION_SINGLE, on_dir_select29);
///
I get this error in many other points too. I have no idea of what to do
(what does the "void (*handler) (gchar *)" mean?).
3)) The following error:
3771 global.c
`SIGPIPE' undeclared (first use in this function)
///
3771: signal(SIGPIPE, sigpipe_handler);
///
I couldn't find this constant (should be in "signal.h"?). What do I use
instead?
4)) Other error:
1252 commands.c
storage size of `uts' isn't known
///
1252: struct utsname uts;
///
I think that utsname is defined in sys/utsname.h, but where is utsname.h?
There is an equivalent? (What is utsname.h for anyways?)
Questions 5 and 6 are about these lines:
///
382: fcntl(sock, F_SETFL, O_NONBLOCK);
383: res = connect(sock, (struct sockaddr *) &server, sizeof(server));
384:
385: if ((res == 0) || (errno == EINPROGRESS)) return 1;
386: else return 0;
///
5)) Two errors in the same line:
382 connection.c
`F_SETFL' undeclared (first use in this function)
and
382 connection.c
`O_NONBLOCK' undeclared (first use in this function)
I think O_NONBLOCK should be in fcntl.h. The F_SETFL I have no idea though.
6)) Two similar errors (from socket.h/winsock.h, I think):
385 connection.c
`EINPROGRESS' undeclared (first use in this function)
and
465 connection.c
`EWOULDBLOCK' undeclared (first use in this function)
///
465: if (errno != EWOULDBLOCK) {
///
Are EINPROGRESS and EWOULDBLOCK equivalent to WSAEINPROGRESS and
WSAEWOULDBLOCK? Can I substitute them without problems?
7))
96 exec.c
`WNOHANG' undeclared (first use in this function)
///
96: waitpid(exec->pid, &status, WNOHANG);
///
8))
220 exec.c
`SIGKILL' undeclared (first use in this function)
///
217: client_message(NULL, _("Killing process.."));
218: kill(exec->pid, SIGTERM);
219: sleep(2);
220: kill(exec->pid, SIGKILL);
///
Should SIGKILL be in signal.h like SIGTERM? Can I use something like SIGABRT
instead?
9)) Those errors:
291 md5.c
`PROT_READ' undeclared (first use in this function)
291 md5.c
`MAP_PRIVATE' undeclared (first use in this function)
291 md5.c
`MAP_FAILED' undeclared (first use in this function)
///
291: if ((m = mmap((void *) 0, size, PROT_READ, MAP_PRIVATE, fd, 0)) !=
MAP_FAILED)
///
Probably the problem is this header, that doesn't exist in Dev-C++, right?
#include <sys/mman.h> /* for mmap() */
What can I do? There's an equivalent header?
10)) This program uses also these headers:
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
What should I use in windows (besides winsock.h?)?
Well, thanks for any help. If anyone interested, I can send the full source
code (about 2MB).
Daniel K. O.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|