-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstage24.go
30 lines (23 loc) · 860 Bytes
/
stage24.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// package name: main
package main
/*
#include <stdio.h>
extern const char *stage25_blep(char *foo);
extern void hs_init(int *argc, char ***foo);
extern void hs_exit();
#cgo LDFLAGS: -L. -lstage25 -L/home/jaseg/ffi -L/home/jaseg/ffi/haskell-libs -lstage25 -L/usr/lib/ghc -lHSrts-ghc7.6.3 -lHSrts_thr_debug-ghc7.6.3 -lHSrts_debug-ghc7.6.3 -lHSrts_thr-ghc7.6.3 -lHStransformers-0.5.2.0-ghc7.6.3 -lHStext-1.2.2.1-ghc7.6.3 -lHSmtl-2.2.1-ghc7.6.3 -lHSparsec-3.1.9-ghc7.6.3
*/
import "C"
import "fmt"
import "os"
//export stage24_blep
func stage24_blep(cfoo *C.char) *C.char {
foo := C.GoString(cfoo)
fmt.Fprintln(os.Stderr, "Stage 24:", foo);
C.hs_init(nil, nil);
bar := C.GoString(C.stage25_blep(C.CString(foo)))
C.hs_exit();
fmt.Fprintln(os.Stderr, "Return value [24]:", bar);
return C.CString(bar)
}
func main() {} // CGO FTW!