bu2b
New Member
Posts: 22
|
Post by bu2b on Mar 27, 2012 21:37:28 GMT 1
Could someone give me a brief rundown on importing library functions into Bacon?
What types etc can and can't, for instance, how would I handle a function that returns a structure i.e.:
typedef struct __MHASH_INSTANCE { mutils_word32 hmac_key_size; mutils_word32 hmac_block; mutils_word8 *hmac_key;
mutils_word8 *state; mutils_word32 state_size; hashid algorithm_given;
HASH_FUNC hash_func; FINAL_FUNC final_func; DEINIT_FUNC deinit_func; } MHASH_INSTANCE;
typedef MHASH_INSTANCE *MHASH;
** The library function
MHASH td;
td = mhash_init(MHASH_MD5);
Thanks.
|
|
|
Post by Pjot on Mar 28, 2012 12:21:17 GMT 1
Hi bu2b, If a function returns a C struct then a regular import is not possible, unless you want to start hacking around with the USEC statement. A similar discussion is at this post. Regards Peter
|
|