hs-bindgen-1.0.0.0: test-artefacts/fixtures/documentation/doxygen_docs/Example/Unsafe.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_HADDOCK prune #-}
module Example.Unsafe
( -- * Function Definitions
Example.Unsafe.process_data
, Example.Unsafe.process_file
, Example.Unsafe.calculate_value
, Example.Unsafe.html_example
, Example.Unsafe.list_example
, Example.Unsafe.dangerous_function
, Example.Unsafe.detailed_return_codes
, Example.Unsafe.old_function
, Example.Unsafe.versioned_function
, Example.Unsafe.process_buffer
, Example.Unsafe.my_memcpy
, Example.Unsafe.double_value
-- ** I/O Helpers
, Example.Unsafe.read_chunk
, Example.Unsafe.write_chunk
-- * Advanced Features
, Example.Unsafe.complex_function
, Example.Unsafe.hash
, Example.Unsafe.square
-- * Extra Doxygen Coverage
, Example.Unsafe.auto_brief_func
, Example.Unsafe.multi_paragraph_details
, Example.Unsafe.todo_remark_attention
, Example.Unsafe.html_entities_func
, Example.Unsafe.nested_inline_format
, Example.Unsafe.tagged_code_example
, Example.Unsafe.backslash_syntax
)
where
import qualified HsBindgen.Runtime.ConstantArray as CA
import qualified HsBindgen.Runtime.IsArray as IsA
import qualified HsBindgen.Runtime.LibC
import qualified HsBindgen.Runtime.PtrConst as PtrConst
import qualified HsBindgen.Runtime.Support as BG
import qualified HsBindgen.Runtime.Support.CAPI
import Example
import Prelude (IO, fmap)
$(HsBindgen.Runtime.Support.CAPI.addCSource (HsBindgen.Runtime.Support.CAPI.unlines
[ "#include <documentation/doxygen_docs.h>"
, "signed int hs_bindgen_e6085a910ba41ecb ("
, " uint8_t const *arg1,"
, " uint8_t *arg2,"
, " size_t *arg3"
, ")"
, "{"
, " return (process_data)(arg1, arg2, arg3);"
, "}"
, "_Bool hs_bindgen_c27e893aea0b0a77 ("
, " char const *arg1"
, ")"
, "{"
, " return (process_file)(arg1);"
, "}"
, "signed int hs_bindgen_bc1b0e25a72f4ec0 ("
, " signed int arg1,"
, " signed int arg2"
, ")"
, "{"
, " return (calculate_value)(arg1, arg2);"
, "}"
, "_Bool hs_bindgen_09abc3cb74562964 ("
, " signed int arg1"
, ")"
, "{"
, " return (html_example)(arg1);"
, "}"
, "_Bool hs_bindgen_47cba1a95d265f84 ("
, " char const **arg1,"
, " size_t arg2"
, ")"
, "{"
, " return (list_example)(arg1, arg2);"
, "}"
, "void *hs_bindgen_e065fc013e4eccd6 ("
, " void *arg1"
, ")"
, "{"
, " return (dangerous_function)(arg1);"
, "}"
, "signed int hs_bindgen_bc4f7e24b2ad4ace ("
, " char const *arg1"
, ")"
, "{"
, " return (detailed_return_codes)(arg1);"
, "}"
, "signed int hs_bindgen_8deec146389ae8b3 ("
, " signed int arg1"
, ")"
, "{"
, " return (old_function)(arg1);"
, "}"
, "signed int hs_bindgen_da2dcc1473935665 ("
, " signed int arg1"
, ")"
, "{"
, " return (versioned_function)(arg1);"
, "}"
, "signed int hs_bindgen_97c1191917e6eece ("
, " char *arg1,"
, " size_t arg2"
, ")"
, "{"
, " return (process_buffer)(arg1, arg2);"
, "}"
, "void *hs_bindgen_58253bb560dc3eb3 ("
, " void *arg1,"
, " void const *arg2,"
, " size_t arg3"
, ")"
, "{"
, " return (my_memcpy)(arg1, arg2, arg3);"
, "}"
, "signed int hs_bindgen_44dd19b16ee38e5b ("
, " signed int arg1"
, ")"
, "{"
, " return (double_value)(arg1);"
, "}"
, "signed int hs_bindgen_a7d2e6fe1e9b3164 ("
, " signed int arg1,"
, " void *arg2,"
, " size_t arg3"
, ")"
, "{"
, " return (read_chunk)(arg1, arg2, arg3);"
, "}"
, "signed int hs_bindgen_59f0c5ef262c5f3b ("
, " signed int arg1,"
, " void const *arg2,"
, " size_t arg3"
, ")"
, "{"
, " return (write_chunk)(arg1, arg2, arg3);"
, "}"
, "status_code_t hs_bindgen_fd6fce7c8d8b2f79 ("
, " config_t *arg1,"
, " uint8_t const *arg2,"
, " size_t arg3"
, ")"
, "{"
, " return (complex_function)(arg1, arg2, arg3);"
, "}"
, "signed int hs_bindgen_dd36c8b317ccfcc4 ("
, " char *arg1"
, ")"
, "{"
, " return (hash)(arg1);"
, "}"
, "signed int hs_bindgen_6875e30a7fe8d30a ("
, " signed int arg1"
, ")"
, "{"
, " return (square)(arg1);"
, "}"
, "signed int hs_bindgen_3094fd32a3eedd49 ("
, " signed int arg1"
, ")"
, "{"
, " return (auto_brief_func)(arg1);"
, "}"
, "void hs_bindgen_73270d34a2bf31b5 ("
, " char *arg1,"
, " size_t arg2"
, ")"
, "{"
, " (multi_paragraph_details)(arg1, arg2);"
, "}"
, "signed int *hs_bindgen_836de64a94d7bf03 ("
, " signed int arg1"
, ")"
, "{"
, " return (todo_remark_attention)(arg1);"
, "}"
, "signed int hs_bindgen_aa0467b9d3b1a48d ("
, " signed int arg1"
, ")"
, "{"
, " return (html_entities_func)(arg1);"
, "}"
, "void hs_bindgen_b654d8047edfed77 ("
, " signed int arg1"
, ")"
, "{"
, " (nested_inline_format)(arg1);"
, "}"
, "signed int hs_bindgen_aeb274aded3470e5 ("
, " signed int arg1"
, ")"
, "{"
, " return (tagged_code_example)(arg1);"
, "}"
, "signed int hs_bindgen_907720dffab9442a ("
, " char const *arg1,"
, " char *arg2"
, ")"
, "{"
, " return (backslash_syntax)(arg1, arg2);"
, "}"
]))
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_process_data@
foreign import ccall unsafe "hs_bindgen_e6085a910ba41ecb" hs_bindgen_e6085a910ba41ecb_base ::
BG.Ptr BG.Void
-> BG.Ptr BG.Void
-> BG.Ptr BG.Void
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_process_data@
hs_bindgen_e6085a910ba41ecb ::
PtrConst.PtrConst HsBindgen.Runtime.LibC.Word8
-> BG.Ptr HsBindgen.Runtime.LibC.Word8
-> BG.Ptr HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
hs_bindgen_e6085a910ba41ecb =
\x0 ->
\x1 ->
\x2 ->
fmap BG.fromFFIType (hs_bindgen_e6085a910ba41ecb_base (BG.toFFIType x0) (BG.toFFIType x1) (BG.toFFIType x2))
{-| Function with detailed parameter documentation.
This function shows different parameter directions and types.
[__@input_data@ /(input)/__]: Input data buffer
[__@output_data@ /(output)/__]: Output data buffer
[__@size@ /(input,output)/__]: Size of data, updated on return
__Returns:__ Status code (0 = success, -1 = error)
__C declaration:__ @process_data@
__defined at:__ @documentation\/doxygen_docs.h 111:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
process_data ::
PtrConst.PtrConst HsBindgen.Runtime.LibC.Word8
{- ^
[__@input_data@ /(input)/__]: Input data buffer
__C declaration:__ @input_data@
-}
-> BG.Ptr HsBindgen.Runtime.LibC.Word8
{- ^
[__@output_data@ /(output)/__]: Output data buffer
__C declaration:__ @output_data@
-}
-> BG.Ptr HsBindgen.Runtime.LibC.CSize
{- ^
[__@size@ /(input,output)/__]: Size of data, updated on return
__C declaration:__ @size@
-}
-> IO BG.CInt
process_data = hs_bindgen_e6085a910ba41ecb
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_process_file@
foreign import ccall unsafe "hs_bindgen_c27e893aea0b0a77" hs_bindgen_c27e893aea0b0a77_base ::
BG.Ptr BG.Void
-> IO BG.CBool
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_process_file@
hs_bindgen_c27e893aea0b0a77 ::
PtrConst.PtrConst BG.CChar
-> IO BG.CBool
hs_bindgen_c27e893aea0b0a77 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_c27e893aea0b0a77_base (BG.toFFIType x0))
{-| Function with inline commands and formatting.
This function uses @inline@ @code@ formatting and __bold__ text. It also demonstrates /emphasized/ text.
[__@filename@__]: The @char*@ filename to process
__Returns:__ @true@ if successful, @false@ otherwise
__C declaration:__ @process_file@
__defined at:__ @documentation\/doxygen_docs.h 122:6@
__exported by:__ @documentation\/doxygen_docs.h@
-}
process_file ::
PtrConst.PtrConst BG.CChar
{- ^
[__@filename@__]: The @char*@ filename to process
__C declaration:__ @filename@
-}
-> IO BG.CBool
process_file = hs_bindgen_c27e893aea0b0a77
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_calculate_value@
foreign import ccall unsafe "hs_bindgen_bc1b0e25a72f4ec0" hs_bindgen_bc1b0e25a72f4ec0_base ::
BG.CInt
-> BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_calculate_value@
hs_bindgen_bc1b0e25a72f4ec0 ::
BG.CInt
-> BG.CInt
-> IO BG.CInt
hs_bindgen_bc1b0e25a72f4ec0 =
\x0 ->
\x1 ->
fmap BG.fromFFIType (hs_bindgen_bc1b0e25a72f4ec0_base (BG.toFFIType x0) (BG.toFFIType x1))
{-| Function with verbatim code blocks.
Example usage:
@
int result = calculate_value(10, 20);
printf("Result: %d\n", result);
@
[__@base@__]: Base value
[__@multiplier@__]: Multiplier value
__Returns:__ Calculated result
__C declaration:__ @calculate_value@
__defined at:__ @documentation\/doxygen_docs.h 137:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
calculate_value ::
BG.CInt
{- ^
[__@base@__]: Base value
__C declaration:__ @base@
-}
-> BG.CInt
{- ^
[__@multiplier@__]: Multiplier value
__C declaration:__ @multiplier@
-}
-> IO BG.CInt
calculate_value = hs_bindgen_bc1b0e25a72f4ec0
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_html_example@
foreign import ccall unsafe "hs_bindgen_09abc3cb74562964" hs_bindgen_09abc3cb74562964_base ::
BG.CInt
-> IO BG.CBool
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_html_example@
hs_bindgen_09abc3cb74562964 ::
BG.CInt
-> IO BG.CBool
hs_bindgen_09abc3cb74562964 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_09abc3cb74562964_base (BG.toFFIType x0))
{-| Function with HTML formatting.
This function demonstrates __HTML bold__ and /italic/ text. It also shows @HTML code@ formatting.
Input
Output
0
false
1
true
[__@value@__]: Input value
__Returns:__ Boolean result
__C declaration:__ @html_example@
__defined at:__ @documentation\/doxygen_docs.h 154:6@
__exported by:__ @documentation\/doxygen_docs.h@
-}
html_example ::
BG.CInt
{- ^
[__@value@__]: Input value
__C declaration:__ @value@
-}
-> IO BG.CBool
html_example = hs_bindgen_09abc3cb74562964
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_list_example@
foreign import ccall unsafe "hs_bindgen_47cba1a95d265f84" hs_bindgen_47cba1a95d265f84_base ::
BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CBool
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_list_example@
hs_bindgen_47cba1a95d265f84 ::
BG.Ptr (PtrConst.PtrConst BG.CChar)
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CBool
hs_bindgen_47cba1a95d265f84 =
\x0 ->
\x1 ->
fmap BG.fromFFIType (hs_bindgen_47cba1a95d265f84_base (BG.toFFIType x0) (BG.toFFIType x1))
{-| Function with lists and special formatting.
This function demonstrates:
* Bullet point lists
* Nested list item 1
* Nested list item 2
* Multiple items
* Nested formatting
Numbered list:
1. First @item@ 1. item
2. Second __item__
3. Third item
Other numbered list:
1. A
2. B
3. C
[__@items@__]: Array of items
[__@count@__]: Number of items
__Returns:__ Success status
__C declaration:__ @list_example@
__defined at:__ @documentation\/doxygen_docs.h 180:6@
__exported by:__ @documentation\/doxygen_docs.h@
-}
list_example ::
BG.Ptr (PtrConst.PtrConst BG.CChar)
{- ^
[__@items@__]: Array of items
__C declaration:__ @items@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@count@__]: Number of items
__C declaration:__ @count@
-}
-> IO BG.CBool
list_example = hs_bindgen_47cba1a95d265f84
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_dangerous_function@
foreign import ccall unsafe "hs_bindgen_e065fc013e4eccd6" hs_bindgen_e065fc013e4eccd6_base ::
BG.Ptr BG.Void
-> IO (BG.Ptr BG.Void)
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_dangerous_function@
hs_bindgen_e065fc013e4eccd6 ::
BG.Ptr BG.Void
-> IO (BG.Ptr BG.Void)
hs_bindgen_e065fc013e4eccd6 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_e065fc013e4eccd6_base (BG.toFFIType x0))
{-| Function with warnings and notes.
__WARNING:__ This function may cause side effects
__Note:__ Use with caution in multithreaded environments
__See:__ related_function() for similar functionality
[__@ptr@__]: Pointer to data
__Returns:__ Modified pointer
__C declaration:__ @dangerous_function@
__defined at:__ @documentation\/doxygen_docs.h 192:7@
__exported by:__ @documentation\/doxygen_docs.h@
-}
dangerous_function ::
BG.Ptr BG.Void
{- ^
[__@ptr@__]: Pointer to data
__C declaration:__ @ptr@
-}
-> IO (BG.Ptr BG.Void)
dangerous_function = hs_bindgen_e065fc013e4eccd6
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_detailed_return_codes@
foreign import ccall unsafe "hs_bindgen_bc4f7e24b2ad4ace" hs_bindgen_bc4f7e24b2ad4ace_base ::
BG.Ptr BG.Void
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_detailed_return_codes@
hs_bindgen_bc4f7e24b2ad4ace ::
PtrConst.PtrConst BG.CChar
-> IO BG.CInt
hs_bindgen_bc4f7e24b2ad4ace =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_bc4f7e24b2ad4ace_base (BG.toFFIType x0))
{-| Function with return value details.
[__@input@__]: Input string
[__@0@__]: Success
[__@-1@__]: Invalid input
[__@-2@__]: Memory allocation failed
[__@-3@__]: Processing error
__C declaration:__ @detailed_return_codes@
__defined at:__ @documentation\/doxygen_docs.h 203:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
detailed_return_codes ::
PtrConst.PtrConst BG.CChar
{- ^
[__@input@__]: Input string
__C declaration:__ @input@
-}
-> IO BG.CInt
detailed_return_codes = hs_bindgen_bc4f7e24b2ad4ace
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_old_function@
foreign import ccall unsafe "hs_bindgen_8deec146389ae8b3" hs_bindgen_8deec146389ae8b3_base ::
BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_old_function@
hs_bindgen_8deec146389ae8b3 ::
BG.CInt
-> IO BG.CInt
hs_bindgen_8deec146389ae8b3 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_8deec146389ae8b3_base (BG.toFFIType x0))
{-| Function with deprecated annotation.
__Deprecated:__ Use new_function() instead
[__@old_param@__]: Legacy parameter
__Returns:__ Legacy result
__C declaration:__ @old_function@
__defined at:__ @documentation\/doxygen_docs.h 212:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
old_function ::
BG.CInt
{- ^
[__@old_param@__]: Legacy parameter
__C declaration:__ @old_param@
-}
-> IO BG.CInt
old_function = hs_bindgen_8deec146389ae8b3
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_versioned_function@
foreign import ccall unsafe "hs_bindgen_da2dcc1473935665" hs_bindgen_da2dcc1473935665_base ::
BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_versioned_function@
hs_bindgen_da2dcc1473935665 ::
BG.CInt
-> IO BG.CInt
hs_bindgen_da2dcc1473935665 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_da2dcc1473935665_base (BG.toFFIType x0))
{-| Function with version information.
@since 1.0
__Version:__ 1.2
[__@data@__]: Input data
__Returns:__ Processed data
__C declaration:__ @versioned_function@
__defined at:__ @documentation\/doxygen_docs.h 222:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
versioned_function ::
BG.CInt
{- ^
[__@data@__]: Input data
__C declaration:__ @data@
-}
-> IO BG.CInt
versioned_function = hs_bindgen_da2dcc1473935665
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_process_buffer@
foreign import ccall unsafe "hs_bindgen_97c1191917e6eece" hs_bindgen_97c1191917e6eece_base ::
BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_process_buffer@
hs_bindgen_97c1191917e6eece ::
BG.Ptr (IsA.Elem (CA.ConstantArray 64 BG.CChar))
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
hs_bindgen_97c1191917e6eece =
\x0 ->
\x1 ->
fmap BG.fromFFIType (hs_bindgen_97c1191917e6eece_base (BG.toFFIType x0) (BG.toFFIType x1))
{-| Static array parameter.
[__@buffer@__]: Buffer with minimum size
[__@size@__]: Actual buffer size
__Returns:__ Number of bytes written
__C declaration:__ @process_buffer@
__defined at:__ @documentation\/doxygen_docs.h 338:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
process_buffer ::
BG.Ptr (IsA.Elem (CA.ConstantArray 64 BG.CChar))
{- ^
[__@buffer@__]: Buffer with minimum size
__C declaration:__ @buffer@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@size@__]: Actual buffer size
__C declaration:__ @size@
-}
-> IO BG.CInt
process_buffer = hs_bindgen_97c1191917e6eece
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_my_memcpy@
foreign import ccall unsafe "hs_bindgen_58253bb560dc3eb3" hs_bindgen_58253bb560dc3eb3_base ::
BG.Ptr BG.Void
-> BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO (BG.Ptr BG.Void)
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_my_memcpy@
hs_bindgen_58253bb560dc3eb3 ::
BG.Ptr BG.Void
-> PtrConst.PtrConst BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO (BG.Ptr BG.Void)
hs_bindgen_58253bb560dc3eb3 =
\x0 ->
\x1 ->
\x2 ->
fmap BG.fromFFIType (hs_bindgen_58253bb560dc3eb3_base (BG.toFFIType x0) (BG.toFFIType x1) (BG.toFFIType x2))
{-| Function with restrict pointers.
[__@dest@__]: Destination buffer (restrict)
[__@src@__]: Source buffer (restrict)
[__@n@__]: Number of bytes
__Returns:__ Destination pointer
__C declaration:__ @my_memcpy@
__defined at:__ @documentation\/doxygen_docs.h 348:7@
__exported by:__ @documentation\/doxygen_docs.h@
-}
my_memcpy ::
BG.Ptr BG.Void
{- ^
[__@dest@__]: Destination buffer (restrict)
__C declaration:__ @dest@
-}
-> PtrConst.PtrConst BG.Void
{- ^
[__@src@__]: Source buffer (restrict)
__C declaration:__ @src@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@n@__]: Number of bytes
__C declaration:__ @n@
-}
-> IO (BG.Ptr BG.Void)
my_memcpy = hs_bindgen_58253bb560dc3eb3
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_double_value@
foreign import ccall unsafe "hs_bindgen_44dd19b16ee38e5b" hs_bindgen_44dd19b16ee38e5b_base ::
BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_double_value@
hs_bindgen_44dd19b16ee38e5b ::
BG.CInt
-> IO BG.CInt
hs_bindgen_44dd19b16ee38e5b =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_44dd19b16ee38e5b_base (BG.toFFIType x0))
{-| Inline function.
[__@x@__]: Input value
__Returns:__ Doubled value
__C declaration:__ @double_value@
__defined at:__ @documentation\/doxygen_docs.h 356:19@
__exported by:__ @documentation\/doxygen_docs.h@
-}
double_value ::
BG.CInt
{- ^
[__@x@__]: Input value
__C declaration:__ @x@
-}
-> IO BG.CInt
double_value = hs_bindgen_44dd19b16ee38e5b
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_read_chunk@
foreign import ccall unsafe "hs_bindgen_a7d2e6fe1e9b3164" hs_bindgen_a7d2e6fe1e9b3164_base ::
BG.CInt
-> BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_read_chunk@
hs_bindgen_a7d2e6fe1e9b3164 ::
BG.CInt
-> BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
hs_bindgen_a7d2e6fe1e9b3164 =
\x0 ->
\x1 ->
\x2 ->
fmap BG.fromFFIType (hs_bindgen_a7d2e6fe1e9b3164_base (BG.toFFIType x0) (BG.toFFIType x1) (BG.toFFIType x2))
{-| Read a chunk of bytes into the provided buffer.
Demonstrates a section nested inside @functions@ .
[__@fd@__]: File descriptor
[__@buf@__]: Output buffer
[__@count@__]: Number of bytes to read
__Returns:__ Number of bytes read
__C declaration:__ @read_chunk@
__defined at:__ @documentation\/doxygen_docs.h 387:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
read_chunk ::
BG.CInt
{- ^
[__@fd@__]: File descriptor
__C declaration:__ @fd@
-}
-> BG.Ptr BG.Void
{- ^
[__@buf@__]: Output buffer
__C declaration:__ @buf@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@count@__]: Number of bytes to read
__C declaration:__ @count@
-}
-> IO BG.CInt
read_chunk = hs_bindgen_a7d2e6fe1e9b3164
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_write_chunk@
foreign import ccall unsafe "hs_bindgen_59f0c5ef262c5f3b" hs_bindgen_59f0c5ef262c5f3b_base ::
BG.CInt
-> BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_write_chunk@
hs_bindgen_59f0c5ef262c5f3b ::
BG.CInt
-> PtrConst.PtrConst BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
hs_bindgen_59f0c5ef262c5f3b =
\x0 ->
\x1 ->
\x2 ->
fmap BG.fromFFIType (hs_bindgen_59f0c5ef262c5f3b_base (BG.toFFIType x0) (BG.toFFIType x1) (BG.toFFIType x2))
{-| Write a chunk of bytes from the provided buffer.
[__@fd@__]: File descriptor
[__@buf@__]: Input buffer
[__@count@__]: Number of bytes to write
__Returns:__ Number of bytes written
__C declaration:__ @write_chunk@
__defined at:__ @documentation\/doxygen_docs.h 397:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
write_chunk ::
BG.CInt
{- ^
[__@fd@__]: File descriptor
__C declaration:__ @fd@
-}
-> PtrConst.PtrConst BG.Void
{- ^
[__@buf@__]: Input buffer
__C declaration:__ @buf@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@count@__]: Number of bytes to write
__C declaration:__ @count@
-}
-> IO BG.CInt
write_chunk = hs_bindgen_59f0c5ef262c5f3b
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_complex_function@
foreign import ccall unsafe "hs_bindgen_fd6fce7c8d8b2f79" hs_bindgen_fd6fce7c8d8b2f79_base ::
BG.Ptr BG.Void
-> BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_complex_function@
hs_bindgen_fd6fce7c8d8b2f79 ::
BG.Ptr Config_t
-> PtrConst.PtrConst HsBindgen.Runtime.LibC.Word8
-> HsBindgen.Runtime.LibC.CSize
-> IO Status_code_t
hs_bindgen_fd6fce7c8d8b2f79 =
\x0 ->
\x1 ->
\x2 ->
fmap BG.fromFFIType (hs_bindgen_fd6fce7c8d8b2f79_base (BG.toFFIType x0) (BG.toFFIType x1) (BG.toFFIType x2))
{-| Function with complex documentation.
This function demonstrates multiple documentation features:
__Description:__
Performs complex data processing with multiple steps.
__Algorithm:__
1. Validate input parameters
2. Allocate temporary buffers
3. Process data in chunks
4. Clean up resources
__Algorithm2:__
* Validate input parameters
* Allocate temporary buffers
* Process data in chunks
* Clean up resources
__Example:__
@
config_t cfg = {
.id = 1,
.name = "test",
.flags = 0,
.callback = my_callback,
.user_data = NULL
};
status_code_t result = complex_function(&cfg, data, size);
if (result != STATUS_OK) {
handle_error(result);
}
@
[__@config@__]: Configuration structure (see 'Config_t' )
[__@data@__]: Input data buffer
[__@size@__]: Size of input data
__Returns:__ Status code indicating success or failure
__Precondition:__ config must not be NULL
__Precondition:__ data must not be NULL if size > 0
__Postcondition:__ Output data is written to config->user_data
__WARNING:__ May return NULL if memory allocation fails
__WARNING:__ Sets errno to EINVAL if parameters are invalid
__C declaration:__ @complex_function@
__defined at:__ @documentation\/doxygen_docs.h 459:15@
__exported by:__ @documentation\/doxygen_docs.h@
-}
complex_function ::
BG.Ptr Config_t
{- ^
[__@config@__]: Configuration structure (see 'Config_t' )
__C declaration:__ @config@
-}
-> PtrConst.PtrConst HsBindgen.Runtime.LibC.Word8
{- ^
[__@data@__]: Input data buffer
__C declaration:__ @data@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@size@__]: Size of input data
__C declaration:__ @size@
-}
-> IO Status_code_t
complex_function = hs_bindgen_fd6fce7c8d8b2f79
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_hash@
foreign import ccall unsafe "hs_bindgen_dd36c8b317ccfcc4" hs_bindgen_dd36c8b317ccfcc4_base ::
BG.Ptr BG.Void
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_hash@
hs_bindgen_dd36c8b317ccfcc4 ::
BG.Ptr BG.CChar
-> IO BG.CInt
hs_bindgen_dd36c8b317ccfcc4 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_dd36c8b317ccfcc4_base (BG.toFFIType x0))
{-|
Marked @__attribute((pure))__@
__C declaration:__ @hash@
__defined at:__ @documentation\/doxygen_docs.h 463:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
hash ::
BG.Ptr BG.CChar
-- ^ __C declaration:__ @s@
-> IO BG.CInt
hash = hs_bindgen_dd36c8b317ccfcc4
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_square@
foreign import ccall unsafe "hs_bindgen_6875e30a7fe8d30a" hs_bindgen_6875e30a7fe8d30a_base ::
BG.CInt
-> BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_square@
hs_bindgen_6875e30a7fe8d30a ::
BG.CInt
-> BG.CInt
hs_bindgen_6875e30a7fe8d30a =
\x0 ->
BG.fromFFIType (hs_bindgen_6875e30a7fe8d30a_base (BG.toFFIType x0))
{-|
Marked @__attribute((const))__@
__C declaration:__ @square@
__defined at:__ @documentation\/doxygen_docs.h 465:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
square ::
BG.CInt
-- ^ __C declaration:__ @x@
-> BG.CInt
square = hs_bindgen_6875e30a7fe8d30a
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_auto_brief_func@
foreign import ccall unsafe "hs_bindgen_3094fd32a3eedd49" hs_bindgen_3094fd32a3eedd49_base ::
BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_auto_brief_func@
hs_bindgen_3094fd32a3eedd49 ::
BG.CInt
-> IO BG.CInt
hs_bindgen_3094fd32a3eedd49 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_3094fd32a3eedd49_base (BG.toFFIType x0))
{-| Auto-brief function without explicit @brief tag.
This tests that the first sentence is used as the brief description when no explicit @brief is present.
[__@x@__]: The input value
__Returns:__ The negated value
__C declaration:__ @auto_brief_func@
__defined at:__ @documentation\/doxygen_docs.h 486:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
auto_brief_func ::
BG.CInt
{- ^
[__@x@__]: The input value
__C declaration:__ @x@
-}
-> IO BG.CInt
auto_brief_func = hs_bindgen_3094fd32a3eedd49
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_multi_paragraph_details@
foreign import ccall unsafe "hs_bindgen_73270d34a2bf31b5" hs_bindgen_73270d34a2bf31b5_base ::
BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.CSize
-> IO ()
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_multi_paragraph_details@
hs_bindgen_73270d34a2bf31b5 ::
BG.Ptr BG.CChar
-> HsBindgen.Runtime.LibC.CSize
-> IO ()
hs_bindgen_73270d34a2bf31b5 =
\x0 ->
\x1 ->
hs_bindgen_73270d34a2bf31b5_base (BG.toFFIType x0) (BG.toFFIType x1)
{-| Multi-paragraph details.
First paragraph of the detailed description. This explains the basic purpose of the function.
Second paragraph with more context. This includes information about the algorithm and its complexity, which is O(n) in the input size.
Third paragraph with usage notes. Callers should ensure that the buffer is large enough before calling this function.
[__@buf@__]: Output buffer
[__@len@__]: Buffer length
__C declaration:__ @multi_paragraph_details@
__defined at:__ @documentation\/doxygen_docs.h 503:6@
__exported by:__ @documentation\/doxygen_docs.h@
-}
multi_paragraph_details ::
BG.Ptr BG.CChar
{- ^
[__@buf@__]: Output buffer
__C declaration:__ @buf@
-}
-> HsBindgen.Runtime.LibC.CSize
{- ^
[__@len@__]: Buffer length
__C declaration:__ @len@
-}
-> IO ()
multi_paragraph_details = hs_bindgen_73270d34a2bf31b5
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_todo_remark_attention@
foreign import ccall unsafe "hs_bindgen_836de64a94d7bf03" hs_bindgen_836de64a94d7bf03_base ::
BG.CInt
-> IO (BG.Ptr BG.Void)
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_todo_remark_attention@
hs_bindgen_836de64a94d7bf03 ::
BG.CInt
-> IO (BG.Ptr BG.CInt)
hs_bindgen_836de64a94d7bf03 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_836de64a94d7bf03_base (BG.toFFIType x0))
{-| Function with @todo and @remark.
__Todo:__ Optimize this function for large inputs
Add support for negative values
__Remark:__ This function is thread-safe
__ATTENTION:__ The caller must free the returned pointer
[__@n@__]: Input count
__Returns:__ Allocated array
__C declaration:__ @todo_remark_attention@
__defined at:__ @documentation\/doxygen_docs.h 516:6@
__exported by:__ @documentation\/doxygen_docs.h@
-}
todo_remark_attention ::
BG.CInt
{- ^
[__@n@__]: Input count
__C declaration:__ @n@
-}
-> IO (BG.Ptr BG.CInt)
todo_remark_attention = hs_bindgen_836de64a94d7bf03
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_html_entities_func@
foreign import ccall unsafe "hs_bindgen_aa0467b9d3b1a48d" hs_bindgen_aa0467b9d3b1a48d_base ::
BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_html_entities_func@
hs_bindgen_aa0467b9d3b1a48d ::
BG.CInt
-> IO BG.CInt
hs_bindgen_aa0467b9d3b1a48d =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_aa0467b9d3b1a48d_base (BG.toFFIType x0))
{-| HTML entities: & means AND, <tag> is a tag.
Handles values < 0 and values > 100 differently. Copyright 2025.
[__@x@__]: Input (> 0 required)
__Returns:__ Result code
__C declaration:__ @html_entities_func@
__defined at:__ @documentation\/doxygen_docs.h 538:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
html_entities_func ::
BG.CInt
{- ^
[__@x@__]: Input (> 0 required)
__C declaration:__ @x@
-}
-> IO BG.CInt
html_entities_func = hs_bindgen_aa0467b9d3b1a48d
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_nested_inline_format@
foreign import ccall unsafe "hs_bindgen_b654d8047edfed77" hs_bindgen_b654d8047edfed77_base ::
BG.CInt
-> IO ()
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_nested_inline_format@
hs_bindgen_b654d8047edfed77 ::
BG.CInt
-> IO ()
hs_bindgen_b654d8047edfed77 =
\x0 ->
hs_bindgen_b654d8047edfed77_base (BG.toFFIType x0)
{-| Nested inline: __bold__ , @code@ , __@bold_code@ ,__ /__emph_bold__ ./
[__@x@__]: Input value
__C declaration:__ @nested_inline_format@
__defined at:__ @documentation\/doxygen_docs.h 545:6@
__exported by:__ @documentation\/doxygen_docs.h@
-}
nested_inline_format ::
BG.CInt
{- ^
[__@x@__]: Input value
__C declaration:__ @x@
-}
-> IO ()
nested_inline_format = hs_bindgen_b654d8047edfed77
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_tagged_code_example@
foreign import ccall unsafe "hs_bindgen_aeb274aded3470e5" hs_bindgen_aeb274aded3470e5_base ::
BG.CInt
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_tagged_code_example@
hs_bindgen_aeb274aded3470e5 ::
BG.CInt
-> IO BG.CInt
hs_bindgen_aeb274aded3470e5 =
\x0 ->
fmap BG.fromFFIType (hs_bindgen_aeb274aded3470e5_base (BG.toFFIType x0))
{-| Language-tagged code block.
Example usage:
@
int result = tagged_code_example(42);
printf("Result: %d\n", result);
@
[__@x@__]: Input value
__Returns:__ Processed value
__C declaration:__ @tagged_code_example@
__defined at:__ @documentation\/doxygen_docs.h 559:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
tagged_code_example ::
BG.CInt
{- ^
[__@x@__]: Input value
__C declaration:__ @x@
-}
-> IO BG.CInt
tagged_code_example = hs_bindgen_aeb274aded3470e5
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_backslash_syntax@
foreign import ccall unsafe "hs_bindgen_907720dffab9442a" hs_bindgen_907720dffab9442a_base ::
BG.Ptr BG.Void
-> BG.Ptr BG.Void
-> IO BG.CInt
-- __unique:__ @test_documentationdoxygen_docs_Example_Unsafe_backslash_syntax@
hs_bindgen_907720dffab9442a ::
PtrConst.PtrConst BG.CChar
-> BG.Ptr BG.CChar
-> IO BG.CInt
hs_bindgen_907720dffab9442a =
\x0 ->
\x1 ->
fmap BG.fromFFIType (hs_bindgen_907720dffab9442a_base (BG.toFFIType x0) (BG.toFFIType x1))
{-| Function documented with backslash syntax.
This function uses backslash commands instead of @ commands to verify both syntaxes are handled equivalently.
[__@input@__]: The input string
[__@output@__]: The output buffer
__Returns:__ Number of bytes written
__See:__ 'auto_brief_func'
@since 2.0
__C declaration:__ @backslash_syntax@
__defined at:__ @documentation\/doxygen_docs.h 574:5@
__exported by:__ @documentation\/doxygen_docs.h@
-}
backslash_syntax ::
PtrConst.PtrConst BG.CChar
{- ^
[__@input@__]: The input string
__C declaration:__ @input@
-}
-> BG.Ptr BG.CChar
{- ^
[__@output@__]: The output buffer
__C declaration:__ @output@
-}
-> IO BG.CInt
backslash_syntax = hs_bindgen_907720dffab9442a