;;; This file was automatically generated by SWIG (http://www.swig.org).
;;; Version 3.0.10
;;;
;;; Do not make changes to this file unless you know what you are doing--modify
;;; the SWIG interface file instead.

(in-package #:cl-opencc-ffi)

;;;SWIG wrapper code starts here

(cl:defmacro defanonenum (cl:&body enums)
   "Converts anonymous enums to defconstants."
  `(cl:progn ,@(cl:loop for value in enums
                        for index = 0 then (cl:1+ index)
                        when (cl:listp value) do (cl:setf index (cl:second value)
                                                          value (cl:first value))
                        collect `(cl:defconstant ,value ,index))))

(cl:eval-when (:compile-toplevel :load-toplevel)
  (cl:unless (cl:fboundp 'swig-lispify)
    (cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
      (cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
                    (cl:cond
                      ((cl:null lst)
                       rest)
                      ((cl:upper-case-p c)
                       (helper (cl:cdr lst) 'upper
                               (cl:case last
                                 ((lower digit) (cl:list* c #\- rest))
                                 (cl:t (cl:cons c rest)))))
                      ((cl:lower-case-p c)
                       (helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
                      ((cl:digit-char-p c)
                       (helper (cl:cdr lst) 'digit 
                               (cl:case last
                                 ((upper lower) (cl:list* c #\- rest))
                                 (cl:t (cl:cons c rest)))))
                      ((cl:char-equal c #\_)
                       (helper (cl:cdr lst) '_ (cl:cons #\- rest)))
                      (cl:t
                       (cl:error "Invalid character: ~A" c)))))
        (cl:let ((fix (cl:case flag
                        ((constant enumvalue) "+")
                        (variable "*")
                        (cl:t ""))))
          (cl:intern
           (cl:concatenate
            'cl:string
            fix
            (cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
            fix)
           package))))))

;;;SWIG wrapper code ends here


(cl:defconstant #.(swig-lispify "OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD" 'constant) "s2t.json")

(cl:export '#.(swig-lispify "OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD" 'constant))

(cl:defconstant #.(swig-lispify "OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP" 'constant) "t2s.json")

(cl:export '#.(swig-lispify "OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP" 'constant))

(cffi:defcfun ("opencc_open" #.(swig-lispify "opencc_open" 'function)) :pointer
  (configFileName :string))

(cl:export '#.(swig-lispify "opencc_open" 'function))

(cffi:defcfun ("opencc_close" #.(swig-lispify "opencc_close" 'function)) :int
  (opencc :pointer))

(cl:export '#.(swig-lispify "opencc_close" 'function))

(cffi:defcfun ("opencc_convert_utf8_to_buffer" #.(swig-lispify "opencc_convert_utf8_to_buffer" 'function)) :int
  (opencc :pointer)
  (input :string)
  (length :int)
  (output :string))

(cl:export '#.(swig-lispify "opencc_convert_utf8_to_buffer" 'function))

(cffi:defcfun ("opencc_convert_utf8" #.(swig-lispify "opencc_convert_utf8" 'function)) :string
  (opencc :pointer)
  (input :string)
  (length :int))

(cl:export '#.(swig-lispify "opencc_convert_utf8" 'function))

(cffi:defcfun ("opencc_convert_utf8_free" #.(swig-lispify "opencc_convert_utf8_free" 'function)) :void
  (str :string))

(cl:export '#.(swig-lispify "opencc_convert_utf8_free" 'function))

(cffi:defcfun ("opencc_error" #.(swig-lispify "opencc_error" 'function)) :string)

(cl:export '#.(swig-lispify "opencc_error" 'function))


