blob: a9f3d99ee1cdc7923e86a339380c9d654f13d4ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/* Example of a C++ extension to icon via loadfunc,
* without garbage collection difficulties.
* Type 'make iexample' to build.
* Carl Sturtivant, 2008/3/16
*/
#include "loadfuncpp.h"
using namespace Icon;
extern "C" int div(value argv[]) {
safe x(argv[1]), y(argv[2]), z;
z = ( x/y, x%y );
argv[0] = z;
return SUCCEEDED;
}
|