Skip to content
Browse files

Add C export to Epic API

  • Loading branch information...
1 parent 96d7bf6 commit 3273ab28ab64ef91d464c58d0b73995cfc92a357 Edwin Brady committed May 13, 2012
Showing with 7 additions and 1 deletion.
  1. +6 −0 Epic/Epic.lhs
  2. +1 −1 epic.cabal
View
6 Epic/Epic.lhs
@@ -448,6 +448,8 @@ Remaining expression constructs
> -- | Top level declarations
> data EpicDecl = forall e. EpicFn e => EpicFn Name e -- ^ Normal function
+> | forall e. EpicFn e => EpicExportFn Name Type [Type] String e
+> -- ^ exported to C
> | EpicExt Name Int -- ^ Epic function defined in a separate .o
> | Include String -- ^ Include a C header
> | Link String -- ^ Link to a C library
@@ -467,6 +469,10 @@ Remaining expression constructs
> mkDecl :: EpicDecl -> Decl
> mkDecl (EpicFn n e) = Decl n TyAny (mkFunc e) Nothing []
+> mkDecl (EpicExportFn n rty tys cname e)
+> = Decl n rty (updateArgTys (mkFunc e)) (Just cname) []
+> where updateArgTys (Bind args l d f)
+> = Bind (zip (map fst args) tys) l d f
> mkDecl (EpicExt nm arity)
> = Epic.Language.Extern nm TyAny (take arity (repeat TyAny))
> mkDecl (Epic.Epic.Include f) = Epic.Language.Include f
View
2 epic.cabal
@@ -1,5 +1,5 @@
Name: epic
-Version: 0.9.3
+Version: 0.9.3.1
Author: Edwin Brady
License: BSD3
License-file: LICENSE

0 comments on commit 3273ab2

Please sign in to comment.
Something went wrong with that request. Please try again.