Skip to content

Commit

Permalink
Re-export enums, add instances (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCardwell committed Oct 8, 2024
1 parent b587cf4 commit 577e9dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hs-bindgen-libclang/src/HsBindgen/Clang/Doxygen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module HsBindgen.Clang.Doxygen (
-- * Comment type 'CXComment_Text'
, clang_TextComment_getText
-- * Comment type 'CXComment_InlineCommand'
, CXCommentInlineCommandRenderKind(..)
, clang_InlineCommandComment_getCommandName
, clang_InlineCommandComment_getRenderKind
, clang_InlineCommandComment_getNumArgs
Expand All @@ -37,6 +38,7 @@ module HsBindgen.Clang.Doxygen (
, clang_BlockCommandComment_getArgText
, clang_BlockCommandComment_getParagraph
-- * Comment type 'CXComment_ParamCommand'
, CXCommentParamPassDirection(..)
, clang_ParamCommandComment_getParamName
, clang_ParamCommandComment_isParamIndexValid
, clang_ParamCommandComment_getParamIndex
Expand Down
34 changes: 34 additions & 0 deletions hs-bindgen-libclang/src/HsBindgen/Clang/Doxygen/Instances.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,37 @@ instance IsSimpleEnum CXCommentKind where
simpleFromC (#const CXComment_FullComment) = Just CXComment_FullComment

simpleFromC _otherwise = Nothing

{-------------------------------------------------------------------------------
CXCommentInlineCommandRenderKind
-------------------------------------------------------------------------------}

instance IsSimpleEnum CXCommentInlineCommandRenderKind where
simpleToC CXCommentInlineCommandRenderKind_Normal = #const CXCommentInlineCommandRenderKind_Normal
simpleToC CXCommentInlineCommandRenderKind_Bold = #const CXCommentInlineCommandRenderKind_Bold
simpleToC CXCommentInlineCommandRenderKind_Monospaced = #const CXCommentInlineCommandRenderKind_Monospaced
simpleToC CXCommentInlineCommandRenderKind_Emphasized = #const CXCommentInlineCommandRenderKind_Emphasized
simpleToC CXCommentInlineCommandRenderKind_Anchor = #const CXCommentInlineCommandRenderKind_Anchor

simpleFromC (#const CXCommentInlineCommandRenderKind_Normal) = Just CXCommentInlineCommandRenderKind_Normal
simpleFromC (#const CXCommentInlineCommandRenderKind_Bold) = Just CXCommentInlineCommandRenderKind_Bold
simpleFromC (#const CXCommentInlineCommandRenderKind_Monospaced) = Just CXCommentInlineCommandRenderKind_Monospaced
simpleFromC (#const CXCommentInlineCommandRenderKind_Emphasized) = Just CXCommentInlineCommandRenderKind_Emphasized
simpleFromC (#const CXCommentInlineCommandRenderKind_Anchor) = Just CXCommentInlineCommandRenderKind_Anchor

simpleFromC _otherwise = Nothing

{-------------------------------------------------------------------------------
CXCommentParamPassDirection
-------------------------------------------------------------------------------}

instance IsSimpleEnum CXCommentParamPassDirection where
simpleToC CXCommentParamPassDirection_In = #const CXCommentParamPassDirection_In
simpleToC CXCommentParamPassDirection_Out = #const CXCommentParamPassDirection_Out
simpleToC CXCommentParamPassDirection_InOut = #const CXCommentParamPassDirection_InOut

simpleFromC (#const CXCommentParamPassDirection_In) = Just CXCommentParamPassDirection_In
simpleFromC (#const CXCommentParamPassDirection_Out) = Just CXCommentParamPassDirection_Out
simpleFromC (#const CXCommentParamPassDirection_InOut) = Just CXCommentParamPassDirection_InOut

simpleFromC _otherwise = Nothing

0 comments on commit 577e9dc

Please # to comment.