1/* BEGIN LICENSE BLOCK
2 * Version: CMPL 1.1
3 *
4 * The contents of this file are subject to the Cisco-style Mozilla Public
5 * License Version 1.1 (the "License"); you may not use this file except
6 * in compliance with the License.  You may obtain a copy of the License
7 * at www.eclipse-clp.org/license.
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11 * the License for the specific language governing rights and limitations
12 * under the License.
13 *
14 * The Original Code is  The ECLiPSe Constraint Logic Programming System.
15 * The Initial Developer of the Original Code is  Cisco Systems, Inc.
16 * Portions created by the Initial Developer are
17 * Copyright (C) 1997-2006 Cisco Systems, Inc.  All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * END LICENSE BLOCK */
22
23/*
24 * ECLiPSe LIBRARY MODULE
25 *
26 * $Id: eg_c_handle.c,v 1.1 2008/06/30 17:43:53 jschimpf Exp $
27 *
28 *
29 * IDENTIFICATION:	minimain.c
30 *
31 * AUTHOR:		Joachim Schimpf
32 * AUTHOR:		Stefano Novello
33 *
34 * CONTENTS:		name/arity
35 *
36 * DESCRIPTION:
37 *	Example of using handles
38 */
39
40#include	"eclipse.h"
41
42
43double my_array[5] = {1.1, 2.2, 3.3, 4.4, 5.5};
44
45main(argc, argv)
46int             argc;
47char          **argv;
48{
49    pword	X;
50
51    ec_init();
52
53    X = ec_newvar();
54    ec_post_goal(
55	ec_term(ec_did(",",2),
56	    ec_term(ec_did("xget",3),
57		ec_handle(&ec_xt_double_arr, my_array),
58		ec_long(3),
59		X),
60	    ec_term(ec_did("writeln",1), X)
61	)
62    );
63
64    ec_resume1(0);
65
66    ec_cleanup();
67    exit(0);
68}
69
70