Nmap Development mailing list archives

[PATCH] Add more PCRE flags for NSE pcre.flags()


From: Kris Katterjohn <katterjohn () gmail com>
Date: Sat, 16 Feb 2008 21:17:14 -0600

Hey everyone!

I've attached a patch to add more PCRE flags for the NSE pcrelib function pcre.flags(), which returns a table of the PCRE flags available for your system. Now the list is up-to-date with libpcre 7.6 (most of these option have been around for at least a few past versions--all were available in 7.4).

Since I'm not aware of any particular libpcre version requirements, I've surrounded my additions with #ifdef's.

Since my additions pick up where the previous list left off, I'm guessing they weren't left out for any particular reason (probably not available at the time of writing pcrelib). However, I'd like a go from Fyodor or Diman before adding it.

Any comments are appreciated.

Thanks,
Kris Katterjohn
Index: nse_pcrelib.cc
===================================================================
--- nse_pcrelib.cc      (revision 6840)
+++ nse_pcrelib.cc      (working copy)
@@ -343,6 +343,45 @@
        { "NO_AUTO_CAPTURE", PCRE_NO_AUTO_CAPTURE },
        { "NO_UTF8_CHECK",   PCRE_NO_UTF8_CHECK },
 #endif
+#ifdef PCRE_AUTO_CALLOUT
+       { "AUTO_CALLOUT",    PCRE_AUTO_CALLOUT },
+#endif
+#ifdef PCRE_PARTIAL
+       { "PARTIAL",         PCRE_PARTIAL },
+#endif
+#ifdef PCRE_DFA_SHORTEST
+       { "DFA_SHORTEST",    PCRE_DFA_SHORTEST },
+#endif
+#ifdef PCRE_DFA_RESTART
+       { "DFA_RESTART",     PCRE_DFA_RESTART },
+#endif
+#ifdef PCRE_FIRSTLINE
+       { "FIRSTLINE",       PCRE_FIRSTLINE },
+#endif
+#ifdef PCRE_DUPNAMES
+       { "DUPNAMES",        PCRE_DUPNAMES },
+#endif
+#ifdef PCRE_NEWLINE_CR
+       { "NEWLINE_CR",      PCRE_NEWLINE_CR },
+#endif
+#ifdef PCRE_NEWLINE_LF
+       { "NEWLINE_LF",      PCRE_NEWLINE_LF },
+#endif
+#ifdef PCRE_NEWLINE_CRLF
+       { "NEWLINE_CRLF",    PCRE_NEWLINE_CRLF },
+#endif
+#ifdef PCRE_NEWLINE_ANY
+       { "NEWLINE_ANY",     PCRE_NEWLINE_ANY },
+#endif
+#ifdef PCRE_NEWLINE_ANYCRLF
+       { "NEWLINE_ANYCRLF", PCRE_NEWLINE_ANYCRLF },
+#endif
+#ifdef PCRE_BSR_ANYCRLF
+       { "BSR_ANYCRLF",     PCRE_BSR_ANYCRLF },
+#endif
+#ifdef PCRE_BSR_UNICODE
+       { "BSR_UNICODE",     PCRE_BSR_UNICODE },
+#endif
        { NULL, 0 }
 };
 

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: