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

View File

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

View File

@@ -53,10 +53,10 @@ static char *host_addrs[2];
#endif /* YP */
static struct hostent *
_gethostbynis(name, map, af)
const char *name;
char *map;
int af;
_gethostbynis(
const char *name,
char *map,
int af)
{
#ifdef YP
register char *cp, **q;
@@ -124,18 +124,18 @@ _gethostbynis(name, map, af)
}
struct hostent *
_gethostbynisname(name, af)
const char *name;
int af;
_gethostbynisname(
const char *name,
int af)
{
return _gethostbynis(name, "hosts.byname", af);
}
struct hostent *
_gethostbynisaddr(addr, len, af)
const char *addr;
int len;
int af;
_gethostbynisaddr(
const char *addr,
int len,
int 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
init_services()
init_services(void)
{
char *cp, *p, buf[BUFSIZ];
register int cc = 0;
@@ -246,9 +246,14 @@ static int __dns_decodename(unsigned char *packet,unsigned int offset,unsigned c
return after-packet;
}
static int __dns_gethostbyx_r(const char* name, struct hostent* result,
char *buf, size_t buflen,
struct hostent **RESULT, int *h_errnop, int lookfor) {
static int __dns_gethostbyx_r(
const char* name,
struct hostent* result,
char *buf, size_t buflen,
struct hostent **RESULT,
int *h_errnop,
int lookfor)
{
int names,ips;
unsigned char *cur;

View File

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

View File

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

View File

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

View File

@@ -29,17 +29,17 @@
#include <resolv.h>
static char
xtob(c)
register int c;
xtob(
int c)
{
return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
}
u_int
inet_nsap_addr(ascii, binary, maxlen)
const char *ascii;
u_char *binary;
int maxlen;
inet_nsap_addr(
const char *ascii,
u_char *binary,
int maxlen)
{
u_char c, nib;
u_int len = 0;
@@ -72,10 +72,10 @@ inet_nsap_addr(ascii, binary, maxlen)
}
char *
inet_nsap_ntoa(binlen, binary, ascii)
int binlen;
register const u_char *binary;
register char *ascii;
inet_nsap_ntoa(
int binlen,
const u_char *binary,
char *ascii)
{
register int nib;
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. */
static const char *
precsize_ntoa(prec)
u_int8_t prec;
precsize_ntoa(
u_int8_t prec)
{
static char retbuf[sizeof "90000000.00"];
unsigned long val;
@@ -567,8 +567,8 @@ precsize_ntoa(prec)
/* converts ascii size/precision X * 10**Y(cm) to 0xXY. moves pointer. */
static u_int8_t
precsize_aton(strptr)
const char **strptr;
precsize_aton(
const char **strptr)
{
unsigned int mval = 0, cmval = 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. */
static u_int32_t
latlon2ul(latlonstrptr,which)
char **latlonstrptr;
int *which;
latlon2ul(
char **latlonstrptr,
int *which )
{
char *cp;
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. */
const char *
loc_ntoa(binary, ascii)
const u_char *binary;
char *ascii;
loc_ntoa(
const u_char *binary,
char *ascii )
{
static char *error = "?";
const u_char *cp = binary;

View File

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