   (:require [dsbdp.byte-array-conversion :refer :all]))
 
 (defn create-data-processing-sub-fn
-  [data-processing-definition input offset]
+  [data-processing-definition input]
   (into
     '()
     (reverse

   For determining the type, this function calls data-proc-sub-fn with a 1530 byte dummy byte-array filled with 0."
  [data-proc-sub-fn]
  (let [dummy-ba (byte-array 1530 (byte 0))
        ret (data-proc-sub-fn dummy-ba 0)]
    (type ret)))

(defn create-data-processing-fn-body-for-java-map-output-type
  "Create a data processing function body for emitting data into a Java map."
  [input offset rules]
  (reduce
    (fn [v rule]
      (conj v `(.put
                ~(name (first rule))
                ~(create-data-processing-sub-fn (second rule) input offset))))
    '[doto (java.util.HashMap.)] rules))

(defn create-data-processing-fn-body-for-clj-map-output-type
  "Create a data processing function body for emitting data into a Clojure map."
  [input offset rules]
  (reduce
    (fn [v rule]
      (conj v `(assoc
                 ~(name (first rule))
                 ~(create-data-processing-sub-fn (second rule) input offset))))
    '[-> {}] rules))

(defn create-data-processing-fn-body-for-csv-str-output-type
  "Create a data processing function body for emitting data into a CSV string."
  [input offset rules]
  (let [extracted-strings (reduce
                            (fn [v rule]
                              (let [data-proc-sub-fn (create-data-processing-sub-fn (second rule) input offset)
                                    data-proc-sub-fn-ret-type (get-data-processing-sub-fn-ret-type (eval `(fn [~input ~offset] ~data-proc-sub-fn)))]
                                (conj v (if (= java.lang.String data-proc-sub-fn-ret-type)
                                          `(str "\"" ~data-proc-sub-fn "\"")
                                          data-proc-sub-fn))))


(defn create-data-processing-fn-body-for-json-str-output-type
  "Create a data processing function body for emitting data into a JSON string."
  [input rules]
  (let [extracted-strings (conj
                            (reduce
                              (fn [v rule]
                                (let [data-proc-sub-fn (create-data-processing-sub-fn (second rule) input)
                                      data-proc-sub-fn-ret-type (get-data-processing-sub-fn-ret-type (eval `(fn [~input] ~data-proc-sub-fn)))]
                                  (conj v "\"" (name (first rule)) "\":"
                                          (if (= java.lang.String data-proc-sub-fn-ret-type)
                                            `(str "\"" ~data-proc-sub-fn "\"")
