Add missing prototypes.

This commit is contained in:
Ralf Corsepius
2008-08-02 05:37:10 +00:00
parent a39e2ee6e4
commit 082d4a2879
10 changed files with 110 additions and 103 deletions

View File

@@ -119,9 +119,9 @@ int _dns_ttl_;
#ifdef DEBUG #ifdef DEBUG
static void static void
debugprintf(msg, num) debugprintf(
char *msg; char *msg,
int num; int num)
{ {
if (_res.options & RES_DEBUG) { if (_res.options & RES_DEBUG) {
int save = errno; int save = errno;
@@ -152,11 +152,11 @@ debugprintf(msg, num)
} while (0) } while (0)
static struct hostent * static struct hostent *
gethostanswer(answer, anslen, qname, qtype) gethostanswer(
const querybuf *answer; const querybuf *answer,
int anslen; int anslen,
const char *qname; const char *qname,
int qtype; int qtype)
{ {
const HEADER *hp; const HEADER *hp;
const u_char *cp; const u_char *cp;
@@ -472,9 +472,9 @@ __dns_getanswer(const char *answer, int anslen, const char *qname, int qtype)
} }
struct hostent * struct hostent *
_gethostbydnsname(name, af) _gethostbydnsname(
const char *name; const char *name,
int af; int af)
{ {
querybuf buf; querybuf buf;
register const char *cp; register const char *cp;
@@ -588,9 +588,10 @@ _gethostbydnsname(name, af)
} }
struct hostent * struct hostent *
_gethostbydnsaddr(addr, len, af) _gethostbydnsaddr(
const char *addr; /* XXX should have been def'd as u_char! */ const char *addr, /* XXX should have been def'd as u_char! */
int len, af; int len,
int af)
{ {
const u_char *uaddr = (const u_char *)addr; const u_char *uaddr = (const u_char *)addr;
static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff }; static const u_char mapped[] = { 0,0, 0,0, 0,0, 0,0, 0,0, 0xff,0xff };
@@ -711,9 +712,9 @@ _gethostbydnsaddr(addr, len, af)
#ifdef RESOLVSORT #ifdef RESOLVSORT
static void static void
addrsort(ap, num) addrsort(
char **ap; char **ap,
int num; int num)
{ {
int i, j; int i, j;
char **p; char **p;
@@ -764,7 +765,7 @@ _sethostdnsent(int stayopen)
} }
void void
_endhostdnsent() _endhostdnsent(void)
{ {
_res.options &= ~(RES_STAYOPEN | RES_USEVC); _res.options &= ~(RES_STAYOPEN | RES_USEVC);
res_close(); res_close();

View File

@@ -61,6 +61,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> /* realloc, malloc, free */
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>

View File

@@ -53,10 +53,10 @@ static char *host_addrs[2];
#endif /* YP */ #endif /* YP */
static struct hostent * static struct hostent *
_gethostbynis(name, map, af) _gethostbynis(
const char *name; const char *name,
char *map; char *map,
int af; int af)
{ {
#ifdef YP #ifdef YP
register char *cp, **q; register char *cp, **q;
@@ -124,18 +124,18 @@ _gethostbynis(name, map, af)
} }
struct hostent * struct hostent *
_gethostbynisname(name, af) _gethostbynisname(
const char *name; const char *name,
int af; int af)
{ {
return _gethostbynis(name, "hosts.byname", af); return _gethostbynis(name, "hosts.byname", af);
} }
struct hostent * struct hostent *
_gethostbynisaddr(addr, len, af) _gethostbynisaddr(
const char *addr; const char *addr,
int len; int len,
int af; int af)
{ {
return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af); return _gethostbynis(inet_ntoa(*(struct in_addr *)addr),"hosts.byaddr", af);
} }

View File

@@ -80,7 +80,7 @@ get_service_name(const char *name) {
} }
static void static void
init_services() init_services(void)
{ {
char *cp, *p, buf[BUFSIZ]; char *cp, *p, buf[BUFSIZ];
register int cc = 0; register int cc = 0;
@@ -246,9 +246,14 @@ static int __dns_decodename(unsigned char *packet,unsigned int offset,unsigned c
return after-packet; return after-packet;
} }
static int __dns_gethostbyx_r(const char* name, struct hostent* result, static int __dns_gethostbyx_r(
char *buf, size_t buflen, const char* name,
struct hostent **RESULT, int *h_errnop, int lookfor) { struct hostent* result,
char *buf, size_t buflen,
struct hostent **RESULT,
int *h_errnop,
int lookfor)
{
int names,ips; int names,ips;
unsigned char *cur; unsigned char *cur;

View File

@@ -102,10 +102,10 @@ typedef union {
} align; } align;
static struct netent * static struct netent *
getnetanswer(answer, anslen, net_i) getnetanswer(
querybuf *answer; querybuf *answer,
int anslen; int anslen,
int net_i; int net_i)
{ {
register HEADER *hp; register HEADER *hp;
@@ -218,9 +218,9 @@ static char *net_aliases[MAXALIASES], netbuf[PACKETSZ];
} }
struct netent * struct netent *
_getnetbydnsaddr(net, net_type) _getnetbydnsaddr(
register unsigned long net; register unsigned long net,
register int net_type; register int net_type )
{ {
unsigned int netbr[4]; unsigned int netbr[4];
int nn, anslen; int nn, anslen;
@@ -272,8 +272,8 @@ _getnetbydnsaddr(net, net_type)
} }
struct netent * struct netent *
_getnetbydnsname(net) _getnetbydnsname(
register const char *net; register const char *net )
{ {
int anslen; int anslen;
querybuf buf; querybuf buf;
@@ -297,15 +297,15 @@ _getnetbydnsname(net)
} }
void void
_setnetdnsent(stayopen) _setnetdnsent(
int stayopen; int stayopen)
{ {
if (stayopen) if (stayopen)
_res.options |= RES_STAYOPEN | RES_USEVC; _res.options |= RES_STAYOPEN | RES_USEVC;
} }
void void
_endnetdnsent() _endnetdnsent(void)
{ {
_res.options &= ~(RES_STAYOPEN | RES_USEVC); _res.options &= ~(RES_STAYOPEN | RES_USEVC);
res_close(); res_close();

View File

@@ -52,10 +52,10 @@ static char *host_aliases[MAXALIASES];
#endif /* YP */ #endif /* YP */
static struct netent * static struct netent *
_getnetbynis(name, map, af) _getnetbynis(
const char *name; const char *name,
char *map; char *map,
int af; int af)
{ {
#ifdef YP #ifdef YP
register char *cp, **q; register char *cp, **q;
@@ -122,16 +122,16 @@ _getnetbynis(name, map, af)
} }
struct netent * struct netent *
_getnetbynisname(name) _getnetbynisname(
const char *name; const char *name)
{ {
return _getnetbynis(name, "networks.byname", AF_INET); return _getnetbynis(name, "networks.byname", AF_INET);
} }
struct netent * struct netent *
_getnetbynisaddr(addr, af) _getnetbynisaddr(
unsigned long addr; unsigned long addr,
int af; int af)
{ {
char *str, *cp; char *str, *cp;
unsigned long net2; unsigned long net2;

View File

@@ -80,7 +80,7 @@ get_service_name(const char *name) {
} }
static void static void
init_services() init_services(void)
{ {
char *cp, *p, buf[BUFSIZ]; char *cp, *p, buf[BUFSIZ];
register int cc = 0; register int cc = 0;

View File

@@ -29,17 +29,17 @@
#include <resolv.h> #include <resolv.h>
static char static char
xtob(c) xtob(
register int c; int c)
{ {
return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
} }
u_int u_int
inet_nsap_addr(ascii, binary, maxlen) inet_nsap_addr(
const char *ascii; const char *ascii,
u_char *binary; u_char *binary,
int maxlen; int maxlen)
{ {
u_char c, nib; u_char c, nib;
u_int len = 0; u_int len = 0;
@@ -72,10 +72,10 @@ inet_nsap_addr(ascii, binary, maxlen)
} }
char * char *
inet_nsap_ntoa(binlen, binary, ascii) inet_nsap_ntoa(
int binlen; int binlen,
register const u_char *binary; const u_char *binary,
register char *ascii; char *ascii)
{ {
register int nib; register int nib;
int i; int i;

View File

@@ -549,8 +549,8 @@ static uint32_t poweroften[10] = {1, 10, 100, 1000, 10000, 100000,
/* takes an XeY precision/size value, returns a string representation. */ /* takes an XeY precision/size value, returns a string representation. */
static const char * static const char *
precsize_ntoa(prec) precsize_ntoa(
u_int8_t prec; u_int8_t prec)
{ {
static char retbuf[sizeof "90000000.00"]; static char retbuf[sizeof "90000000.00"];
unsigned long val; unsigned long val;
@@ -567,8 +567,8 @@ precsize_ntoa(prec)
/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */ /* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
static u_int8_t static u_int8_t
precsize_aton(strptr) precsize_aton(
const char **strptr; const char **strptr)
{ {
unsigned int mval = 0, cmval = 0; unsigned int mval = 0, cmval = 0;
u_int8_t retval = 0; u_int8_t retval = 0;
@@ -609,9 +609,9 @@ precsize_aton(strptr)
/* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */ /* converts ascii lat/lon to unsigned encoded 32-bit number. moves pointer. */
static u_int32_t static u_int32_t
latlon2ul(latlonstrptr,which) latlon2ul(
char **latlonstrptr; char **latlonstrptr,
int *which; int *which )
{ {
char *cp; char *cp;
u_int32_t retval; u_int32_t retval;
@@ -819,9 +819,9 @@ loc_aton(ascii, binary)
/* takes an on-the-wire LOC RR and formats it in a human readable format. */ /* takes an on-the-wire LOC RR and formats it in a human readable format. */
const char * const char *
loc_ntoa(binary, ascii) loc_ntoa(
const u_char *binary; const u_char *binary,
char *ascii; char *ascii )
{ {
static char *error = "?"; static char *error = "?";
const u_char *cp = binary; const u_char *cp = binary;

View File

@@ -133,11 +133,11 @@ static res_send_rhook Rhook = NULL;
__fp_nquery(query, size, stdout);\ __fp_nquery(query, size, stdout);\
} else {} } else {}
static void static void
Aerror(file, string, error, address) Aerror(
FILE *file; FILE *file,
char *string; char *string,
int error; int error,
struct sockaddr_in address; struct sockaddr_in address)
{ {
int save = errno; int save = errno;
@@ -151,10 +151,10 @@ static res_send_rhook Rhook = NULL;
errno = save; errno = save;
} }
static void static void
Perror(file, string, error) Perror(
FILE *file; FILE *file,
char *string; char *string,
int error; int error)
{ {
int save = errno; int save = errno;
@@ -167,16 +167,16 @@ static res_send_rhook Rhook = NULL;
#endif #endif
void void
res_send_setqhook(hook) res_send_setqhook(
res_send_qhook hook; res_send_qhook hook)
{ {
Qhook = hook; Qhook = hook;
} }
void void
res_send_setrhook(hook) res_send_setrhook(
res_send_rhook hook; res_send_rhook hook)
{ {
Rhook = hook; Rhook = hook;
@@ -192,8 +192,8 @@ res_send_setrhook(hook)
* paul vixie, 29may94 * paul vixie, 29may94
*/ */
int int
res_isourserver(inp) res_isourserver(
const struct sockaddr_in *inp; const struct sockaddr_in *inp)
{ {
struct sockaddr_in ina; struct sockaddr_in ina;
int ns, ret; int ns, ret;
@@ -227,10 +227,10 @@ res_isourserver(inp)
* paul vixie, 29may94 * paul vixie, 29may94
*/ */
int int
res_nameinquery(name, type, class, buf, eom) res_nameinquery(
const char *name; const char *name,
int type, class; int type, int class,
const u_char *buf, *eom; const u_char *buf, const u_char *eom)
{ {
const u_char *cp = buf + HFIXEDSZ; const u_char *cp = buf + HFIXEDSZ;
int qdcount = ntohs(((HEADER*)buf)->qdcount); int qdcount = ntohs(((HEADER*)buf)->qdcount);
@@ -267,9 +267,9 @@ res_nameinquery(name, type, class, buf, eom)
* paul vixie, 29may94 * paul vixie, 29may94
*/ */
int int
res_queriesmatch(buf1, eom1, buf2, eom2) res_queriesmatch(
const u_char *buf1, *eom1; const u_char *buf1, const u_char *eom1,
const u_char *buf2, *eom2; const u_char *buf2, const u_char *eom2)
{ {
const u_char *cp = buf1 + HFIXEDSZ; const u_char *cp = buf1 + HFIXEDSZ;
int qdcount = ntohs(((HEADER*)buf1)->qdcount); int qdcount = ntohs(((HEADER*)buf1)->qdcount);
@@ -306,11 +306,11 @@ res_queriesmatch(buf1, eom1, buf2, eom2)
} }
int int
res_send(buf, buflen, ans, anssiz) res_send(
const u_char *buf; const u_char *buf,
int buflen; int buflen,
u_char *ans; u_char *ans,
int anssiz; int anssiz)
{ {
HEADER *hp = (HEADER *) buf; HEADER *hp = (HEADER *) buf;
HEADER *anhp = (HEADER *) ans; HEADER *anhp = (HEADER *) ans;
@@ -922,7 +922,7 @@ read_len:
* This routine is not expected to be user visible. * This routine is not expected to be user visible.
*/ */
void void
res_close() res_close(void)
{ {
if (s >= 0) { if (s >= 0) {
(void) close(s); (void) close(s);