summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/libc
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2008-08-02 05:37:10 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2008-08-02 05:37:10 +0000
commit082d4a2879af7f7fab60f93ff24dad4edf3d69b7 (patch)
tree968317f7d3466190ffa0dfffa524cd255f612c29 /cpukit/libnetworking/libc
parent2008-08-02 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-082d4a2879af7f7fab60f93ff24dad4edf3d69b7.tar.bz2
Add missing prototypes.
Diffstat (limited to 'cpukit/libnetworking/libc')
-rw-r--r--cpukit/libnetworking/libc/gethostbydns.c37
-rw-r--r--cpukit/libnetworking/libc/gethostbyht.c1
-rw-r--r--cpukit/libnetworking/libc/gethostbynis.c22
-rw-r--r--cpukit/libnetworking/libc/gethostnamadr.c13
-rw-r--r--cpukit/libnetworking/libc/getnetbydns.c24
-rw-r--r--cpukit/libnetworking/libc/getnetbynis.c18
-rw-r--r--cpukit/libnetworking/libc/getnetnamadr.c2
-rw-r--r--cpukit/libnetworking/libc/nsap_addr.c20
-rw-r--r--cpukit/libnetworking/libc/res_debug.c20
-rw-r--r--cpukit/libnetworking/libc/res_send.c56
10 files changed, 110 insertions, 103 deletions
diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c
index e75d17d3fd..07d6f2042b 100644
--- a/cpukit/libnetworking/libc/gethostbydns.c
+++ b/cpukit/libnetworking/libc/gethostbydns.c
@@ -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();
diff --git a/cpukit/libnetworking/libc/gethostbyht.c b/cpukit/libnetworking/libc/gethostbyht.c
index ea4240abf0..c5c30f98b9 100644
--- a/cpukit/libnetworking/libc/gethostbyht.c
+++ b/cpukit/libnetworking/libc/gethostbyht.c
@@ -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>
diff --git a/cpukit/libnetworking/libc/gethostbynis.c b/cpukit/libnetworking/libc/gethostbynis.c
index bb7680643b..1ae2e4980b 100644
--- a/cpukit/libnetworking/libc/gethostbynis.c
+++ b/cpukit/libnetworking/libc/gethostbynis.c
@@ -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);
}
diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c
index 4dc18840e0..7da9190cfd 100644
--- a/cpukit/libnetworking/libc/gethostnamadr.c
+++ b/cpukit/libnetworking/libc/gethostnamadr.c
@@ -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;
diff --git a/cpukit/libnetworking/libc/getnetbydns.c b/cpukit/libnetworking/libc/getnetbydns.c
index 49be8e81a0..33ff993c15 100644
--- a/cpukit/libnetworking/libc/getnetbydns.c
+++ b/cpukit/libnetworking/libc/getnetbydns.c
@@ -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();
diff --git a/cpukit/libnetworking/libc/getnetbynis.c b/cpukit/libnetworking/libc/getnetbynis.c
index db5a96f9a3..3849a679df 100644
--- a/cpukit/libnetworking/libc/getnetbynis.c
+++ b/cpukit/libnetworking/libc/getnetbynis.c
@@ -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;
diff --git a/cpukit/libnetworking/libc/getnetnamadr.c b/cpukit/libnetworking/libc/getnetnamadr.c
index e99bce565e..e3abcbbaf5 100644
--- a/cpukit/libnetworking/libc/getnetnamadr.c
+++ b/cpukit/libnetworking/libc/getnetnamadr.c
@@ -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;
diff --git a/cpukit/libnetworking/libc/nsap_addr.c b/cpukit/libnetworking/libc/nsap_addr.c
index f1bcfea136..d8effa2e70 100644
--- a/cpukit/libnetworking/libc/nsap_addr.c
+++ b/cpukit/libnetworking/libc/nsap_addr.c
@@ -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;
diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c
index 584b556476..e34c4c23f0 100644
--- a/cpukit/libnetworking/libc/res_debug.c
+++ b/cpukit/libnetworking/libc/res_debug.c
@@ -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;
diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c
index 5f675a46e4..3d8f823efc 100644
--- a/cpukit/libnetworking/libc/res_send.c
+++ b/cpukit/libnetworking/libc/res_send.c
@@ -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);