[DGD]Problem with patching net package
E. Harte
harte at xs4all.nl
Wed Apr 21 14:44:43 CEST 1999
On 21 Apr 1999, Andreas Faerber wrote:
> Hi there,
>
[...]
> #ifdef OPEN_CONNECTED_HOSTS_ONLY
> for(i = nusers; i--;) {
> c = users[i]->conn;
> message("%s\n", users[i]->conn->host);
> }
> #endif
> conn = conn_connect(host, port, protocol);
>
> The #ifdef'd part is the part i added. The compile error i get is the
> following:
>
> comm.net.c: In function `comm_connect':
> comm.net.c:307: dereferencing pointer to incomplete type
The errors is because the 'host' element of the 'conn' structure is not
defined in dgd/src/comm.net.c but in dgd/src/host/*/connect.net.c, as far
as comm.net.c is concerned conn is just a pointer to some interesting
information, but it has no interest in the details.
How you solve that is your concern ;-)
Something else you'll want to think about though is that inside the for
loop you'll have to make sure you're not dereferencing NULL-pointers or
dealing with port-objects:
for (i = 0; i < nusers; i++) {
if (!users[i] || users[i]->flags & CF_PORT) {
/* Skip NULL pointers and port-objects */
continue;
}
/* ... fill in blanks ... */
}
Hope that helps,
Erwin.
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list