projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://se.aminet.net/pub/Linux/distributions/slackware/slackware-10.1/source/xap...
[xscreensaver]
/
hacks
/
sonar.c
diff --git
a/hacks/sonar.c
b/hacks/sonar.c
index a5005a7b860bbb61e9c3c86fd39f7adf31212ff0..b7ff0a5a8629eb8f02b0e73a3fc9759a8b80d4b4 100644
(file)
--- a/
hacks/sonar.c
+++ b/
hacks/sonar.c
@@
-38,7
+38,7
@@
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
- * $Revision: 1.3
2
$
+ * $Revision: 1.3
3
$
*
* Version 1.0 April 27, 1998.
* - Initial version
*
* Version 1.0 April 27, 1998.
* - Initial version
@@
-215,6
+215,7
@@
typedef struct {
} sonar_info;
static Bool debug_p = False;
} sonar_info;
static Bool debug_p = False;
+static Bool resolve_p = True;
/*
/*
@@
-314,6
+315,7
@@
char *defaults [] = {
"*teamBCount: 4",
"*ping: default",
"*teamBCount: 4",
"*ping: default",
+ "*resolve: true",
".debug: false",
0
};
".debug: false",
0
};
@@
-337,6
+339,7
@@
XrmOptionDescRec options [] = {
{"-team-b-count", ".teamBCount", XrmoptionSepArg, 0 },
{"-ping", ".ping", XrmoptionSepArg, 0 },
{"-team-b-count", ".teamBCount", XrmoptionSepArg, 0 },
{"-ping", ".ping", XrmoptionSepArg, 0 },
+ {"-no-dns", ".resolve", XrmoptionNoArg, "False" },
{"-debug", ".debug", XrmoptionNoArg, "True" },
{ 0, 0, 0, 0 }
};
{"-debug", ".debug", XrmoptionNoArg, "True" },
{ 0, 0, 0, 0 }
};
@@
-497,9
+500,12
@@
lookupHost(ping_target *target)
}
iaddr->sin_addr.s_addr = pack_addr (ip[0], ip[1], ip[2], ip[3]);
}
iaddr->sin_addr.s_addr = pack_addr (ip[0], ip[1], ip[2], ip[3]);
- hent = gethostbyaddr ((const char *) &iaddr->sin_addr.s_addr,
- sizeof(iaddr->sin_addr.s_addr),
- AF_INET);
+ if (resolve_p)
+ hent = gethostbyaddr ((const char *) &iaddr->sin_addr.s_addr,
+ sizeof(iaddr->sin_addr.s_addr),
+ AF_INET);
+ else
+ hent = 0;
if (debug_p > 1)
fprintf (stderr, "%s: %s => %s\n",
if (debug_p > 1)
fprintf (stderr, "%s: %s => %s\n",
@@
-1250,9
+1256,12
@@
getping(sonar_info *si, ping_info *pi)
struct sockaddr_in iaddr;
struct hostent *h;
iaddr.sin_addr.s_addr = pack_addr (iip[0],iip[1],iip[2],iip[3]);
struct sockaddr_in iaddr;
struct hostent *h;
iaddr.sin_addr.s_addr = pack_addr (iip[0],iip[1],iip[2],iip[3]);
- h = gethostbyaddr ((const char *) &iaddr.sin_addr.s_addr,
- sizeof(iaddr.sin_addr.s_addr),
- AF_INET);
+ if (resolve_p)
+ h = gethostbyaddr ((const char *) &iaddr.sin_addr.s_addr,
+ sizeof(iaddr.sin_addr.s_addr),
+ AF_INET);
+ else
+ h = 0;
if (h && h->h_name && *h->h_name)
{
if (h && h->h_name && *h->h_name)
{
@@
-2046,6
+2055,7
@@
screenhack(Display *dpy, Window win)
long sleeptime;
debug_p = get_boolean_resource ("debug", "Debug");
long sleeptime;
debug_p = get_boolean_resource ("debug", "Debug");
+ resolve_p = get_boolean_resource ("resolve", "Resolve");
sensor = 0;
# ifdef HAVE_PING
sensor = 0;
# ifdef HAVE_PING