1 /* Copyright 2011 The Go Authors. All rights reserved.
2 Use of this source code is governed by a BSD-style
3 license that can be found in the LICENSE file. */
5 /* A trivial example of wrapping a C library using SWIG. */
12 %typemap(gotype) const char * "string"
13 %typemap(in) const char * %{
14 $1 = malloc($input.n + 1);
15 memcpy($1, $input.p, $input.n);
18 %typemap(freearg) const char * %{
22 FILE *fopen(const char *name, const char *mode);