aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorMichaƂ Orynicz <michal.orynicz@tieto.com>2014-11-20 13:09:31 +0100
committerMichal Labedzki <michal.labedzki@tieto.com>2014-11-21 07:45:58 +0000
commit1d8673c0dfe7e723c83e04ba0cf449b2a8a08ee4 (patch)
tree87e54d597ef669b55f37816cd83b2a42a8f5aeea /wiretap
parent1b9dd7547c2f457afbfe3d767c2fdb6e1d04bf3e (diff)
Move text logcat regex strings to shared header
To avoid further duplication of work and bugfixing, move regex strings to wiretap/logcat_text.h and include this file in epan/dissectors/packet-logcat-text.c Change-Id: I82773cda0e3240844139b104c68738ec82788014 Reviewed-on: https://code.wireshark.org/review/5410 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/logcat_text.c10
-rw-r--r--wiretap/logcat_text.h9
2 files changed, 9 insertions, 10 deletions
diff --git a/wiretap/logcat_text.c b/wiretap/logcat_text.c
index 9bbf2ff7b1..674991d53a 100644
--- a/wiretap/logcat_text.c
+++ b/wiretap/logcat_text.c
@@ -30,16 +30,6 @@
#include "logcat_text.h"
#include "logcat.h"
-/* Basically the same regexes are present in epan/packet-logcat-text.c */
-#define SPECIAL_STRING "[-]+ beginning of \\/?"
-#define BRIEF_STRING "[IVDWEF]/.*\\( *\\d*\\): .*"
-#define TAG_STRING "[IVDWEF]/.*: .*"
-#define TIME_STRING "\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} [IVDWEF]/.*\\( *\\d*\\): .*"
-#define THREAD_STRING "[IVDWEF]\\( *\\d+: *\\d+\\) .*"
-#define PROCESS_STRING "[IVDWEF]\\( *\\d+\\) .*"
-#define THREADTIME_STRING "\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3} *\\d+ *\\d+ [IVDWEF] .+: +"
-#define LONG_STRING "\\[ (\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) +(\\d+): +(\\d+) ([IVDWEF])/(.+) ]"
-
struct dumper_t {
int type;
};
diff --git a/wiretap/logcat_text.h b/wiretap/logcat_text.h
index 41fb1d343c..9d5cbb0410 100644
--- a/wiretap/logcat_text.h
+++ b/wiretap/logcat_text.h
@@ -25,6 +25,15 @@
#include "wtap.h"
+#define SPECIAL_STRING "[-]+ (beginning of \\/?.+)"
+#define BRIEF_STRING "([IVDWEF])/(.*?)\\( *(\\d+)\\): (.*)"
+#define TAG_STRING "([IVDWEF])/(.*?): (.*)"
+#define TIME_STRING "(\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) ([IVDWEF])/(.*?)\\( *(\\d+)\\): (.*)"
+#define THREAD_STRING "([IVDWEF])\\( *(\\d+): *(\\d+)\\) (.*)"
+#define PROCESS_STRING "([IVDWEF])\\( *(\\d+)\\) (.*)"
+#define THREADTIME_STRING "(\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) +(\\d+) +(\\d+) ([IVDWEF]) (.*?): (.*)"
+#define LONG_STRING "\\[ (\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3}) +(\\d+): +(\\d+) ([IVDWEF])/(.+) ]\\R(.*)"
+
wtap_open_return_val logcat_text_open(wtap *wth, int *err, gchar **err_info);
gboolean logcat_text_brief_dump_open(wtap_dumper *wdh, int *err);