[Forensics-changes] [yara] 219/415: Compile in C99 mode and remove warnings

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:43:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit 0447c237000cae4bada012db8890e04f9f3cc008
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Nov 12 12:21:27 2013 +0000

    Compile in C99 mode and remove warnings
---
 libyara/libyara.c |  1 +
 libyara/re.c      | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)

diff --git a/libyara/libyara.c b/libyara/libyara.c
index 94746cb..18bdf6b 100644
--- a/libyara/libyara.c
+++ b/libyara/libyara.c
@@ -16,6 +16,7 @@ limitations under the License.
 
 #include <string.h>
 #include <stdio.h>
+#include <ctype.h>
 
 #include "mem.h"
 #include "re.h"
diff --git a/libyara/re.c b/libyara/re.c
index 5a8bac4..dbc24a3 100644
--- a/libyara/re.c
+++ b/libyara/re.c
@@ -14,7 +14,16 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+
+/*
+
+This modules implements a regular expressions engine based on Thompson's
+algorithm as described by Russ Cox in http://swtch.com/~rsc/regexp/
+
+*/
+
 #include <assert.h>
+#include <ctype.h>
 
 #ifdef WIN32
 #include <windows.h>
@@ -61,6 +70,16 @@ pthread_key_t thread_storage_key;
 #endif
 
 
+extern int yr_parse_re_string(
+  const char* re_string,
+  RE** re);
+
+
+extern int yr_parse_hex_string(
+  const char* hex_string,
+  RE** re);
+
+
 int yr_re_initialize()
 {
   #ifdef WIN32
@@ -168,6 +187,22 @@ void yr_re_destroy(
 }
 
 
+int yr_re_compile(
+    const char* re_string,
+    RE** re)
+{
+  return yr_parse_re_string(re_string, re);
+}
+
+
+int yr_re_compile_hex(
+    const char* hex_string,
+    RE** re)
+{
+  return yr_parse_hex_string(hex_string, re);
+}
+
+
 int _yr_emit_inst(
     ARENA* arena,
     uint8_t opcode,
@@ -712,6 +747,19 @@ void _yr_re_add_thread(
     y = tmp; \
   }
 
+//
+// yr_re_exec
+//
+// Executes a regular expression
+//
+// Args:
+//   uint8_t* code      - Pointer to regexp code be executed
+//   uint8_t* input     - Pointer to input data
+//   size_t input_size  - Input data size
+//   int flags
+//   RE_MATCH_CALLBACK_FUNC callback - Callback function
+//   void* callback_args  - Callback argument
+//
 
 int yr_re_exec(
     uint8_t* code, 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list