[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] xinet
From: |
Simon Josefsson |
Subject: |
[Bug-gnulib] xinet |
Date: |
Fri, 17 Sep 2004 13:33:09 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
2004-09-17 Simon Josefsson <address@hidden>
* xinet.h, xinet.c: New files.
2004-09-17 Simon Josefsson <address@hidden>
* modules/xinet: New file.
Index: lib/xinet.h
===================================================================
RCS file: lib/xinet.h
diff -N lib/xinet.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/xinet.h 17 Sep 2004 11:32:00 -0000
@@ -0,0 +1,31 @@
+/* xinet.h -- arpa/inet.h function inet_ntoa that allocate output buffer.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef XINET_H
+# define XINET_H
+
+/* Get struct in_addr. */
+#include <arpa/inet.h>
+
+/* Convert the Internet host address IN given in network byte order to
+ a string in standard numbers-and-dots notation. The string is
+ newly allocated, with error checking, and must be deallocate by the
+ caller. */
+char *xinet_ntoa (struct in_addr in);
+
+#endif /* XINET_H */
Index: lib/xinet.c
===================================================================
RCS file: lib/xinet.c
diff -N lib/xinet.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/xinet.c 17 Sep 2004 11:32:00 -0000
@@ -0,0 +1,37 @@
+/* xinet.c -- arpa/inet.h function inet_ntoa that allocate output buffer.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification. */
+#include "xinet.h"
+
+/* Get inet_ntoa_r. */
+#include "inet_r.h"
+
+/* Get xmalloc. */
+#include "xalloc.h"
+
+char *
+xinet_ntoa (struct in_addr in)
+{
+ char *p = xmalloc (16);
+ return inet_ntoa_r (in, p);
+}
Index: modules/xinet
===================================================================
RCS file: modules/xinet
diff -N modules/xinet
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/xinet 17 Sep 2004 11:32:00 -0000
@@ -0,0 +1,21 @@
+Description:
+arpa/inet.h function inet_ntoa that allocate output buffer.
+
+Files:
+lib/xinet.h
+lib/xinet.c
+
+Depends-on:
+inet_r
+xalloc
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += xinet.h xinet.c
+
+Include:
+"xinet.h"
+
+Maintainer:
+Simon Josefsson
- [Bug-gnulib] xinet,
Simon Josefsson <=