Browse files

Made changes to ctx_op_data struct

  • Loading branch information...
1 parent 0b8e859 commit 3ce9c14a31c985ce525ab961e4c10fd64600f86e @sheik committed Jan 11, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/main.js
View
7 lib/main.js
@@ -47,12 +47,14 @@ const OPDATA_PASSWD = ctypes.unsigned_int(12);
* defined in context.h
* NOT YET COMPLETE
*/
-const ctx_op_data = new ctypes.StructType("ctx_op_data",
+var ctx_op_data = ctypes.StructType("ctx_op_data"); /* required for the self-pointer "next" */
+ctx_op_data.define(
[
{ "magic": ctypes.unsigned_long_long },
- { "next": ctypes.int.ptr }, // should be pointer to ctx_op_data
{ "type": ctypes.unsigned_int }, // ctx_op_data_id_t
+ { "next": ctx_op_data.ptr },
// void (*cleanup) (void *hook);
+ { "cleanup": ctypes.FunctionType(ctypes.default_abi, ctypes.voidptr_t).ptr }, // not sure if right
{ "hook": ctypes.voidptr_t },
{ "references": ctypes.int }
]);
@@ -81,7 +83,6 @@ const gpgme_context = new ctypes.StructType("gpgme_context",
// gpgme_sig_notation_t sig_notations;
{ "lc_ctype": ctypes.char.ptr },
{ "lc_message": ctypes.char.ptr },
- // ctx_op_data_t op_data;
{ "op_data": ctx_op_data_t },
// gpgme_passphrase_cb_t passphrase_cb;
{ "passphrase_cb_value": ctypes.voidptr_t },

0 comments on commit 3ce9c14

Please sign in to comment.