OSDN Git Service

Remove unused INET functions for D'Arcy.
authorBruce Momjian <bruce@momjian.us>
Tue, 20 Oct 1998 23:03:20 +0000 (23:03 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 20 Oct 1998 23:03:20 +0000 (23:03 +0000)
src/backend/utils/adt/inet.c
src/include/catalog/pg_proc.h
src/include/utils/builtins.h

index 9d54718..6c1f74f 100644 (file)
@@ -3,7 +3,7 @@
  *     is for IP V4 CIDR notation, but prepared for V6: just
  *     add the necessary bits where the comments indicate.
  *
- *     $Id: inet.c,v 1.5 1998/10/17 04:08:40 momjian Exp $
+ *     $Id: inet.c,v 1.6 1998/10/20 23:03:19 momjian Exp $
  */
 
 #include <sys/types.h>
@@ -313,115 +313,6 @@ inet_masklen(inet *ip)
 }
 
 text *
-inet_host(inet *ip)
-{
-       char       *dst,
-                               tmp[sizeof("255.255.255.255/32")];
-
-       if (ip_family(ip) == AF_INET)
-       {
-#ifdef BAD
-               /* It's an IP V4 address: */
-               if (inet_cidr_ntop(AF_INET, &ip_v4addr(ip), 4, -1,
-                                                 tmp, sizeof(tmp)) < 0)
-               {
-                       elog(ERROR, "unable to print host (%s)", strerror(errno));
-                       return (NULL);
-               }
-#endif
-       }
-       else
-       {
-               /* Go for an IPV6 address here, before faulting out: */
-               elog(ERROR, "unknown address family (%d)", ip_family(ip));
-               return (NULL);
-       }
-       dst = palloc(strlen(tmp) + 1);
-       if (dst == NULL)
-       {
-               elog(ERROR, "unable to allocate memory in inet_out()");
-               return (NULL);
-       }
-       strcpy(dst, tmp);
-       return (dst);
-       
-}
-
-text *
-inet_network_without_bits(inet *ip)
-{
-       char       *dst,
-                               tmp[sizeof("255.255.255.255/32")];
-
-       if (ip_family(ip) == AF_INET)
-       {
-               /* It's an IP V4 address: */
-               int addr = ip_v4addr(ip) & (-1 << (32 - ip_bits(ip)));
-#ifdef BAD
-
-               if (inet_cidr_ntop(AF_INET, &addr, (int)(ip_bits(ip)/8), -1,
-                                                 tmp, sizeof(tmp)) < 0)
-               {
-                       elog(ERROR, "unable to print address (%s)", strerror(errno));
-                       return (NULL);
-               }
-#endif
-       }
-       else
-       {
-               /* Go for an IPV6 address here, before faulting out: */
-               elog(ERROR, "unknown address family (%d)", ip_family(ip));
-               return (NULL);
-       }
-       dst = palloc(strlen(tmp) + 1);
-       if (dst == NULL)
-       {
-               elog(ERROR, "unable to allocate memory in inet_out()");
-               return (NULL);
-       }
-       strcpy(dst, tmp);
-       return (dst);
-       
-}
-
-text *
-inet_network_with_bits(inet *ip)
-{
-       char       *dst,
-                               tmp[sizeof("255.255.255.255/32")];
-
-       if (ip_family(ip) == AF_INET)
-       {
-               /* It's an IP V4 address: */
-               int addr = ip_v4addr(ip) & (-1 << (32 - ip_bits(ip)));
-#ifdef BAD
-
-               if (inet_cidr_ntop(AF_INET, &addr, (int)(ip_bits(ip)/8),
-                                                 ip_bits(ip), tmp, sizeof(tmp)) < 0)
-               {
-                       elog(ERROR, "unable to print address (%s)", strerror(errno));
-                       return (NULL);
-               }
-#endif
-       }
-       else
-       {
-               /* Go for an IPV6 address here, before faulting out: */
-               elog(ERROR, "unknown address family (%d)", ip_family(ip));
-               return (NULL);
-       }
-       dst = palloc(strlen(tmp) + 1);
-       if (dst == NULL)
-       {
-               elog(ERROR, "unable to allocate memory in inet_out()");
-               return (NULL);
-       }
-       strcpy(dst, tmp);
-       return (dst);
-       
-}
-
-text *
 inet_broadcast(inet *ip)
 {
        char       *dst,
index f454342..1be26d5 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_proc.h,v 1.73 1998/10/12 04:07:48 momjian Exp $
+ * $Id: pg_proc.h,v 1.74 1998/10/20 23:03:19 momjian Exp $
  *
  * NOTES
  *       The script catalog/genbki.sh reads this file and generates .bki
@@ -2101,12 +2101,6 @@ DATA(insert OID = 940 (  inet_netmask            PGUID 11 f t f 1 f 25 "869" 100 0 0 100
 DESCR("netmask of inet address");
 DATA(insert OID = 941 (  inet_masklen          PGUID 11 f t f 1 f 23 "869" 100 0 0 100  foo bar ));
 DESCR("netmask length");
-DATA(insert OID = 942 (  inet_host             PGUID 11 f t f 1 f 25 "869" 100 0 0 100  foo bar ));
-DESCR("host adress");
-DATA(insert OID = 943 (  inet_network_without_bits             PGUID 11 f t f 1 f 25 "869" 100 0 0 100  foo bar ));
-DESCR("netmask without bits");
-DATA(insert OID = 944 (  inet_network_with_bits                PGUID 11 f t f 1 f 25 "869" 100 0 0 100  foo bar ));
-DESCR("netmask with bits");
 DATA(insert OID = 945 (  inet_broadcast                PGUID 11 f t f 1 f 25 "869" 100 0 0 100  foo bar ));
 DESCR("broadcast address");
 
index 49b849d..9d9989a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: builtins.h,v 1.61 1998/10/12 04:07:51 momjian Exp $
+ * $Id: builtins.h,v 1.62 1998/10/20 23:03:20 momjian Exp $
  *
  * NOTES
  *       This should normally only be included by fmgr.h.
@@ -535,9 +535,6 @@ int4                inet_cmp(inet * a1, inet * a2);
 
 text      *inet_netmask(inet * addr);
 int4           inet_masklen(inet * addr);
-text      *inet_host(inet * addr);
-text      *inet_network_without_bits(inet * addr);
-text      *inet_network_with_bits(inet * addr);
 text      *inet_broadcast(inet * addr);