--- /dev/null
+#include <bindings.dsl.h>
+#include <apr_getopt.h>
+
+module Bindings.APR.GetOpt where
+#strict_import
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+
+-- apr_getopt_err_fn_t takes varargs so it can't be declared as FunPtr.
+#opaque_t apr_getopt_err_fn_t
+
+#starttype struct apr_getopt_t
+# field cont , Ptr <apr_pool_t>
+# field errfn , Ptr <apr_getopt_err_fn_t>
+# field errarg, Ptr ()
+# field ind , CInt
+# field opt , CInt
+# field reset , CInt
+# field argc , CInt
+# field argv , Ptr (Ptr CChar)
+# field place , Ptr CChar
+# field interleave, CInt
+# field skip_start, CInt
+# field skip_end , CInt
+#stoptype
+
+#starttype struct apr_getopt_option_t
+# field name , Ptr CChar
+# field optch , CInt
+# field has_arg , CInt
+# field description, Ptr CChar
+#stoptype
+
+#ccall apr_getopt_init, Ptr (Ptr <apr_getopt_t>) -> Ptr <apr_pool_t> -> CInt -> Ptr (Ptr CChar) -> IO <apr_status_t>
+#ccall apr_getopt , Ptr <apr_getopt_t> -> Ptr CChar -> Ptr CChar -> Ptr (Ptr CChar) -> IO <apr_status_t>
+#ccall apr_getopt_long, Ptr <apr_getopt_t> -> Ptr <apr_getopt_option_t> -> Ptr CInt -> Ptr (Ptr CChar) -> IO <apr_status_t>