Update examples

This commit is contained in:
Don Stewart
2005-09-03 04:45:14 +00:00
parent 5321754614
commit dff0363224
421 changed files with 19 additions and 9 deletions

View File

@ -0,0 +1,16 @@
all:
@echo "test disabled"
#true_api::
# ( cd api ;\
# $(GHC) -Onot $(EXTRAFLAGS) -c $(API).hs ;\
# $(RM) -f libHSapi.a ;\
# $(AR) cq libHSapi.a API.o ;\
# $(RANLIB) libHSapi.a ;\
# $(LD) -r $(LD_X) $(WHOLE_ARCHIVE_FLAG) -o HSapi.o libHSapi.a ;\
# rm API.o ;\
# echo [] > package.conf ;\
# env PREFIX=`pwd` $(GHC_PKG) -f package.conf -u < package.conf.in )
# $(GHC) -package-conf ${TOP}/plugins.conf.inplace -package plugins \
# -package-conf api/package.conf -package api \
# -O $(EXTRAFLAGS) -c Null.hs

View File

@ -0,0 +1,6 @@
module Null ( resource ) where
import API
resource = plugin { a = 7 }

View File

@ -0,0 +1,10 @@
{-# OPTIONS -fglasgow-exts #-}
module API where
data Null = Null { a, b :: Int }
deriving Show
plugin :: Null
plugin = Null { a = 42 , b = 1 }

View File

@ -0,0 +1,18 @@
Package {
name = "api",
auto = False,
import_dirs = [ "${PREFIX}" ],
library_dirs = [ "${PREFIX}" ],
hs_libraries = [ "HSapi" ],
include_dirs = [],
c_includes = [],
source_dirs = [],
extra_libraries = [],
package_deps = [],
extra_ghc_opts = [],
extra_cc_opts = [],
extra_ld_opts = []
}

View File

View File

@ -0,0 +1,12 @@
{-# OPTIONS -cpp #-}
#include "../../../../config.h"
import System.Plugins
import API
main = do
let includes = TOP ++ "/testsuite/load/null/api"
(_,v) <- load "../Null.o" ["."] ["../api/package.conf"] "resource"
putStrLn ( show (a v) )