Return-Path: X-Original-To: apmail-incubator-etch-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-etch-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4714777B for ; Wed, 17 Aug 2011 16:37:49 +0000 (UTC) Received: (qmail 118 invoked by uid 500); 17 Aug 2011 16:37:49 -0000 Delivered-To: apmail-incubator-etch-user-archive@incubator.apache.org Received: (qmail 99974 invoked by uid 500); 17 Aug 2011 16:37:49 -0000 Mailing-List: contact etch-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: etch-user@incubator.apache.org Delivered-To: mailing list etch-user@incubator.apache.org Received: (qmail 99963 invoked by uid 99); 17 Aug 2011 16:37:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2011 16:37:49 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [62.245.222.98] (HELO mail.bmw-carit.de) (62.245.222.98) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Aug 2011 16:37:41 +0000 Received: from dc01.bmw-carit.intra ([192.168.100.4]:59190 helo=dc01.bmw-carit.de) by mail.bmw-carit.de with esmtps (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Qtj7B-0005o8-1l; Wed, 17 Aug 2011 18:37:13 +0200 Received: from DC01.bmw-carit.intra ([fe80::f19b:d2f0:2532:e4a8]) by DC01.bmw-carit.intra ([fe80::f19b:d2f0:2532:e4a8%20]) with mapi; Wed, 17 Aug 2011 18:37:13 +0200 X-CTCH-RefID: str=0001.0A0B020A.4E4BEE39.0110,ss=1,fgs=0 From: Martin Veith To: "etch-dev@incubator.apache.org" , "etch-user@incubator.apache.org" Date: Wed, 17 Aug 2011 18:37:12 +0200 Subject: RE: array element access in c-binding Thread-Topic: array element access in c-binding Thread-Index: Acxc8uf9bMXArs0HQwqq7spV4+KcpgABu6+Q Message-ID: <66BD268F973E3544A665E5F503FB38B70C08B4F8E3@DC01.bmw-carit.intra> References: <4E4BDF02.9070507@mac.com> In-Reply-To: <4E4BDF02.9070507@mac.com> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, de-DE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Scott, Please look at the examples below: Transferring Bytes: (the byte array showed below is converted to a native a= rray): if(is_etch_nativearray(data)) { etch_nativearray* na =3D (etch_nativearray*) data; if(na !=3D NULL && na->content_obj_type =3D=3D ETCHTYPEB_BYTE) { data_buffer =3D static_cast(na->values); data_length =3D static_cast(na->bytecount); } } Other data types e.g. Int32 (all data types except byte are encapsulated i= nto an EtchObject): if(is_etch_arrayvalue(data)) { Int32 length =3D arrayvalue_count(data); for(Int32 k =3D 0; k < length; k++) { etch_int32* content =3D NULL; content =3D (etch_int32*)arrayvalue_get(data, k); } } If you have further questions you can also send your code to us and we can = have a look at it. Cheers, Michael & Martin -----Original Message----- From: scott comer [mailto:wert1y@mac.com]=20 Sent: Mittwoch, 17. August 2011 17:32 To: etch-dev@incubator.apache.org; etch-user@incubator.apache.org Subject: array element access in c-binding thomas is bringing up the perf example from the etch examples with the=20 c-binding, and has the following trouble. for the method, sum, which takes an int[], it isn't clear how to fetch=20 the elements out of the array. in general, a quick pointer to working=20 with arrays would be helpful. thomas is working on a pilot project for us, here at spawn labs, to=20 bring up the c-binding in an image compare service which will be part of=20 our mostly java service cloud for game play. the c-binding is important=20 to us for other projects as well, including core communications for our=20 video appliance and dynamic firewall control. any help or examples would be appreciated. thanks, scott out