Re: [Vala] Increasing the array_length in vapi by 1
- From: Luca Bruno <lethalman88 gmail com>
- To: Shawn Ferris <shawn ferris gmail com>
- Cc: Vala-list <Vala-list gnome org>
- Subject: Re: [Vala] Increasing the array_length in vapi by 1
- Date: Thu, 27 Oct 2011 09:51:31 +0200
On Thu, Oct 27, 2011 at 12:55 AM, Shawn Ferris <shawn ferris gmail com>wrote:
Hey All -- I have a binding where the method requires a uchar[] and a
length. Currently it works correctly in that the generated C passes the
correct length. Unfortunately, the length it's expecting is really length +
1. Is there any way to manipulate that through CCode to simplify the
binding? or do I have to disable array_length and explicitly pass the
length
+ 1?
You can create an helper method such as:
[CCode (cname = "this_is_the_real_function")]
private void _foo (uchar[] bar);
public void foo (uchar[] bar) {
bar.length++;
_foo (bar);
}
--
www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]