[Vala] About VAPI's instance position
- From: "????" <taozuhong qq com>
- To: "vala-list" <vala-list gnome org>
- Subject: [Vala] About VAPI's instance position
- Date: Sat, 22 Feb 2020 15:49:08 +0800
Hi guys,
I 'm have updating the openssl.vapi file, and met a trouble about instance position. the OpenSSL api as
follow:
-----------------------------------------------------------
#include <openssl/rsa.h>
int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding);
int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding);
-----------------------------------------------------------
translate to Vala vapi code as follow:
-----------------------------------------------------------
[Compact]
[CCode (lower_case_cprefix = "RSA_", cprefix = "RSA_", cheader_filename = "openssl/rsa.h", free_function =
"RSA_free")]
public class RSA
{
public int generate_key_ex(int bits, BIGNUM e, BN_GENCB? cb = null);
[CCode (instance_pos = 2.1)]
public int public_encrypt(int flen, [CCode (array_length = false)] uint8[] from, [CCode
(array_length = false)] uint8[] to, int padding);
[CCode (instance_pos = 2.1)]
public int private_decrypt(int flen, [CCode (array_length = false)] uint8[] from, [CCode
(array_length = false)] uint8[] to, int padding);
}
-----------------------------------------------------------
if set the instance_pos as 3, the compiler will output errors:
error: too few arguments to function 'RSA_public_encrypt'
if set the instance_pos as 2.1, the code can compile and will crashed at function public_encrypt /
private_decrypt,
I don't know how to set the instance_pos's value, could anybody give me some tips to fix this error?
thanks in advanced.
ZuHong Tao
2/22/2020
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]