Replace the types from sys/types.h and netinet/in.h by their glib.h
authorJörg Mayer <jmayer@loplof.de>
Fri, 2 Aug 2002 21:29:45 +0000 (21:29 -0000)
committerJörg Mayer <jmayer@loplof.de>
Fri, 2 Aug 2002 21:29:45 +0000 (21:29 -0000)
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c
and inet_ntop.c for now (can't estimate the consequences).

svn path=/trunk/; revision=5928

22 files changed:
epan/column-utils.c
epan/conversation.c
epan/filesystem.c
epan/frame_data.c
epan/ftypes/ftypes.h
epan/inet_aton.c
epan/inet_ntop.c
epan/inet_pton.c
epan/ipv4.c
epan/osi-utils.c
epan/packet.c
epan/packet.h
epan/pint.h
epan/plugins.c
epan/proto.c
epan/proto.h
epan/resolv.c
epan/strutil.c
epan/strutil.h
epan/to_str.c
epan/to_str.h
epan/tvbuff.c

index 3674e616fb3ac379331615579da66fd538f5b140..acdd1535284a52209f86d2fb84c735d400482f4b 100644 (file)
@@ -1,7 +1,7 @@
 /* column-utils.c
  * Routines for column utilities.
  *
- * $Id: column-utils.c,v 1.16 2002/06/29 21:27:39 guy Exp $
+ * $Id: column-utils.c,v 1.17 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include <string.h>
 #include <time.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #ifdef NEED_SNPRINTF_H
 # include "snprintf.h"
 #endif
index b0a6c3c96e145c1bbb9ed7e07c2dd48cdd069b16..38ee4cb67964025f35abdc625ab337891c7e6800 100644 (file)
@@ -1,7 +1,7 @@
 /* conversation.c
  * Routines for building lists of packets that are part of a "conversation"
  *
- * $Id: conversation.c,v 1.18 2002/05/09 12:10:06 sahlberg Exp $
+ * $Id: conversation.c,v 1.19 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 
 #include <stdio.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
 #include <string.h>
 #include <glib.h>
 #include "packet.h"
index ffb487445e4b65d80353f1b7e75f173c5e02b22b..e46a488d856e3c61b2f7010290dad783b7cff4ac 100644 (file)
@@ -1,7 +1,7 @@
 /* filesystem.c
  * Filesystem utility routines
  *
- * $Id: filesystem.c,v 1.18 2002/06/23 21:33:09 guy Exp $
+ * $Id: filesystem.c,v 1.19 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
index c2602a5b47a417f19d5b061d6583009c613d062b..8399b78835a8a657c75c47a2956868734e84094b 100644 (file)
@@ -1,7 +1,7 @@
 /* frame_data.c
  * Routines for packet disassembly
  *
- * $Id: frame_data.c,v 1.1 2001/04/01 04:11:50 hagbard Exp $
+ * $Id: frame_data.c,v 1.2 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #include "frame_data.h"
 #include "packet.h"
 
index 5589147fb977ec6a83634335d0459ce361dcb2ec..28660ea6df82cad033ecb330d24620bfa542f1f6 100644 (file)
@@ -1,7 +1,7 @@
 /* ftypes.h
  * Definitions for field types
  *
- * $Id: ftypes.h,v 1.11 2002/06/23 10:32:35 guy Exp $
+ * $Id: ftypes.h,v 1.12 2002/08/02 21:29:45 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -113,10 +113,6 @@ ftype_can_le(enum ftenum ftype);
 
 #include <epan/ipv4.h>
 
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
 #include <epan/tvbuff.h>
 #include <epan/nstime.h>
 #include <epan/dfilter/drange.h>
index f101d10cd185c49e08eca50b95d2a7a593296818..e2b66d3fe6c6dcb57551e4954416635bb3930905 100644 (file)
@@ -43,14 +43,6 @@ static char sccsid[] = "@(#)inet_addr.c      8.1 (Berkeley) 6/17/93";
 #include <sys/param.h>
 #endif
 
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
@@ -71,12 +63,12 @@ inet_aton(cp_arg, addr)
        const char *cp_arg;
        struct in_addr *addr;
 {
-       register const u_char *cp = cp_arg;
-       register u_long val;
+       register const guchar *cp = cp_arg;
+       register gulong val;
        register int base, n;
-       register u_char c;
-       u_int parts[4];
-       register u_int *pp = parts;
+       register guchar c;
+       guint parts[4];
+       register guint *pp = parts;
 
        for (;;) {
                /*
@@ -152,6 +144,6 @@ inet_aton(cp_arg, addr)
                break;
        }
        if (addr)
-               addr->s_addr = htonl(val);
+               addr->s_addr = g_htonl(val);
        return (1);
 }
index e2cfa13595379c9af8d5f7315cc5cd55680c02f2..7a540634bdd58513effc860bfb6d318f6d11cf62 100644 (file)
 #endif
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id: inet_ntop.c,v 1.3 2002/06/23 10:32:32 guy Exp $";
+static char rcsid[] = "$Id: inet_ntop.c,v 1.4 2002/08/02 21:29:39 jmayer Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -40,10 +36,6 @@ static char rcsid[] = "$Id: inet_ntop.c,v 1.3 2002/06/23 10:32:32 guy Exp $";
 #define EAFNOSUPPORT    WSAEAFNOSUPPORT
 #endif
 
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
@@ -77,8 +69,8 @@ static char rcsid[] = "$Id: inet_ntop.c,v 1.3 2002/06/23 10:32:32 guy Exp $";
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
 
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
+static const char *inet_ntop4 __P((const guchar *src, char *dst, size_t size));
+static const char *inet_ntop6 __P((const guchar *src, char *dst, size_t size));
 
 /* char *
  * inet_ntop(af, src, dst, size)
@@ -114,13 +106,13 @@ inet_ntop(af, src, dst, size)
  *     `dst' (as a const)
  * notes:
  *     (1) uses no statics
- *     (2) takes a u_char* not an in_addr as input
+ *     (2) takes a guchar* not an in_addr as input
  * author:
  *     Paul Vixie, 1996.
  */
 static const char *
 inet_ntop4(src, dst, size)
-       const u_char *src;
+       const guchar *src;
        char *dst;
        size_t size;
 {
@@ -147,7 +139,7 @@ inet_ntop4(src, dst, size)
  */
 static const char *
 inet_ntop6(src, dst, size)
-       const u_char *src;
+       const guchar *src;
        char *dst;
        size_t size;
 {
@@ -160,7 +152,7 @@ inet_ntop6(src, dst, size)
         */
        char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
        struct { int base, len; } best, cur;
-       u_int words[NS_IN6ADDRSZ / NS_INT16SZ];
+       guint words[NS_IN6ADDRSZ / NS_INT16SZ];
        int i;
 
        /*
index 07d7c1af7cfec39658387bfc0fb3645a25eaca20..47df162d9663ff0336ad4007ad4f3524da9501e0 100644 (file)
 #endif
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id: inet_pton.c,v 1.2 2002/06/23 10:32:32 guy Exp $";
+static char rcsid[] = "$Id: inet_pton.c,v 1.3 2002/08/02 21:29:39 jmayer Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #define EAFNOSUPPORT   WSAEAFNOSUPPORT
@@ -40,10 +36,6 @@ static char rcsid[] = "$Id: inet_pton.c,v 1.2 2002/06/23 10:32:32 guy Exp $";
 #include <sys/socket.h>
 #endif
 
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
@@ -73,10 +65,10 @@ static char rcsid[] = "$Id: inet_pton.c,v 1.2 2002/06/23 10:32:32 guy Exp $";
  */
 
 #ifdef AF_INET
-static int     inet_pton4 __P((const char *src, u_char *dst));
+static int     inet_pton4 __P((const char *src, guchar *dst));
 #endif
 #ifdef AF_INET6
-static int     inet_pton6 __P((const char *src, u_char *dst));
+static int     inet_pton6 __P((const char *src, guchar *dst));
 #endif
 
 /* int
@@ -126,11 +118,11 @@ inet_pton(af, src, dst)
 static int
 inet_pton4(src, dst)
        const char *src;
-       u_char *dst;
+       guchar *dst;
 {
        static const char digits[] = "0123456789";
        int saw_digit, octets, ch;
-       u_char tmp[NS_INADDRSZ], *tp;
+       guchar tmp[NS_INADDRSZ], *tp;
 
        saw_digit = 0;
        octets = 0;
@@ -139,7 +131,7 @@ inet_pton4(src, dst)
                const char *pch;
 
                if ((pch = strchr(digits, ch)) != NULL) {
-                       u_int new = *tp * 10 + (pch - digits);
+                       guint new = *tp * 10 + (pch - digits);
 
                        if (new > 255)
                                return (0);
@@ -181,14 +173,14 @@ inet_pton4(src, dst)
 static int
 inet_pton6(src, dst)
        const char *src;
-       u_char *dst;
+       guchar *dst;
 {
        static const char xdigits_l[] = "0123456789abcdef",
                          xdigits_u[] = "0123456789ABCDEF";
-       u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+       guchar tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
        const char *xdigits, *curtok;
        int ch, saw_xdigit;
-       u_int val;
+       guint val;
 
        memset((tp = tmp), '\0', NS_IN6ADDRSZ);
        endp = tp + NS_IN6ADDRSZ;
@@ -225,8 +217,8 @@ inet_pton6(src, dst)
                        }
                        if (tp + NS_INT16SZ > endp)
                                return (0);
-                       *tp++ = (u_char) (val >> 8) & 0xff;
-                       *tp++ = (u_char) val & 0xff;
+                       *tp++ = (guchar) (val >> 8) & 0xff;
+                       *tp++ = (guchar) val & 0xff;
                        saw_xdigit = 0;
                        val = 0;
                        continue;
@@ -242,8 +234,8 @@ inet_pton6(src, dst)
        if (saw_xdigit) {
                if (tp + NS_INT16SZ > endp)
                        return (0);
-               *tp++ = (u_char) (val >> 8) & 0xff;
-               *tp++ = (u_char) val & 0xff;
+               *tp++ = (guchar) (val >> 8) & 0xff;
+               *tp++ = (guchar) val & 0xff;
        }
        if (colonp != NULL) {
                /*
index 3dacb8598b39c743d76db836492ffb49d5445ae3..afb3b4e87d12810ee79d258310302b83dcfde19a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Gilbert Ramirez <gram@alumni.rice.edu>
  *
- * $Id: ipv4.c,v 1.2 2001/11/13 23:55:37 gram Exp $
+ * $Id: ipv4.c,v 1.3 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
 #include <glib.h>
 #include <stdio.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
 #include "ipv4.h"
 #include "packet.h" /* for ip_to_str */
 
@@ -72,7 +64,7 @@ ipv4_addr_set_host_order_addr(ipv4_addr *ipv4, guint32 new_addr)
 void
 ipv4_addr_set_net_order_addr(ipv4_addr *ipv4, guint32 new_addr)
 {
-       ipv4->addr = ntohl(new_addr);
+       ipv4->addr = g_ntohl(new_addr);
 }
 
 void
@@ -85,7 +77,7 @@ ipv4_addr_set_netmask_bits(ipv4_addr *ipv4, guint new_nmask_bits)
 guint32
 ipv4_get_net_order_addr(ipv4_addr *ipv4)
 {
-       return htonl(ipv4->addr);
+       return g_htonl(ipv4->addr);
 }
 
 guint32
@@ -97,7 +89,7 @@ ipv4_get_host_order_addr(ipv4_addr *ipv4)
 gchar*
 ipv4_addr_str(ipv4_addr *ipv4)
 {
-       guint32 ipv4_host_order = htonl(ipv4->addr);
+       guint32 ipv4_host_order = g_htonl(ipv4->addr);
        return ip_to_str((gchar*)&ipv4_host_order);
 }
 
index 6606e4e64efd8b5864d7c90c692ce1c392c96182..f1ac5dc27629d1b700c72a480dbc5d7340497063 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for ISO/OSI network and transport protocol packet disassembly
  * Main entrance point and common functions
  *
- * $Id: osi-utils.c,v 1.6 2002/07/17 00:42:51 guy Exp $
+ * $Id: osi-utils.c,v 1.7 2002/08/02 21:29:39 jmayer Exp $
  * Laurent Deniel <deniel@worldnet.fr>
  * Ralf Schneider <Ralf.Schneider@t-online.de>
  *
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #include <stdio.h>
 #include <glib.h>
 
index 5a4177fbd278ae6ca7fac1f9c69713948e1f31c9..494a89cc4847a57ecfb856f12c4fe0c9ab2d3830 100644 (file)
@@ -1,7 +1,7 @@
 /* packet.c
  * Routines for packet disassembly
  *
- * $Id: packet.c,v 1.74 2002/07/17 00:42:51 guy Exp $
+ * $Id: packet.c,v 1.75 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
 #include <glib.h>
 
 #include <stdio.h>
 #include <ctype.h>
 #include <time.h>
 
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
 #ifdef NEED_INET_V6DEFS_H
 # include "inet_v6defs.h"
 #endif
@@ -263,7 +243,7 @@ final_registration_all_protocols(void)
 /* Creates the top-most tvbuff and calls dissect_frame() */
 void
 dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
-              const u_char *pd, frame_data *fd, column_info *cinfo)
+              const guchar *pd, frame_data *fd, column_info *cinfo)
 {
        int i;
 
index fe8f749854d44dcc560cf722940b8036b807121c..99c8339e0f0e83a0f361e41f50fb845c892ce6ea 100644 (file)
@@ -1,7 +1,7 @@
 /* packet.h
  * Definitions for packet disassembly structures and routines
  *
- * $Id: packet.h,v 1.57 2002/06/04 07:03:54 guy Exp $
+ * $Id: packet.h,v 1.58 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -278,11 +278,11 @@ extern void free_data_sources(packet_info *pinfo);
  * Dissectors should never modify the packet data.
  */
 extern void dissect_packet(epan_dissect_t *edt,
-    union wtap_pseudo_header *pseudo_header, const u_char *pd,
+    union wtap_pseudo_header *pseudo_header, const guchar *pd,
     frame_data *fd, column_info *cinfo);
 
 /* These functions are in packet-ethertype.c */
-extern void capture_ethertype(guint16 etype, const u_char *pd, int offset,
+extern void capture_ethertype(guint16 etype, const guchar *pd, int offset,
                int len, packet_counts *ld);
 extern void ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_ethertype,
                packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree,
index 2eaef53153308331524acf12f3a215bd6096c562..e73df6d310967bebf2b9778ff20a1517965e1f14 100644 (file)
@@ -2,7 +2,7 @@
  * Definitions for extracting and translating integers safely and portably
  * via pointers.
  *
- * $Id: pint.h,v 1.4 2001/10/29 21:56:48 guy Exp $
+ * $Id: pint.h,v 1.5 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -29,7 +29,7 @@
 
 #include <glib.h>
 
-/* Pointer versions of ntohs and ntohl.  Given a pointer to a member of a
+/* Pointer versions of g_ntohs and g_ntohl.  Given a pointer to a member of a
  * byte array, returns the value of the two or four bytes at the pointer.
  * The pletoh[sl] versions return the little-endian representation.
  */
index 0231b2b0ab3a67c4f7880f7a5b373618d483c1a8..849881bb87e66855170f6258d34d9f87d3f88a46 100644 (file)
@@ -1,7 +1,7 @@
 /* plugins.c
  * plugin routines
  *
- * $Id: plugins.c,v 1.56 2002/07/16 22:50:48 guy Exp $
+ * $Id: plugins.c,v 1.57 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include <sys/stat.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index b337db2ec52ede61644ebb5bb03ae3381c68f05f..2d74e8fc468b379bf5f340d7120b4877ac9cb7b7 100644 (file)
@@ -1,7 +1,7 @@
 /* proto.c
  * Routines for protocol tree
  *
- * $Id: proto.c,v 1.70 2002/06/19 19:21:15 guy Exp $
+ * $Id: proto.c,v 1.71 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 # include "config.h"
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <glib.h>
index fe34faf64ead0031ce268d72d9bb10d59b79557f..0a70b9d36377d2e171e952d140077532b31bff43 100644 (file)
@@ -1,7 +1,7 @@
 /* proto.h
  * Definitions for protocol display
  *
- * $Id: proto.h,v 1.33 2002/06/23 10:32:32 guy Exp $
+ * $Id: proto.h,v 1.34 2002/08/02 21:29:39 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 # include <varargs.h>
 #endif
 
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>
-#endif
-
 #include <glib.h>
 
 #include "ipv4.h"
index 9d51666cc51bbddb280abde75a91b8f9364f5290..7c8128918d6665262f4fa7c77ca95d8aeb5b36f1 100644 (file)
@@ -1,7 +1,7 @@
 /* resolv.c
  * Routines for network object lookup
  *
- * $Id: resolv.c,v 1.23 2002/03/03 21:42:54 guy Exp $
+ * $Id: resolv.c,v 1.24 2002/08/02 21:29:40 jmayer Exp $
  *
  * Laurent Deniel <deniel@worldnet.fr>
  *
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
 #ifdef HAVE_NETINET_IN_H
 # include <netinet/in.h>
 #endif
@@ -234,7 +230,7 @@ static guchar *serv_name_lookup(guint port, port_type proto)
   tp->next = NULL;
 
   if (!(g_resolv_flags & RESOLV_TRANSPORT) || 
-      (servp = getservbyport(htons(port), serv_proto)) == NULL) {
+      (servp = getservbyport(g_htons(port), serv_proto)) == NULL) {
     /* unknown port */
     sprintf(tp->name, "%d", port);
   } else {
@@ -1407,7 +1403,7 @@ gboolean get_host_ipaddr(const char *host, guint32 *addrp)
                        return FALSE;
        }
 
-       *addrp = ntohl(ipaddr.s_addr);
+       *addrp = g_ntohl(ipaddr.s_addr);
        return TRUE;
 }
 
index 9886240ff462fa4cfa80870d80dc7f4419a927af..b5fe3d6bcdc0fda5b911eaabde4b07e2c1193bd2 100644 (file)
@@ -1,7 +1,7 @@
 /* strutil.c
  * String utility routines
  *
- * $Id: strutil.c,v 1.7 2000/12/22 12:05:36 gram Exp $
+ * $Id: strutil.c,v 1.8 2002/08/02 21:29:40 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
  * buffer.
  * Return a pointer to the EOL character(s) in "*eol".
  */
-const u_char *
-find_line_end(const u_char *data, const u_char *dataend, const u_char **eol)
+const guchar *
+find_line_end(const guchar *data, const guchar *dataend, const guchar **eol)
 {
-  const u_char *lineend;
+  const guchar *lineend;
 
   lineend = memchr(data, '\n', dataend - data);
   if (lineend == NULL) {
@@ -105,10 +105,10 @@ find_line_end(const u_char *data, const u_char *dataend, const u_char **eol)
  * Return 0 if there is no next token.
  */
 int
-get_token_len(const u_char *linep, const u_char *lineend,
-             const u_char **next_token)
+get_token_len(const guchar *linep, const guchar *lineend,
+             const guchar **next_token)
 {
-  const u_char *tokenp;
+  const guchar *tokenp;
   int token_len;
 
   tokenp = linep;
@@ -139,13 +139,13 @@ get_token_len(const u_char *linep, const u_char *lineend,
  * characters as C-style escapes, and return a pointer to it.
  */
 gchar *
-format_text(const u_char *string, int len)
+format_text(const guchar *string, int len)
 {
   static gchar *fmtbuf;
   static int fmtbuf_len;
   int column;
-  const u_char *stringend = string + len;
-  u_char c;
+  const guchar *stringend = string + len;
+  guchar c;
   int i;
 
   /*
index f334cb7dd40bba6b295ef588a65917d1204142e3..2201c9d6a4af0663b3d1b5b7f7fc1d2ae6bba279 100644 (file)
@@ -1,7 +1,7 @@
 /* strutil.h
  * String utility definitions
  *
- * $Id: strutil.h,v 1.7 2002/06/23 10:32:32 guy Exp $
+ * $Id: strutil.h,v 1.8 2002/08/02 21:29:40 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 
 /* ... thus, config.h needs to be #included */
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h> /* for u_char */
-#endif
-
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h> /* for u_char */
-#endif
-
-const u_char *find_line_end(const u_char *data, const u_char *dataend,
-    const u_char **eol);
-int        get_token_len(const u_char *linep, const u_char *lineend,
-    const u_char **next_token);
-gchar*     format_text(const u_char *line, int len);
+const guchar *find_line_end(const guchar *data, const guchar *dataend,
+    const guchar **eol);
+int        get_token_len(const guchar *linep, const guchar *lineend,
+    const guchar **next_token);
+gchar*     format_text(const guchar *line, int len);
 gchar*     bytes_to_str(const guint8 *, int);
 gchar*     bytes_to_str_punct(const guint8 *, int, gchar punct);
 #endif /* __STRUTIL_H__ */
index 6ea8d125b0e31433901eff63d5aa73a1d5e7c97f..1e0cc363e4c8e6b58e34a16a7f2a3f2633ce19ab 100644 (file)
@@ -1,7 +1,7 @@
 /* to_str.c
  * Routines for utilities to convert various other types to strings.
  *
- * $Id: to_str.c,v 1.14 2002/06/23 10:32:32 guy Exp $
+ * $Id: to_str.c,v 1.15 2002/08/02 21:29:40 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_WINSOCK2_H
-# include <winsock2.h>   /* for "u_char" */
-#endif
-
 #ifdef NEED_SNPRINTF_H
 # include "snprintf.h"
 #endif
 
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
@@ -169,7 +157,7 @@ ip6_to_str(struct e_in6_addr *ad) {
 #endif
   static gchar buf[INET6_ADDRSTRLEN];
 
-  inet_ntop(AF_INET6, (u_char*)ad, (gchar*)buf, sizeof(buf));
+  inet_ntop(AF_INET6, (guchar*)ad, (gchar*)buf, sizeof(buf));
   return buf;
 }
 
index a95470020535ffdb1b3f3947e87e3ae97dfbcadf..ce7e516822d1211c2daa9f7fd0986b4cf0ef9c23 100644 (file)
@@ -1,7 +1,7 @@
 /* to_str.h
  * Definitions for utilities to convert various other types to strings.
  *
- * $Id: to_str.h,v 1.6 2002/05/05 00:16:34 guy Exp $
+ * $Id: to_str.h,v 1.7 2002/08/02 21:29:40 jmayer Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 
 #include <glib.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
-
 #include "nstime.h"
 
 /*
index 8fe482fab611c1bb70089aaca406fa46692f32cd..9f75d7510b8b4dfd8691d3104b831d091d1f281a 100644 (file)
@@ -9,7 +9,7 @@
  *             the data of a backing tvbuff, or can be a composite of
  *             other tvbuffs.
  *
- * $Id: tvbuff.c,v 1.38 2002/07/17 06:55:24 guy Exp $
+ * $Id: tvbuff.c,v 1.39 2002/08/02 21:29:40 jmayer Exp $
  *
  * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
  *
@@ -1893,7 +1893,7 @@ tvb_find_line_end_unquoted(tvbuff_t *tvb, gint offset, int len,
 {
        gint cur_offset, char_offset;
        gboolean is_quoted;
-       u_char c;
+       guchar c;
        gint eob_offset;
        int linelen;