Revert commit 24308 until I can get it to compile on Windows/Linux/Solaris
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 12 Feb 2008 08:09:22 +0000 (08:09 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 12 Feb 2008 08:09:22 +0000 (08:09 +0000)
(strangely, it compiled fine on my MacOS X machine).

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24309 f5534014-38df-0310-8fa8-9805f1628bb7

epan/column-utils.c
epan/column-utils.h
epan/column.c
epan/column_info.h
epan/proto.c
file.c

index 0aaf4b62cb780c7c1d129330729d5071f64e266d..814bef3d6469376d7bda98e01df8eee26bec3655 100644 (file)
 #include "ipv6-utils.h"
 #include "osi-utils.h"
 #include "value_string.h"
-#include "globals.h"
 
 #include <epan/strutil.h>
-#include <epan/epan.h>
 
 /* Allocate all the data structures for constructing column data, given
    the number of columns. */
@@ -268,55 +266,6 @@ col_add_fstr(column_info *cinfo, gint el, const gchar *format, ...) {
   va_end(ap);
 }
 
-void
-col_custom_set_fstr(const gchar *field_name, const gchar *format, ...)
-{
-  va_list ap;
-  int     i;
-
-  if (!check_col(&cfile.cinfo, COL_CUSTOM))
-    return;
-
-  va_start(ap, format);
-  for (i = cfile.cinfo.col_first[COL_CUSTOM];
-       i <= cfile.cinfo.col_last[COL_CUSTOM]; i++) {
-    if (strcmp(cfile.cinfo.col_title[i], field_name) == 0 &&
-       cfile.cinfo.fmt_matx[i][COL_CUSTOM]) {
-      cfile.cinfo.col_data[i] = cfile.cinfo.col_buf[i];
-      g_vsnprintf(cfile.cinfo.col_buf[i], COL_MAX_LEN, format, ap);
-      strncpy(cfile.cinfo.col_expr[i], field_name, COL_MAX_LEN);
-      strncpy(cfile.cinfo.col_expr_val[i], cfile.cinfo.col_buf[i], COL_MAX_LEN);
-    }
-  }
-  va_end(ap);
-}
-
-void
-col_custom_prime_edt(epan_dissect_t *edt)
-{
-  int i;
-  dfilter_t *dfilter_code;
-
-  for (i = cfile.cinfo.col_first[COL_CUSTOM];
-       i <= cfile.cinfo.col_last[COL_CUSTOM]; i++) {
-    if (cfile.cinfo.fmt_matx[i][COL_CUSTOM]) {
-      if(dfilter_compile(cfile.cinfo.col_title[i], &dfilter_code))
-        epan_dissect_prime_dfilter(edt, dfilter_code);
-    }
-  }
-}
-
-gboolean
-have_custom_cols(void)
-{
-  /* The same as check_col(), but without the check to see if the column
-   * is writable. */
-  if (cfile.cinfo.col_first[COL_CUSTOM] >= 0)
-    return TRUE;
-  else
-    return FALSE;
-}
-
 static void
 col_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
                          const gchar *format, va_list ap)
@@ -1449,9 +1398,6 @@ col_fill_in(packet_info *pinfo)
     case COL_FREQ_CHAN:    /* done by radio dissectors */
         break;
 
-    case COL_CUSTOM:     /* done by col_custom_set_fstr() called from proto.c */
-       break;
-
     case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */
       g_assert_not_reached();
       break;
index 7d9b8fe7d660157dea51f3a8d29671f9417a4ad2..946df43680a6484c6b8bb222957d74cfbcbafdb2 100644 (file)
@@ -30,7 +30,6 @@
 #include "gnuc_format_check.h"
 #include "column_info.h"
 #include "packet_info.h"
-#include <epan/epan.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -143,15 +142,6 @@ extern void        col_add_str(column_info *cinfo, gint col, const gchar *str);
 extern void    col_add_fstr(column_info *cinfo, gint col, const gchar *format, ...)
     GNUC_FORMAT_CHECK(printf, 3, 4);
 
-/* For internal Wireshark use only.  Not to be called from dissectors. */
-void col_custom_set_fstr(const gchar *field_name, const gchar *format, ...)
-    GNUC_FORMAT_CHECK(printf, 2, 3);
-
-/* For internal Wireshark use only.  Not to be called from dissectors. */
-void col_custom_prime_edt(epan_dissect_t *edt);
-
-gboolean have_custom_cols(void);
-
 /** Append the given text to a column element, the text will be copied.
  *
  * @param cinfo the current packet row
index 45cf19e78f6e0a177c50e002f9809744a8a66d92..7afaded3e38ed0c9c29cd04d8fb27ab03d3636d1 100644 (file)
@@ -105,8 +105,7 @@ col_format_to_string(gint fmt) {
     "%C",
     "%l",
     "%a",
-    "%F",
-    "%Cus"
+    "%F"
   };
 
   if (fmt < 0 || fmt >= NUM_COL_FMTS)
@@ -175,8 +174,7 @@ static const gchar *dlist[NUM_COL_FMTS] = {
        "Frame Relay DLCI",                         /* COL_FR_DLCI */
        "GPRS BSSGP TLLI",                          /* COL_BSSGP_TLLI */
        "Expert Info Severity",                     /* COL_EXPERT */
-       "Frequency/Channel",                        /* COL_FREQ_CHAN */
-       "Custom"                                    /* COL_CUSTOM */
+       "Frequency/Channel"                         /* COL_FREQ_CHAN */
 };
 
 const gchar *
@@ -301,9 +299,6 @@ get_column_format_matches(gboolean *fmt_list, gint format) {
     case COL_FREQ_CHAN:
       fmt_list[COL_FREQ_CHAN] = TRUE;
       break;
-    case COL_CUSTOM:
-      fmt_list[COL_CUSTOM] = TRUE;
-      break;
     default:
       break;
   }
index e71c874529e98fce3ecd4ba147dad3d828b44d57..a355797b997b3f2053295f612a1df44727473957 100644 (file)
@@ -115,7 +115,6 @@ enum {
   COL_BSSGP_TLLI,     /* GPRS BSSGP IE TLLI */
   COL_EXPERT,         /* Expert Info */
   COL_FREQ_CHAN,      /* IEEE 802.11 (and WiMax?) - Channel */
-  COL_CUSTOM,         /* Custom column (any filter name's contents) */
   NUM_COL_FMTS        /* Should always be last */
 };
 
index e0317e33defa5888bbd112e939969f372c3fd811..d477d644f6fb15d8046139e2b1324c4cc523365f 100644 (file)
@@ -45,7 +45,6 @@
 #include "emem.h"
 #include "charsets.h"
 #include "asm_utils.h"
-#include "column-utils.h"
 
 #ifdef NEED_G_ASCII_STRCASECMP_H
 #include "g_ascii_strcasecmp.h"
@@ -1641,7 +1640,6 @@ proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
 static void
 proto_tree_set_ipxnet(field_info *fi, guint32 value)
 {
-       col_custom_set_fstr(fi->hfinfo->abbrev, "%u", value);
        fvalue_set_uinteger(&fi->value, value);
 }
 
@@ -2168,13 +2166,10 @@ proto_item_append_string(proto_item *pi, const char *str)
 static void
 proto_tree_set_string(field_info *fi, const char* value)
 {
-       if (value) {
-               col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
+       if (value)
                fvalue_set(&fi->value, (gpointer) value, FALSE);
-       } else {
-               col_custom_set_fstr(fi->hfinfo->abbrev, "[ Null ]");
+       else
                fvalue_set(&fi->value, (gpointer) "[ Null ]", FALSE);
-       }
 }
 
 static void
@@ -2283,7 +2278,6 @@ proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s
 static void
 proto_tree_set_ether(field_info *fi, const guint8* value)
 {
-       col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
        fvalue_set(&fi->value, (gpointer) value, FALSE);
 }
 
@@ -2640,7 +2634,6 @@ proto_tree_set_uint(field_info *fi, guint32 value)
                        integer >>= hfinfo->bitshift;
                }
        }
-       col_custom_set_fstr(hfinfo->abbrev, "%u", value);
        fvalue_set_uinteger(&fi->value, integer);
 }
 
@@ -2805,8 +2798,6 @@ proto_tree_set_int(field_info *fi, gint32 value)
                        integer >>= hfinfo->bitshift;
                }
        }
-
-       col_custom_set_fstr(hfinfo->abbrev, "%u", value);
        fvalue_set_sinteger(&fi->value, integer);
 }
 
diff --git a/file.c b/file.c
index b50ab8a3df59b752a246e4ac13e0d8e9e9a510a5..4e5a12e8a74c7e5e6b00f9f360a9634f3c0b0bd7 100644 (file)
--- a/file.c
+++ b/file.c
@@ -77,7 +77,8 @@
 #include <epan/timestamp.h>
 #include <epan/dfilter/dfilter-macro.h>
 #include "file_util.h"
-#include <epan/column-utils.h>
+
+
 
 #ifdef HAVE_LIBPCAP
 gboolean auto_scroll_live;
@@ -938,13 +939,11 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
 
        we have tap listeners;
 
-       we have custom columns;
-
      allocate a protocol tree root node, so that we'll construct
      a protocol tree against which a filter expression can be
      evaluated. */
   if ((dfcode != NULL && refilter) || color_filters_used()
-      || num_tap_filters != 0 || have_custom_cols())
+        || num_tap_filters != 0)
          create_proto_tree = TRUE;
 
   /* Dissect the frame. */
@@ -957,9 +956,6 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
   if (color_filters_used()) {
       color_filters_prime_edt(edt);
   }
-
-  col_custom_prime_edt(edt);
-
   tap_queue_init(edt);
   epan_dissect_run(edt, pseudo_header, buf, fdata, &cf->cinfo);
   tap_push_tapped_queue(edt);