diff options
-rw-r--r-- | epan/Makefile.common | 1 | ||||
-rw-r--r-- | epan/address_to_str.c | 9 | ||||
-rw-r--r-- | epan/proto.c | 7 | ||||
-rw-r--r-- | epan/to_str-int.h | 42 | ||||
-rw-r--r-- | epan/to_str.c | 1 |
5 files changed, 46 insertions, 14 deletions
diff --git a/epan/Makefile.common b/epan/Makefile.common index 021f40003d..90666751f1 100644 --- a/epan/Makefile.common +++ b/epan/Makefile.common @@ -257,6 +257,7 @@ LIBWIRESHARK_INCLUDES = \ tfs.h \ time_fmt.h \ to_str.h \ + to_str-int.h \ tvbparse.h \ tvbuff.h \ tvbuff-int.h \ diff --git a/epan/address_to_str.c b/epan/address_to_str.c index 8e008a765c..1c444568e6 100644 --- a/epan/address_to_str.c +++ b/epan/address_to_str.c @@ -51,6 +51,7 @@ # include "wsutil/inet_v6defs.h" #endif +#include "to_str-int.h" #include "to_str.h" #include "value_string.h" #include "addr_resolv.h" @@ -62,14 +63,6 @@ #include <stdio.h> #include "emem.h" -/* private to_str.c API, don't export to .h! */ -char *word_to_hex(char *out, guint16 word); -char *word_to_hex_npad(char *out, guint16 word); -char *dword_to_hex_punct(char *out, guint32 dword, char punct); -char *dword_to_hex(char *out, guint32 dword); -char *bytes_to_hexstr(char *out, const guint8 *ad, guint32 len); -char *bytes_to_hexstr_punct(char *out, const guint8 *ad, guint32 len, char punct); - /* * If a user _does_ pass in a too-small buffer, this is probably * going to be too long to fit. However, even a partial string diff --git a/epan/proto.c b/epan/proto.c index d183aed107..43dfd30310 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -47,6 +47,7 @@ #include "charsets.h" #include "asm_utils.h" #include "column-utils.h" +#include "to_str-int.h" #include "to_str.h" #include "expert.h" #include "show_exception.h" @@ -5671,12 +5672,6 @@ _hfinfo_type_hex_octet(int type) return -1; } -/* private to_str.c API don't export to .h! */ -char *oct_to_str_back(char *ptr, guint32 value); -char *hex_to_str_back(char *ptr, int pad, guint32 value); -char *uint_to_str_back(char *ptr, guint32 value); -char *int_to_str_back(char *ptr, gint32 value); - static const char * hfinfo_number_value_format_display(const header_field_info *hfinfo, int display, char buf[32], guint32 value) { diff --git a/epan/to_str-int.h b/epan/to_str-int.h new file mode 100644 index 0000000000..3a72605b31 --- /dev/null +++ b/epan/to_str-int.h @@ -0,0 +1,42 @@ +/* to_str-int.h + * Definitions for utilities to convert various other types to strings. + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * 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 + * of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __TO_STR_INT_H__ +#define __TO_STR_INT_H__ + +#include <glib.h> + +char *word_to_hex(char *out, guint16 word); +char *word_to_hex_npad(char *out, guint16 word); +char *dword_to_hex_punct(char *out, guint32 dword, char punct); +char *dword_to_hex(char *out, guint32 dword); +char *bytes_to_hexstr(char *out, const guint8 *ad, guint32 len); +char *bytes_to_hexstr_punct(char *out, const guint8 *ad, guint32 len, char punct); + +char *oct_to_str_back(char *ptr, guint32 value); +char *hex_to_str_back(char *ptr, int pad, guint32 value); +char *uint_to_str_back(char *ptr, guint32 value); +char *int_to_str_back(char *ptr, gint32 value); + +#endif /* __TO_STR_INT_H__ */ diff --git a/epan/to_str.c b/epan/to_str.c index c526aca19e..03e81f6a0d 100644 --- a/epan/to_str.c +++ b/epan/to_str.c @@ -32,6 +32,7 @@ #include "emem.h" #include "proto.h" #include "to_str.h" +#include "to_str-int.h" #include "strutil.h" /* |