/* We could modify them to use the GLib Unicode routines or the International Components for Unicode library but it's not apparent that we could do so without consuming a lot more CPU and memory or that searching would be significantly better.  */
gboolean cf_find_packet_data(capture_file *cf, const guint8 *string, size_t string_size, search_direction dir)
/* We could modify them to use the GLib Unicode routines or the International Components for Unicode library but it's not apparent that we could do so without consuming a lot more CPU and memory or that searching would be significantly better.  */
gboolean cf_find_packet_data(capture_file *cf, const guint8 *string, size_t string_size, search_direction dir)
{
  cbs_t info;
  info.data = string;
  info.data_len = string_size;
  if (cf->regex) {
    return find_packet(cf, match_regex, NULL, dir);
  } else if (cf->string) {
    switch (cf->scs_type) {
    case SCS_NARROW_AND_WIDE:
      return find_packet(cf, match_narrow_and_wide, &info, dir);
    case SCS_NARROW:
      return find_packet(cf, match_narrow, &info, dir);
    case SCS_WIDE:
      return find_packet(cf, match_wide, &info, dir);
    default:
      g_assert_not_reached();
      return FALSE;
    }
  } else
    return find_packet(cf, match_binary, &info, dir);
}