packages feed

bindings-apr-0.1: Bindings/APR/Thread/Proc.hsc

#include <bindings.dsl.h>
#include <apr_thread_proc.h>

module Bindings.APR.Thread.Proc where
#strict_import
import Bindings.APR
import Bindings.APR.ErrNo
import Bindings.APR.File.Types
import Bindings.APR.Pools
import System.Posix.Types

#integral_t apr_cmdtype_e
#num APR_SHELLCMD
#num APR_PROGRAM
#num APR_PROGRAM_ENV
#num APR_PROGRAM_PATH
#num APR_SHELLCMD_ENV

#integral_t apr_wait_how_e
#num APR_WAIT
#num APR_NOWAIT

#integral_t apr_exit_why_e
#num APR_PROC_EXIT
#num APR_PROC_SIGNAL
#num APR_PROC_SIGNAL_CORE

#cinline APR_PROC_CHECK_EXIT     , Ptr <apr_exit_why_e> -> IO CInt
#cinline APR_PROC_CHECK_SIGNALED , Ptr <apr_exit_why_e> -> IO CInt
#cinline APR_PROC_CHECK_CORE_DUMP, Ptr <apr_exit_why_e> -> IO CInt

#num APR_NO_PIPE
#num APR_FULL_BLOCK
#num APR_FULL_NONBLOCK
#num APR_PARENT_BLOCK
#num APR_CHILD_BLOCK
#num APR_NO_FILE

#num APR_READ_BLOCK
#num APR_WRITE_BLOCK

#num APR_LIMIT_CPU
#num APR_LIMIT_MEM
#num APR_LIMIT_NPROC
#num APR_LIMIT_NOFILE

#num APR_OC_REASON_DEATH
#num APR_OC_REASON_UNWRITABLE
#num APR_OC_REASON_RESTART
#num APR_OC_REASON_UNREGISTER
#num APR_OC_REASON_LOST
#num APR_OC_REASON_RUNNING

#starttype struct apr_proc_t
#  field pid, CPid
#  field in , Ptr <apr_file_t>
#  field out, Ptr <apr_file_t>
#  field err, Ptr <apr_file_t>
#  if APR_HAS_PROC_INVOKED
#    field invoked, Ptr CCHar
#  endif
#stoptype

#callback apr_child_errfn_t, Ptr <apr_pool_t> -> <apr_status_t> -> Ptr CChar -> IO ()

#opaque_t apr_thread_t
#opaque_t apr_threadattr_t
#opaque_t apr_procattr_t
#opaque_t apr_thread_once_t
#opaque_t apr_threadkey_t
#opaque_t apr_other_child_rec_t

#callback apr_thread_start_t, Ptr <apr_thread_t> -> Ptr () -> IO (Ptr ())

#integral_t apr_kill_conditions_e
#num APR_KILL_NEVER
#num APR_KILL_ALWAYS
#num APR_KILL_AFTER_TIMEOUT
#num APR_JUST_WAIT
#num APR_KILL_ONLY_ONCE

#if APR_HAS_THREADS

#  ccall apr_threadattr_create       , Ptr (Ptr <apr_threadattr_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
#  ccall apr_threadattr_detach_set   , Ptr <apr_threadattr_t> -> <apr_int32_t> -> IO <apr_status_t>
#  ccall apr_threadattr_detach_get   , Ptr <apr_threadattr_t> -> IO <apr_status_t>
#  ccall apr_threadattr_stacksize_set, Ptr <apr_threadattr_t> -> <apr_size_t> -> IO <apr_status_t>
#  ccall apr_threadattr_guardsize_set, Ptr <apr_threadattr_t> -> <apr_size_t> -> IO <apr_status_t>

#  ccall apr_thread_create   , Ptr (Ptr <apr_thread_t>) -> Ptr <apr_threadattr_t> -> <apr_thread_start_t> -> Ptr () -> Ptr <apr_pool_t> -> IO <apr_status_t>
#  ccall apr_thread_exit     , Ptr <apr_thread_t> -> <apr_status_t> -> IO <apr_status_t>
#  ccall apr_thread_join     , Ptr <apr_status_t> -> Ptr <apr_thread_t> -> IO <apr_status_t>
#  ccall apr_thread_yield    , IO ()

#  ccall apr_thread_once_init, Ptr (Ptr <apr_thread_once_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
#  ccall apr_thread_once     , Ptr <apr_thread_once_t> -> FunPtr (IO ()) -> IO <apr_status_t>

#  ccall apr_thread_detach   , Ptr <apr_thread_t> -> IO <apr_status_t>
#  ccall apr_thread_data_get , Ptr (Ptr ()) -> Ptr CChar -> Ptr <apr_thread_t> -> IO <apr_status_t>
#  ccall apr_thread_data_set , Ptr () -> Ptr CChar -> FunPtr (Ptr () -> IO <apr_status_t>) -> Ptr <apr_thread_t> -> IO <apr_status_t>

#  ccall apr_threadkey_private_create, Ptr (Ptr <apr_threadkey_t>) -> FunPtr (Ptr () -> IO ()) -> Ptr <apr_pool_t> -> IO <apr_status_t>
#  ccall apr_threadkey_private_get   , Ptr (Ptr ()) -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
#  ccall apr_threadkey_private_set   , Ptr () -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
#  ccall apr_threadkey_private_delete, Ptr <apr_threadkey_t> -> Ptr <apr_status_t>

#  ccall apr_threadkey_data_get, Ptr (Ptr ()) -> Ptr CChar -> Ptr <apr_threadkey_t> -> IO <apr_status_t>
#  ccall apr_threadkey_data_set, Ptr () -> Ptr CChar -> FunPtr (Ptr () -> IO <apr_status_t>) -> Ptr <apr_threadkey_t> -> IO <apr_status_t>

#endif

#ccall apr_procattr_create       , Ptr (Ptr <apr_procattr_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
#ccall apr_procattr_io_set       , Ptr <apr_procattr_t> -> <apr_int32_t> -> <apr_int32_t> -> <apr_int32_t> -> IO <apr_status_t>
#ccall apr_procattr_child_in_set , Ptr <apr_procattr_t> -> Ptr <apr_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
#ccall apr_procattr_child_out_set, Ptr <apr_procattr_t> -> Ptr <apr_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
#ccall apr_procattr_child_err_set, Ptr <apr_procattr_t> -> Ptr <apr_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
#ccall apr_procattr_dir_set      , Ptr <apr_procattr_t> -> Ptr CChar -> IO <apr_status_t>
#ccall apr_procattr_cmdtype_set  , Ptr <apr_procattr_t> -> <apr_cmdtype_e> -> IO <apr_status_t>
#ccall apr_procattr_detach_set   , Ptr <apr_procattr_t> -> <apr_int32_t> -> IO <apr_status_t>

#if APR_HAVE_STRUCT_RLIMIT
-- FIXME: rlimit
-- #  ccall apr_procattr_limit_set  , Ptr <apr_procattr_t> -> <apr_int32_t> -> Ptr <rlimit> -> IO <apr_status_t>
#endif

#ccall apr_procattr_child_errfn_set, Ptr <apr_procattr_t> -> <apr_child_errfn_t> -> IO <apr_status_t>
#ccall apr_procattr_error_check_set, Ptr <apr_procattr_t> -> <apr_int32_t> -> IO <apr_status_t>
#ccall apr_procattr_addrspace_set  , Ptr <apr_procattr_t> -> <apr_int32_t> -> IO <apr_status_t>
#ccall apr_procattr_user_set       , Ptr <apr_procattr_t> -> Ptr CChar -> Ptr CChar -> IO <apr_status_t>
#ccall apr_procattr_group_set      , Ptr <apr_procattr_t> -> Ptr CChar -> Ptr <apr_status_t>

#if APR_HAS_FORK
#  ccall apr_proc_fork, Ptr <apr_proc_t> -> Ptr <apr_pool_t> -> IO <apr_status_t>
#endif

#ccall apr_proc_create        , Ptr <apr_proc_t> -> Ptr CChar -> Ptr (Ptr CChar) -> Ptr (Ptr CChar) -> Ptr <apr_procattr_t> -> Ptr <apr_pool_t> -> IO <apr_status_t>
#ccall apr_proc_wait          , Ptr <apr_proc_t> -> Ptr CInt -> Ptr <apr_exit_why_e> -> <apr_wait_how_e> -> IO <apr_status_t>
#ccall apr_proc_wait_all_procs, Ptr <apr_proc_t> -> Ptr CInt -> Ptr <apr_exit_why_e> -> <apr_wait_how_e> -> Ptr <apr_pool_t> -> IO <apr_status_t>

#num APR_PROC_DETACH_FOREGROUND
#num APR_PROC_DETACH_DAEMONIZE

#ccall apr_proc_detach                 , CInt -> IO <apr_status_t>
#ccall apr_proc_other_child_register   , Ptr <apr_proc_t> -> FunPtr (CInt -> Ptr () -> CInt -> IO ()) -> Ptr () -> Ptr <apr_file_t> -> Ptr <apr_pool_t> -> IO ()
#ccall apr_proc_other_child_unregister , Ptr () -> IO ()
#ccall apr_proc_other_child_alert      , Ptr <apr_proc_t> -> CInt -> CInt -> IO <apr_status_t>
#ccall apr_proc_other_child_refresh    , Ptr <apr_other_child_rec_t> -> CInt -> IO ()
#ccall apr_proc_other_child_refresh_all, CInt -> IO ()
#ccall apr_proc_kill                   , Ptr <apr_proc_t> -> CInt -> IO <apr_status_t>
#ccall apr_pool_note_subprocess        , Ptr <apr_pool_t> -> Ptr <apr_pool_t> -> <apr_kill_conditions_e> -> IO ()

#if APR_HAS_THREADS

#  if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2)
#    ccall apr_setup_signal_thread, IO <apr_status_t>
#    ccall apr_signal_thread      , FunPtr (CInt -> IO CInt) -> IO <apr_status_t>
#  endif

#  ccall apr_thread_pool_get, Ptr <apr_thread_t> -> IO (Ptr <apr_pool_t>)

#endif