// Code generated by cmd/cgo; DO NOT EDIT.

//line /tmp/cgolife543373302/src/cgolife/life.go:1:1
// skip

// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package cgolife

// #include "life.h"
import _ "unsafe"

import "unsafe"

func Run(gen, x, y int, a []int32) {
	n := make([]int32, x*y)
	for i := 0; i < gen; i++ {
		( /*line :17:3*/_Cfunc_Step /*line :17:8*/)( /*line :17:10*/_Ctype_int /*line :17:15*/(x),  /*line :17:20*/_Ctype_int /*line :17:25*/(y), (* /*line :17:32*/_Ctype_int /*line :17:37*/)(unsafe.Pointer(&a[0])), (* /*line :17:65*/_Ctype_int /*line :17:70*/)(unsafe.Pointer(&n[0])))
		copy(a, n)
	}
}

// Keep the channels visible from Go.
var chans [4]chan bool

//export GoStart
// Double return value is just for testing.
func GoStart(i, xdim, ydim, xstart, xend, ystart, yend  /*line :27:56*/_Ctype_int /*line :27:61*/, a * /*line :27:66*/_Ctype_int /*line :27:71*/, n * /*line :27:76*/_Ctype_int /*line :27:81*/) (int, int) {
	c := make(chan bool, int(( /*line :28:27*/*_Cvar_MYCONST /*line :28:35*/)))
	go func() {
		( /*line :30:3*/_Cfunc_DoStep /*line :30:10*/)(xdim, ydim, xstart, xend, ystart, yend, a, n)
		c <- true
	}()
	chans[i] = c
	return int(i), int(i + 100)
}

//export GoWait
func GoWait(i  /*line :38:15*/_Ctype_int /*line :38:20*/) {
	<-chans[i]
	chans[i] = nil
}
