C++ compilation.
[idzebra-moved-to-github.git] / recctrl / rectext.c
index 4c27522..bcc9d26 100644 (file)
@@ -4,7 +4,16 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: rectext.c,v $
- * Revision 1.9  1998-10-16 08:14:38  adam
+ * Revision 1.12  1999-05-26 07:49:14  adam
+ * C++ compilation.
+ *
+ * Revision 1.11  1999/05/21 12:00:17  adam
+ * Better diagnostics for extraction process.
+ *
+ * Revision 1.10  1999/05/20 12:57:18  adam
+ * Implemented TCL filter. Updated recctrl system.
+ *
+ * Revision 1.9  1998/10/16 08:14:38  adam
  * Updated record control system.
  *
  * Revision 1.8  1998/05/20 10:12:27  adam
 #include <zebrautl.h>
 #include "rectext.h"
 
-static void text_init (RecType recType)
+static void *text_init (RecType recType)
 {
+    return 0;
 }
 
-static void text_destroy (RecType recType)
+static void text_destroy (void *clientData)
 {
 }
 
@@ -84,10 +94,10 @@ struct buf_info {
 
 struct buf_info *buf_open (struct recExtractCtrl *p)
 {
-    struct buf_info *fi = xmalloc (sizeof(*fi));
+    struct buf_info *fi = (struct buf_info *) xmalloc (sizeof(*fi));
 
     fi->p = p;
-    fi->buf = xmalloc (4096);
+    fi->buf = (char *) xmalloc (4096);
     fi->offset = 1;
     fi->max = 1;
     return fi;
@@ -114,7 +124,7 @@ void buf_close (struct buf_info *fi)
     xfree (fi);
 }
 
-static int text_extract (struct recExtractCtrl *p)
+static int text_extract (void *clientData, struct recExtractCtrl *p)
 {
     char w[512];
     RecWord recWord;
@@ -141,10 +151,10 @@ static int text_extract (struct recExtractCtrl *p)
         }
     } while (r > 0);
     buf_close (fi);
-    return 0;
+    return RECCTRL_EXTRACT_OK;
 }
 
-static int text_retrieve (struct recRetrieveCtrl *p)
+static int text_retrieve (void *clientData, struct recRetrieveCtrl *p)
 {
     int r, text_ptr = 0;
     static char *text_buf = NULL;
@@ -164,7 +174,7 @@ static int text_retrieve (struct recRetrieveCtrl *p)
             char *nb;
 
             text_size = 2*text_size + 8192;
-            nb = xmalloc (text_size);
+            nb = (char *) xmalloc (text_size);
             if (text_buf)
             {
                 memcpy (nb, text_buf, text_ptr);