gpgme 2.0.18 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/gpgme/extconf.rb +11 -10
- data/ext/gpgme/gpgme_n.c +457 -454
- data/lib/gpgme/crypto.rb +1 -1
- data/lib/gpgme/ctx.rb +3 -2
- data/lib/gpgme/data.rb +10 -2
- data/lib/gpgme/engine.rb +1 -1
- data/lib/gpgme/key.rb +13 -1
- data/lib/gpgme/version.rb +1 -1
- data/ports/archives/gpgme-1.18.0.tar.bz2 +0 -0
- data/ports/archives/libassuan-2.5.5.tar.bz2 +0 -0
- data/ports/archives/libgpg-error-1.46.tar.bz2 +0 -0
- data/test/crypto_test.rb +7 -16
- data/test/ctx_test.rb +25 -74
- data/test/files/testkey_pub_invalid.gpg +52 -0
- data/test/key_test.rb +20 -4
- data/test/pinentry +22 -0
- data/test/sub_key_test.rb +5 -2
- data/test/support/resources.rb +30 -0
- data/test/test_helper.rb +6 -0
- metadata +18 -20
- data/ports/archives/gpgme-1.12.0.tar.bz2 +0 -0
- data/ports/archives/gpgme-1.9.0.tar.bz2 +0 -0
- data/ports/archives/libassuan-2.4.3.tar.bz2 +0 -0
- data/ports/archives/libassuan-2.5.1.tar.bz2 +0 -0
- data/ports/archives/libgpg-error-1.27.tar.bz2 +0 -0
- data/ports/archives/libgpg-error-1.32.tar.bz2 +0 -0
    
        data/ext/gpgme/gpgme_n.c
    CHANGED
    
    | @@ -46,15 +46,15 @@ | |
| 46 46 | 
             
            /* Define this if you use GPGME 1.1.2 and earlier.
         | 
| 47 47 | 
             
               https://bugs.g10code.com/gnupg/issue715 */
         | 
| 48 48 | 
             
            #ifdef RUBY_GPGME_NEED_WORKAROUND_KEYLIST_NEXT
         | 
| 49 | 
            -
            #define CHECK_KEYLIST_IN_PROGRESS(vctx) | 
| 50 | 
            -
              if (rb_iv_get (vctx, "ruby_gpgme_keylist_in_progress") != Qtrue) | 
| 49 | 
            +
            #define CHECK_KEYLIST_IN_PROGRESS(vctx)                                   \
         | 
| 50 | 
            +
              if (rb_iv_get (vctx, "ruby_gpgme_keylist_in_progress") != Qtrue)        \
         | 
| 51 51 | 
             
                return LONG2NUM(gpgme_error (GPG_ERR_INV_STATE))
         | 
| 52 | 
            -
            #define CHECK_KEYLIST_NOT_IN_PROGRESS(vctx) | 
| 53 | 
            -
              if (rb_iv_get (vctx, "ruby_gpgme_keylist_in_progress") == Qtrue) | 
| 52 | 
            +
            #define CHECK_KEYLIST_NOT_IN_PROGRESS(vctx)                               \
         | 
| 53 | 
            +
              if (rb_iv_get (vctx, "ruby_gpgme_keylist_in_progress") == Qtrue)        \
         | 
| 54 54 | 
             
                return LONG2NUM(gpgme_error (GPG_ERR_INV_STATE))
         | 
| 55 | 
            -
            #define SET_KEYLIST_IN_PROGRESS(vctx) | 
| 55 | 
            +
            #define SET_KEYLIST_IN_PROGRESS(vctx)                                \
         | 
| 56 56 | 
             
              rb_iv_set (vctx, "ruby_gpgme_keylist_in_progress", Qtrue)
         | 
| 57 | 
            -
            #define RESET_KEYLIST_IN_PROGRESS(vctx) | 
| 57 | 
            +
            #define RESET_KEYLIST_IN_PROGRESS(vctx)                              \
         | 
| 58 58 | 
             
              rb_iv_set (vctx, "ruby_gpgme_keylist_in_progress", Qfalse)
         | 
| 59 59 | 
             
            #else
         | 
| 60 60 | 
             
            #define CHECK_KEYLIST_IN_PROGRESS(vctx)
         | 
| @@ -88,28 +88,28 @@ | |
| 88 88 | 
             
            #define RSTRING_LEN(a) RSTRING(a)->len
         | 
| 89 89 | 
             
            #endif
         | 
| 90 90 |  | 
| 91 | 
            -
            #define WRAP_GPGME_DATA(dh) | 
| 91 | 
            +
            #define WRAP_GPGME_DATA(dh)                                        \
         | 
| 92 92 | 
             
              Data_Wrap_Struct(cData, 0, gpgme_data_release, dh)
         | 
| 93 93 | 
             
            /* `gpgme_data_t' is typedef'ed as `struct gpgme_data *'. */
         | 
| 94 | 
            -
            #define UNWRAP_GPGME_DATA(vdh, dh) | 
| 94 | 
            +
            #define UNWRAP_GPGME_DATA(vdh, dh)                                \
         | 
| 95 95 | 
             
              Data_Get_Struct(vdh, struct gpgme_data, dh);
         | 
| 96 96 |  | 
| 97 | 
            -
            #define WRAP_GPGME_CTX(ctx) | 
| 97 | 
            +
            #define WRAP_GPGME_CTX(ctx)                                        \
         | 
| 98 98 | 
             
              Data_Wrap_Struct(cCtx, 0, gpgme_release, ctx)
         | 
| 99 99 | 
             
            /* `gpgme_ctx_t' is typedef'ed as `struct gpgme_context *'. */
         | 
| 100 | 
            -
            #define UNWRAP_GPGME_CTX(vctx, ctx) | 
| 100 | 
            +
            #define UNWRAP_GPGME_CTX(vctx, ctx)                                \
         | 
| 101 101 | 
             
              Data_Get_Struct(vctx, struct gpgme_context, ctx)
         | 
| 102 102 |  | 
| 103 | 
            -
            #define WRAP_GPGME_KEY(key) | 
| 103 | 
            +
            #define WRAP_GPGME_KEY(key)                                        \
         | 
| 104 104 | 
             
              Data_Wrap_Struct(cKey, 0, gpgme_key_unref, key)
         | 
| 105 105 | 
             
            /* `gpgme_key_t' is typedef'ed as `struct _gpgme_key *'. */
         | 
| 106 | 
            -
            #define UNWRAP_GPGME_KEY(vkey, key) | 
| 106 | 
            +
            #define UNWRAP_GPGME_KEY(vkey, key)                                \
         | 
| 107 107 | 
             
              Data_Get_Struct(vkey, struct _gpgme_key, key)
         | 
| 108 108 |  | 
| 109 | 
            -
            #define WRAP_GPGME_TRUST_ITEM(item) | 
| 109 | 
            +
            #define WRAP_GPGME_TRUST_ITEM(item)                                          \
         | 
| 110 110 | 
             
              Data_Wrap_Struct(cTrustItem, 0, gpgme_trust_item_unref, item)
         | 
| 111 111 | 
             
            /* `gpgme_trust_item_t' is typedef'ed as `struct _gpgme_trust_item *'. */
         | 
| 112 | 
            -
            #define UNWRAP_GPGME_TRUST_ITEM(vitem, item) | 
| 112 | 
            +
            #define UNWRAP_GPGME_TRUST_ITEM(vitem, item)                        \
         | 
| 113 113 | 
             
              Data_Get_Struct(vitem, struct _gpgme_trust_item, item)
         | 
| 114 114 |  | 
| 115 115 | 
             
            static VALUE cEngineInfo,
         | 
| @@ -145,7 +145,7 @@ static VALUE | |
| 145 145 | 
             
            rb_s_gpgme_check_version (VALUE dummy, VALUE vreq)
         | 
| 146 146 | 
             
            {
         | 
| 147 147 | 
             
              const char *result = gpgme_check_version (NIL_P(vreq) ? NULL :
         | 
| 148 | 
            -
             | 
| 148 | 
            +
                                                        StringValueCStr(vreq));
         | 
| 149 149 | 
             
              return result ? rb_str_new2 (result) : Qnil;
         | 
| 150 150 | 
             
            }
         | 
| 151 151 |  | 
| @@ -167,32 +167,32 @@ rb_s_gpgme_get_engine_info (VALUE dummy, VALUE rinfo) | |
| 167 167 | 
             
              if (gpgme_err_code(err) == GPG_ERR_NO_ERROR)
         | 
| 168 168 | 
             
                {
         | 
| 169 169 | 
             
                  for (idx = 0; info; info = info->next, idx++)
         | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 175 | 
            -
             | 
| 176 | 
            -
             | 
| 177 | 
            -
             | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 180 | 
            -
             | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 170 | 
            +
                    {
         | 
| 171 | 
            +
                      VALUE vinfo = rb_class_new_instance (0, NULL, cEngineInfo);
         | 
| 172 | 
            +
                      rb_iv_set (vinfo, "@protocol", INT2FIX(info->protocol));
         | 
| 173 | 
            +
                      if (info->file_name)
         | 
| 174 | 
            +
                        rb_iv_set (vinfo, "@file_name", rb_str_new2 (info->file_name));
         | 
| 175 | 
            +
                      if (info->version)
         | 
| 176 | 
            +
                        rb_iv_set (vinfo, "@version", rb_str_new2 (info->version));
         | 
| 177 | 
            +
                      if (info->req_version)
         | 
| 178 | 
            +
                        rb_iv_set (vinfo, "@req_version", rb_str_new2 (info->req_version));
         | 
| 179 | 
            +
                      if (info->home_dir)
         | 
| 180 | 
            +
                        rb_iv_set (vinfo, "@home_dir", rb_str_new2 (info->home_dir));
         | 
| 181 | 
            +
                      rb_ary_store (rinfo, idx, vinfo);
         | 
| 182 | 
            +
                    }
         | 
| 183 183 | 
             
                }
         | 
| 184 184 | 
             
              return LONG2NUM(err);
         | 
| 185 185 | 
             
            }
         | 
| 186 186 |  | 
| 187 187 | 
             
            static VALUE
         | 
| 188 188 | 
             
            rb_s_gpgme_set_engine_info (VALUE dummy, VALUE vproto, VALUE vfile_name,
         | 
| 189 | 
            -
             | 
| 189 | 
            +
                                        VALUE vhome_dir)
         | 
| 190 190 | 
             
            {
         | 
| 191 191 | 
             
              gpgme_error_t err = gpgme_set_engine_info (NUM2INT(vproto),
         | 
| 192 | 
            -
             | 
| 193 | 
            -
             | 
| 194 | 
            -
             | 
| 195 | 
            -
             | 
| 192 | 
            +
                                                         NIL_P(vfile_name) ? NULL :
         | 
| 193 | 
            +
                                                         StringValueCStr(vfile_name),
         | 
| 194 | 
            +
                                                         NIL_P(vhome_dir) ? NULL :
         | 
| 195 | 
            +
                                                         StringValueCStr(vhome_dir));
         | 
| 196 196 | 
             
              return LONG2NUM(err);
         | 
| 197 197 | 
             
            }
         | 
| 198 198 |  | 
| @@ -209,25 +209,25 @@ rb_s_gpgme_ctx_get_engine_info (VALUE dummy, VALUE vctx, VALUE rinfo) | |
| 209 209 |  | 
| 210 210 | 
             
              gpgme_engine_info_t info = gpgme_ctx_get_engine_info (ctx);
         | 
| 211 211 | 
             
                  for (idx = 0; info; info = info->next, idx++)
         | 
| 212 | 
            -
             | 
| 213 | 
            -
             | 
| 214 | 
            -
             | 
| 215 | 
            -
             | 
| 216 | 
            -
             | 
| 217 | 
            -
             | 
| 218 | 
            -
             | 
| 219 | 
            -
             | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
             | 
| 223 | 
            -
             | 
| 224 | 
            -
             | 
| 212 | 
            +
                    {
         | 
| 213 | 
            +
                      VALUE vinfo = rb_class_new_instance (0, NULL, cEngineInfo);
         | 
| 214 | 
            +
                      rb_iv_set (vinfo, "@protocol", INT2FIX(info->protocol));
         | 
| 215 | 
            +
                      if (info->file_name)
         | 
| 216 | 
            +
                        rb_iv_set (vinfo, "@file_name", rb_str_new2 (info->file_name));
         | 
| 217 | 
            +
                      if (info->version)
         | 
| 218 | 
            +
                        rb_iv_set (vinfo, "@version", rb_str_new2 (info->version));
         | 
| 219 | 
            +
                      if (info->req_version)
         | 
| 220 | 
            +
                        rb_iv_set (vinfo, "@req_version", rb_str_new2 (info->req_version));
         | 
| 221 | 
            +
                      if (info->home_dir)
         | 
| 222 | 
            +
                        rb_iv_set (vinfo, "@home_dir", rb_str_new2 (info->home_dir));
         | 
| 223 | 
            +
                      rb_ary_store (rinfo, idx, vinfo);
         | 
| 224 | 
            +
                    }
         | 
| 225 225 | 
             
              return Qnil;
         | 
| 226 226 | 
             
            }
         | 
| 227 227 |  | 
| 228 228 | 
             
            static VALUE
         | 
| 229 229 | 
             
            rb_s_gpgme_ctx_set_engine_info (VALUE dummy, VALUE vctx, VALUE vproto, VALUE vfile_name,
         | 
| 230 | 
            -
             | 
| 230 | 
            +
                                        VALUE vhome_dir)
         | 
| 231 231 | 
             
            {
         | 
| 232 232 | 
             
              gpgme_ctx_t ctx;
         | 
| 233 233 |  | 
| @@ -236,10 +236,10 @@ rb_s_gpgme_ctx_set_engine_info (VALUE dummy, VALUE vctx, VALUE vproto, VALUE vfi | |
| 236 236 | 
             
                rb_raise (rb_eArgError, "released ctx");
         | 
| 237 237 | 
             
              gpgme_error_t err = gpgme_ctx_set_engine_info (ctx,
         | 
| 238 238 | 
             
                           NUM2INT(vproto),
         | 
| 239 | 
            -
             | 
| 240 | 
            -
             | 
| 241 | 
            -
             | 
| 242 | 
            -
             | 
| 239 | 
            +
                                                         NIL_P(vfile_name) ? NULL :
         | 
| 240 | 
            +
                                                         StringValueCStr(vfile_name),
         | 
| 241 | 
            +
                                                         NIL_P(vhome_dir) ? NULL :
         | 
| 242 | 
            +
                                                         StringValueCStr(vhome_dir));
         | 
| 243 243 | 
             
              return LONG2NUM(err);
         | 
| 244 244 | 
             
            }
         | 
| 245 245 |  | 
| @@ -292,7 +292,7 @@ rb_s_gpgme_data_new (VALUE dummy, VALUE rdh) | |
| 292 292 |  | 
| 293 293 | 
             
            static VALUE
         | 
| 294 294 | 
             
            rb_s_gpgme_data_new_from_mem (VALUE dummy, VALUE rdh, VALUE vbuffer,
         | 
| 295 | 
            -
             | 
| 295 | 
            +
                                          VALUE vsize)
         | 
| 296 296 | 
             
            {
         | 
| 297 297 | 
             
              gpgme_data_t dh;
         | 
| 298 298 | 
             
              VALUE vdh;
         | 
| @@ -330,7 +330,7 @@ read_cb (void *handle, void *buffer, size_t size) | |
| 330 330 | 
             
              vhook_value = RARRAY_PTR(vcb)[1];
         | 
| 331 331 |  | 
| 332 332 | 
             
              vbuffer = rb_funcall (vcbs, rb_intern ("read"), 2, vhook_value,
         | 
| 333 | 
            -
             | 
| 333 | 
            +
                                    LONG2NUM(size));
         | 
| 334 334 | 
             
              if (NIL_P(vbuffer))
         | 
| 335 335 | 
             
                return 0;
         | 
| 336 336 | 
             
              memcpy (buffer, StringValuePtr(vbuffer), RSTRING_LEN(vbuffer));
         | 
| @@ -347,7 +347,7 @@ write_cb (void *handle, const void *buffer, size_t size) | |
| 347 347 | 
             
              vbuffer = rb_str_new (buffer, size);
         | 
| 348 348 |  | 
| 349 349 | 
             
              vnwrite = rb_funcall (vcbs, rb_intern ("write"), 3,
         | 
| 350 | 
            -
             | 
| 350 | 
            +
                                    vhook_value, vbuffer, LONG2NUM(size));
         | 
| 351 351 | 
             
              return NUM2LONG(vnwrite);
         | 
| 352 352 | 
             
            }
         | 
| 353 353 |  | 
| @@ -363,7 +363,7 @@ seek_cb (void *handle, off_t offset, int whence) | |
| 363 363 | 
             
              if (rb_respond_to (vcbs, id_seek))
         | 
| 364 364 | 
             
                {
         | 
| 365 365 | 
             
                  vpos = rb_funcall (vcbs, id_seek, 3,
         | 
| 366 | 
            -
             | 
| 366 | 
            +
                                     vhook_value, LONG2NUM(offset), INT2FIX(whence));
         | 
| 367 367 | 
             
                  return NUM2LONG(vpos);
         | 
| 368 368 | 
             
                }
         | 
| 369 369 | 
             
              errno = ENOSYS;
         | 
| @@ -380,7 +380,7 @@ static struct gpgme_data_cbs cbs = | |
| 380 380 |  | 
| 381 381 | 
             
            static VALUE
         | 
| 382 382 | 
             
            rb_s_gpgme_data_new_from_cbs (VALUE dummy, VALUE rdh, VALUE vcbs,
         | 
| 383 | 
            -
             | 
| 383 | 
            +
                                          VALUE vhandle)
         | 
| 384 384 | 
             
            {
         | 
| 385 385 | 
             
              gpgme_data_t dh;
         | 
| 386 386 | 
             
              gpgme_error_t err;
         | 
| @@ -644,7 +644,7 @@ rb_s_gpgme_get_keylist_mode (VALUE dummy, VALUE vctx) | |
| 644 644 |  | 
| 645 645 | 
             
            static gpgme_error_t
         | 
| 646 646 | 
             
            passphrase_cb (void *hook, const char *uid_hint, const char *passphrase_info,
         | 
| 647 | 
            -
             | 
| 647 | 
            +
                           int prev_was_bad, int fd)
         | 
| 648 648 | 
             
            {
         | 
| 649 649 | 
             
              VALUE vcb = (VALUE)hook, vpassfunc, vhook_value;
         | 
| 650 650 |  | 
| @@ -652,17 +652,17 @@ passphrase_cb (void *hook, const char *uid_hint, const char *passphrase_info, | |
| 652 652 | 
             
              vhook_value = RARRAY_PTR(vcb)[1];
         | 
| 653 653 |  | 
| 654 654 | 
             
              rb_funcall (vpassfunc, rb_intern ("call"), 5,
         | 
| 655 | 
            -
             | 
| 656 | 
            -
             | 
| 657 | 
            -
             | 
| 658 | 
            -
             | 
| 659 | 
            -
             | 
| 655 | 
            +
                          vhook_value,
         | 
| 656 | 
            +
                          uid_hint ? rb_str_new2 (uid_hint) : Qnil,
         | 
| 657 | 
            +
                          passphrase_info ? rb_str_new2 (passphrase_info) : Qnil,
         | 
| 658 | 
            +
                          INT2FIX(prev_was_bad),
         | 
| 659 | 
            +
                          INT2NUM(fd));
         | 
| 660 660 | 
             
              return gpgme_err_make (GPG_ERR_SOURCE_USER_1, GPG_ERR_NO_ERROR);
         | 
| 661 661 | 
             
            }
         | 
| 662 662 |  | 
| 663 663 | 
             
            static VALUE
         | 
| 664 664 | 
             
            rb_s_gpgme_set_passphrase_cb (VALUE dummy, VALUE vctx, VALUE vpassfunc,
         | 
| 665 | 
            -
             | 
| 665 | 
            +
                                          VALUE vhook_value)
         | 
| 666 666 | 
             
            {
         | 
| 667 667 | 
             
              gpgme_ctx_t ctx;
         | 
| 668 668 | 
             
              VALUE vcb = rb_ary_new ();
         | 
| @@ -681,7 +681,7 @@ rb_s_gpgme_set_passphrase_cb (VALUE dummy, VALUE vctx, VALUE vpassfunc, | |
| 681 681 |  | 
| 682 682 | 
             
            static VALUE
         | 
| 683 683 | 
             
            rb_s_gpgme_get_passphrase_cb (VALUE dummy, VALUE vctx, VALUE rpassfunc,
         | 
| 684 | 
            -
             | 
| 684 | 
            +
                                          VALUE rhook_value)
         | 
| 685 685 | 
             
            {
         | 
| 686 686 | 
             
              VALUE vcb = rb_iv_get (vctx, "@passphrase_cb");
         | 
| 687 687 |  | 
| @@ -701,15 +701,15 @@ status_cb (void *hook, const char *keyword, const char *args) | |
| 701 701 | 
             
              vhook_value = RARRAY_PTR(vcb)[1];
         | 
| 702 702 |  | 
| 703 703 | 
             
              rb_funcall (vstatusfunc, rb_intern ("call"), 3,
         | 
| 704 | 
            -
             | 
| 705 | 
            -
             | 
| 706 | 
            -
             | 
| 704 | 
            +
                          vhook_value,
         | 
| 705 | 
            +
                          keyword ? rb_str_new2 (keyword) : Qnil,
         | 
| 706 | 
            +
                          args ? rb_str_new2 (args) : Qnil);
         | 
| 707 707 | 
             
              return gpgme_err_make (GPG_ERR_SOURCE_USER_1, GPG_ERR_NO_ERROR);
         | 
| 708 708 | 
             
            }
         | 
| 709 709 |  | 
| 710 710 | 
             
            static VALUE
         | 
| 711 711 | 
             
            rb_s_gpgme_set_status_cb (VALUE dummy, VALUE vctx, VALUE vstatusfunc,
         | 
| 712 | 
            -
             | 
| 712 | 
            +
                                      VALUE vhook_value)
         | 
| 713 713 | 
             
            {
         | 
| 714 714 | 
             
              gpgme_ctx_t ctx;
         | 
| 715 715 | 
             
              VALUE vcb = rb_ary_new ();
         | 
| @@ -728,7 +728,7 @@ rb_s_gpgme_set_status_cb (VALUE dummy, VALUE vctx, VALUE vstatusfunc, | |
| 728 728 |  | 
| 729 729 | 
             
            static VALUE
         | 
| 730 730 | 
             
            rb_s_gpgme_get_status_cb (VALUE dummy, VALUE vctx, VALUE rstatusfunc,
         | 
| 731 | 
            -
             | 
| 731 | 
            +
                                      VALUE rhook_value)
         | 
| 732 732 | 
             
            {
         | 
| 733 733 | 
             
              VALUE vcb = rb_iv_get (vctx, "@status_cb");
         | 
| 734 734 |  | 
| @@ -748,13 +748,13 @@ progress_cb (void *hook, const char *what, int type, int current, int total) | |
| 748 748 | 
             
              vhook_value = RARRAY_PTR(vcb)[1];
         | 
| 749 749 |  | 
| 750 750 | 
             
              rb_funcall (vprogfunc, rb_intern ("call"), 5, vhook_value,
         | 
| 751 | 
            -
             | 
| 752 | 
            -
             | 
| 751 | 
            +
                          rb_str_new2 (what), INT2NUM(type), INT2NUM(current),
         | 
| 752 | 
            +
                          INT2NUM(total));
         | 
| 753 753 | 
             
            }
         | 
| 754 754 |  | 
| 755 755 | 
             
            static VALUE
         | 
| 756 756 | 
             
            rb_s_gpgme_set_progress_cb (VALUE dummy, VALUE vctx, VALUE vprogfunc,
         | 
| 757 | 
            -
             | 
| 757 | 
            +
                                        VALUE vhook_value)
         | 
| 758 758 | 
             
            {
         | 
| 759 759 | 
             
              gpgme_ctx_t ctx;
         | 
| 760 760 | 
             
              VALUE vcb = rb_ary_new ();
         | 
| @@ -774,7 +774,7 @@ rb_s_gpgme_set_progress_cb (VALUE dummy, VALUE vctx, VALUE vprogfunc, | |
| 774 774 |  | 
| 775 775 | 
             
            static VALUE
         | 
| 776 776 | 
             
            rb_s_gpgme_get_progress_cb (VALUE dummy, VALUE vctx, VALUE rprogfunc,
         | 
| 777 | 
            -
             | 
| 777 | 
            +
                                        VALUE rhook_value)
         | 
| 778 778 | 
             
            {
         | 
| 779 779 | 
             
              VALUE vcb = rb_iv_get (vctx, "@progress_cb");
         | 
| 780 780 | 
             
              rb_ary_store (rprogfunc, 0, RARRAY_PTR(vcb)[0]);
         | 
| @@ -857,7 +857,7 @@ rb_s_gpgme_get_offline (VALUE dummy, VALUE vctx) | |
| 857 857 |  | 
| 858 858 | 
             
            static VALUE
         | 
| 859 859 | 
             
            rb_s_gpgme_op_keylist_start (VALUE dummy, VALUE vctx, VALUE vpattern,
         | 
| 860 | 
            -
             | 
| 860 | 
            +
                                         VALUE vsecret_only)
         | 
| 861 861 | 
             
            {
         | 
| 862 862 | 
             
              gpgme_ctx_t ctx;
         | 
| 863 863 | 
             
              gpgme_error_t err;
         | 
| @@ -869,8 +869,8 @@ rb_s_gpgme_op_keylist_start (VALUE dummy, VALUE vctx, VALUE vpattern, | |
| 869 869 | 
             
                rb_raise (rb_eArgError, "released ctx");
         | 
| 870 870 |  | 
| 871 871 | 
             
              err = gpgme_op_keylist_start (ctx, NIL_P(vpattern) ? NULL :
         | 
| 872 | 
            -
             | 
| 873 | 
            -
             | 
| 872 | 
            +
                                            StringValueCStr(vpattern),
         | 
| 873 | 
            +
                                            NUM2INT(vsecret_only));
         | 
| 874 874 | 
             
              if (gpgme_err_code (err) == GPG_ERR_NO_ERROR)
         | 
| 875 875 | 
             
                SET_KEYLIST_IN_PROGRESS(vctx);
         | 
| 876 876 | 
             
              return LONG2NUM(err);
         | 
| @@ -878,7 +878,7 @@ rb_s_gpgme_op_keylist_start (VALUE dummy, VALUE vctx, VALUE vpattern, | |
| 878 878 |  | 
| 879 879 | 
             
            static VALUE
         | 
| 880 880 | 
             
            rb_s_gpgme_op_keylist_ext_start (VALUE dummy, VALUE vctx, VALUE vpattern,
         | 
| 881 | 
            -
             | 
| 881 | 
            +
                                             VALUE vsecret_only)
         | 
| 882 882 | 
             
            {
         | 
| 883 883 | 
             
              gpgme_ctx_t ctx;
         | 
| 884 884 | 
             
              const char **pattern = NULL;
         | 
| @@ -895,7 +895,7 @@ rb_s_gpgme_op_keylist_ext_start (VALUE dummy, VALUE vctx, VALUE vpattern, | |
| 895 895 | 
             
                  /* Convert RARRAY into `const char *' array. */
         | 
| 896 896 | 
             
                  pattern = ALLOC_N(const char *, RARRAY_LEN(vpattern) + 1);
         | 
| 897 897 | 
             
                  for (i = 0; i<RARRAY_LEN(vpattern); i++)
         | 
| 898 | 
            -
             | 
| 898 | 
            +
                    pattern[i] = StringValueCStr(RARRAY_PTR(vpattern)[i]);
         | 
| 899 899 | 
             
                  pattern[RARRAY_LEN(vpattern)] = NULL;
         | 
| 900 900 | 
             
                }
         | 
| 901 901 |  | 
| @@ -961,7 +961,7 @@ save_gpgme_key_attrs (VALUE vkey, gpgme_key_t key) | |
| 961 961 | 
             
                  rb_iv_set (vsubkey, "@can_sign", INT2FIX(subkey->can_sign));
         | 
| 962 962 | 
             
                  rb_iv_set (vsubkey, "@can_certify", INT2FIX(subkey->can_certify));
         | 
| 963 963 | 
             
                  rb_iv_set (vsubkey, "@can_authenticate",
         | 
| 964 | 
            -
             | 
| 964 | 
            +
                             INT2FIX(subkey->can_authenticate));
         | 
| 965 965 | 
             
                  rb_iv_set (vsubkey, "@secret", INT2FIX(subkey->secret));
         | 
| 966 966 | 
             
                  rb_iv_set (vsubkey, "@pubkey_algo", INT2FIX(subkey->pubkey_algo));
         | 
| 967 967 | 
             
                  rb_iv_set (vsubkey, "@length", UINT2NUM(subkey->length));
         | 
| @@ -972,7 +972,7 @@ save_gpgme_key_attrs (VALUE vkey, gpgme_key_t key) | |
| 972 972 | 
             
                  rb_iv_set (vsubkey, "@expires", LONG2NUM(subkey->expires));
         | 
| 973 973 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010500
         | 
| 974 974 | 
             
                  if (subkey->curve)
         | 
| 975 | 
            -
             | 
| 975 | 
            +
                    rb_iv_set (vsubkey, "@curve", rb_str_new2 (subkey->curve));
         | 
| 976 976 | 
             
            #endif
         | 
| 977 977 | 
             
                  rb_ary_push (vsubkeys, vsubkey);
         | 
| 978 978 | 
             
                }
         | 
| @@ -995,18 +995,18 @@ save_gpgme_key_attrs (VALUE vkey, gpgme_key_t key) | |
| 995 995 | 
             
                  vsignatures = rb_ary_new ();
         | 
| 996 996 | 
             
                  rb_iv_set (vuser_id, "@signatures", vsignatures);
         | 
| 997 997 | 
             
                  for (key_sig = user_id->signatures; key_sig; key_sig = key_sig->next)
         | 
| 998 | 
            -
             | 
| 999 | 
            -
             | 
| 1000 | 
            -
             | 
| 1001 | 
            -
             | 
| 1002 | 
            -
             | 
| 1003 | 
            -
             | 
| 1004 | 
            -
             | 
| 1005 | 
            -
             | 
| 1006 | 
            -
             | 
| 1007 | 
            -
             | 
| 1008 | 
            -
             | 
| 1009 | 
            -
             | 
| 998 | 
            +
                    {
         | 
| 999 | 
            +
                      VALUE vkey_sig = rb_class_new_instance(0, NULL, cKeySig);
         | 
| 1000 | 
            +
                      rb_iv_set (vkey_sig, "@revoked", INT2FIX(key_sig->revoked));
         | 
| 1001 | 
            +
                      rb_iv_set (vkey_sig, "@expired", INT2FIX(key_sig->expired));
         | 
| 1002 | 
            +
                      rb_iv_set (vkey_sig, "@invalid", INT2FIX(key_sig->invalid));
         | 
| 1003 | 
            +
                      rb_iv_set (vkey_sig, "@exportable", INT2FIX(key_sig->exportable));
         | 
| 1004 | 
            +
                      rb_iv_set (vkey_sig, "@pubkey_algo", INT2FIX(key_sig->pubkey_algo));
         | 
| 1005 | 
            +
                      rb_iv_set (vkey_sig, "@keyid", rb_str_new2 (key_sig->keyid));
         | 
| 1006 | 
            +
                      rb_iv_set (vkey_sig, "@timestamp", LONG2NUM(key_sig->timestamp));
         | 
| 1007 | 
            +
                      rb_iv_set (vkey_sig, "@expires", LONG2NUM(key_sig->expires));
         | 
| 1008 | 
            +
                      rb_ary_push (vsignatures, vkey_sig);
         | 
| 1009 | 
            +
                    }
         | 
| 1010 1010 | 
             
                  rb_ary_push (vuids, vuser_id);
         | 
| 1011 1011 | 
             
                }
         | 
| 1012 1012 | 
             
              return vkey;
         | 
| @@ -1054,7 +1054,7 @@ rb_s_gpgme_op_keylist_end (VALUE dummy, VALUE vctx) | |
| 1054 1054 |  | 
| 1055 1055 | 
             
            static VALUE
         | 
| 1056 1056 | 
             
            rb_s_gpgme_get_key (VALUE dummy, VALUE vctx, VALUE vfpr, VALUE rkey,
         | 
| 1057 | 
            -
             | 
| 1057 | 
            +
                                VALUE vsecret)
         | 
| 1058 1058 | 
             
            {
         | 
| 1059 1059 | 
             
              gpgme_ctx_t ctx;
         | 
| 1060 1060 | 
             
              gpgme_error_t err;
         | 
| @@ -1076,7 +1076,7 @@ rb_s_gpgme_get_key (VALUE dummy, VALUE vctx, VALUE vfpr, VALUE rkey, | |
| 1076 1076 |  | 
| 1077 1077 | 
             
            static VALUE
         | 
| 1078 1078 | 
             
            rb_s_gpgme_op_genkey (VALUE dummy, VALUE vctx, VALUE vparms, VALUE vpubkey,
         | 
| 1079 | 
            -
             | 
| 1079 | 
            +
                                  VALUE vseckey)
         | 
| 1080 1080 | 
             
            {
         | 
| 1081 1081 | 
             
              gpgme_ctx_t ctx;
         | 
| 1082 1082 | 
             
              gpgme_data_t pubkey = NULL, seckey = NULL;
         | 
| @@ -1098,7 +1098,7 @@ rb_s_gpgme_op_genkey (VALUE dummy, VALUE vctx, VALUE vparms, VALUE vpubkey, | |
| 1098 1098 |  | 
| 1099 1099 | 
             
            static VALUE
         | 
| 1100 1100 | 
             
            rb_s_gpgme_op_genkey_start (VALUE dummy, VALUE vctx, VALUE vparms,
         | 
| 1101 | 
            -
             | 
| 1101 | 
            +
                                        VALUE vpubkey, VALUE vseckey)
         | 
| 1102 1102 | 
             
            {
         | 
| 1103 1103 | 
             
              gpgme_ctx_t ctx;
         | 
| 1104 1104 | 
             
              gpgme_data_t pubkey = NULL, seckey = NULL;
         | 
| @@ -1120,7 +1120,7 @@ rb_s_gpgme_op_genkey_start (VALUE dummy, VALUE vctx, VALUE vparms, | |
| 1120 1120 |  | 
| 1121 1121 | 
             
            static VALUE
         | 
| 1122 1122 | 
             
            rb_s_gpgme_op_export (VALUE dummy, VALUE vctx, VALUE vpattern, VALUE vmode,
         | 
| 1123 | 
            -
             | 
| 1123 | 
            +
                                  VALUE vkeydata)
         | 
| 1124 1124 | 
             
            {
         | 
| 1125 1125 | 
             
              gpgme_ctx_t ctx;
         | 
| 1126 1126 | 
             
              gpgme_data_t keydata;
         | 
| @@ -1134,13 +1134,13 @@ rb_s_gpgme_op_export (VALUE dummy, VALUE vctx, VALUE vpattern, VALUE vmode, | |
| 1134 1134 | 
             
              UNWRAP_GPGME_DATA(vkeydata, keydata);
         | 
| 1135 1135 |  | 
| 1136 1136 | 
             
              err = gpgme_op_export (ctx, StringValueCStr(vpattern), NUM2UINT(vmode),
         | 
| 1137 | 
            -
             | 
| 1137 | 
            +
                                     keydata);
         | 
| 1138 1138 | 
             
              return LONG2NUM(err);
         | 
| 1139 1139 | 
             
            }
         | 
| 1140 1140 |  | 
| 1141 1141 | 
             
            static VALUE
         | 
| 1142 1142 | 
             
            rb_s_gpgme_op_export_start (VALUE dummy, VALUE vctx, VALUE vpattern,
         | 
| 1143 | 
            -
             | 
| 1143 | 
            +
                                        VALUE vmode, VALUE vkeydata)
         | 
| 1144 1144 | 
             
            {
         | 
| 1145 1145 | 
             
              gpgme_ctx_t ctx;
         | 
| 1146 1146 | 
             
              gpgme_data_t keydata;
         | 
| @@ -1154,13 +1154,13 @@ rb_s_gpgme_op_export_start (VALUE dummy, VALUE vctx, VALUE vpattern, | |
| 1154 1154 | 
             
              UNWRAP_GPGME_DATA(vkeydata, keydata);
         | 
| 1155 1155 |  | 
| 1156 1156 | 
             
              err = gpgme_op_export_start (ctx, StringValueCStr(vpattern),
         | 
| 1157 | 
            -
             | 
| 1157 | 
            +
                                           NUM2UINT(vmode), keydata);
         | 
| 1158 1158 | 
             
              return LONG2NUM(err);
         | 
| 1159 1159 | 
             
            }
         | 
| 1160 1160 |  | 
| 1161 1161 | 
             
            static VALUE
         | 
| 1162 1162 | 
             
            rb_s_gpgme_op_export_ext (VALUE dummy, VALUE vctx, VALUE vpattern, VALUE vmode,
         | 
| 1163 | 
            -
             | 
| 1163 | 
            +
                                      VALUE vkeydata)
         | 
| 1164 1164 | 
             
            {
         | 
| 1165 1165 | 
             
              gpgme_ctx_t ctx;
         | 
| 1166 1166 | 
             
              gpgme_data_t keydata;
         | 
| @@ -1184,7 +1184,7 @@ rb_s_gpgme_op_export_ext (VALUE dummy, VALUE vctx, VALUE vpattern, VALUE vmode, | |
| 1184 1184 |  | 
| 1185 1185 | 
             
            static VALUE
         | 
| 1186 1186 | 
             
            rb_s_gpgme_op_export_ext_start (VALUE dummy, VALUE vctx, VALUE vpattern,
         | 
| 1187 | 
            -
             | 
| 1187 | 
            +
                                        VALUE vmode, VALUE vkeydata)
         | 
| 1188 1188 | 
             
            {
         | 
| 1189 1189 | 
             
              gpgme_ctx_t ctx;
         | 
| 1190 1190 | 
             
              gpgme_data_t keydata;
         | 
| @@ -1209,7 +1209,7 @@ rb_s_gpgme_op_export_ext_start (VALUE dummy, VALUE vctx, VALUE vpattern, | |
| 1209 1209 | 
             
            #ifdef HAVE_GPGME_OP_EXPORT_KEYS
         | 
| 1210 1210 | 
             
            static VALUE
         | 
| 1211 1211 | 
             
            rb_s_gpgme_op_export_keys (VALUE dummy, VALUE vctx, VALUE vkeys,
         | 
| 1212 | 
            -
             | 
| 1212 | 
            +
                                       VALUE vmode, VALUE vkeydata)
         | 
| 1213 1213 | 
             
            {
         | 
| 1214 1214 | 
             
              gpgme_ctx_t ctx;
         | 
| 1215 1215 | 
             
              gpgme_key_t *keys;
         | 
| @@ -1235,7 +1235,7 @@ rb_s_gpgme_op_export_keys (VALUE dummy, VALUE vctx, VALUE vkeys, | |
| 1235 1235 |  | 
| 1236 1236 | 
             
            static VALUE
         | 
| 1237 1237 | 
             
            rb_s_gpgme_op_export_keys_start (VALUE dummy, VALUE vctx, VALUE vkeys,
         | 
| 1238 | 
            -
             | 
| 1238 | 
            +
                                             VALUE vmode, VALUE vkeydata)
         | 
| 1239 1239 | 
             
            {
         | 
| 1240 1240 | 
             
              gpgme_ctx_t ctx;
         | 
| 1241 1241 | 
             
              gpgme_key_t *keys;
         | 
| @@ -1258,7 +1258,7 @@ rb_s_gpgme_op_export_keys_start (VALUE dummy, VALUE vctx, VALUE vkeys, | |
| 1258 1258 | 
             
              err = gpgme_op_export_keys_start (ctx, keys, NUM2UINT(vmode), keydata);
         | 
| 1259 1259 | 
             
              return LONG2NUM(err);
         | 
| 1260 1260 | 
             
            }
         | 
| 1261 | 
            -
            #endif | 
| 1261 | 
            +
            #endif        /*HAVE_GPGME_OP_EXPORT_KEYS*/
         | 
| 1262 1262 |  | 
| 1263 1263 | 
             
            static VALUE
         | 
| 1264 1264 | 
             
            rb_s_gpgme_op_import (VALUE dummy, VALUE vctx, VALUE vkeydata)
         | 
| @@ -1342,7 +1342,7 @@ rb_s_gpgme_op_import_keys_start (VALUE dummy, VALUE vctx, VALUE vkeys) | |
| 1342 1342 | 
             
              err = gpgme_op_import_keys_start (ctx, keys);
         | 
| 1343 1343 | 
             
              return LONG2NUM(err);
         | 
| 1344 1344 | 
             
            }
         | 
| 1345 | 
            -
            #endif | 
| 1345 | 
            +
            #endif        /*HAVE_GPGME_OP_EXPORT_KEYS*/
         | 
| 1346 1346 |  | 
| 1347 1347 | 
             
            static VALUE
         | 
| 1348 1348 | 
             
            rb_s_gpgme_op_import_result (VALUE dummy, VALUE vctx)
         | 
| @@ -1380,7 +1380,7 @@ rb_s_gpgme_op_import_result (VALUE dummy, VALUE vctx) | |
| 1380 1380 | 
             
                   status = status->next)
         | 
| 1381 1381 | 
             
                {
         | 
| 1382 1382 | 
             
                  VALUE vstatus =
         | 
| 1383 | 
            -
             | 
| 1383 | 
            +
                    rb_class_new_instance (0, NULL, cImportStatus);
         | 
| 1384 1384 | 
             
                  rb_iv_set (vstatus, "@fpr", rb_str_new2 (status->fpr));
         | 
| 1385 1385 | 
             
                  rb_iv_set (vstatus, "@result", LONG2NUM(status->result));
         | 
| 1386 1386 | 
             
                  rb_iv_set (vstatus, "@status", UINT2NUM(status->status));
         | 
| @@ -1409,7 +1409,7 @@ rb_s_gpgme_op_delete (VALUE dummy, VALUE vctx, VALUE vkey, VALUE vallow_secret) | |
| 1409 1409 |  | 
| 1410 1410 | 
             
            static VALUE
         | 
| 1411 1411 | 
             
            rb_s_gpgme_op_delete_start (VALUE dummy, VALUE vctx, VALUE vkey,
         | 
| 1412 | 
            -
             | 
| 1412 | 
            +
                                        VALUE vallow_secret)
         | 
| 1413 1413 | 
             
            {
         | 
| 1414 1414 | 
             
              gpgme_ctx_t ctx;
         | 
| 1415 1415 | 
             
              gpgme_key_t key;
         | 
| @@ -1436,13 +1436,13 @@ edit_cb (void *hook, gpgme_status_code_t status, const char *args, int fd) | |
| 1436 1436 | 
             
              vhook_value = RARRAY_PTR(vcb)[1];
         | 
| 1437 1437 |  | 
| 1438 1438 | 
             
              rb_funcall (veditfunc, rb_intern ("call"), 4, vhook_value, INT2FIX(status),
         | 
| 1439 | 
            -
             | 
| 1439 | 
            +
                          rb_str_new2 (args), INT2NUM(fd));
         | 
| 1440 1440 | 
             
              return gpgme_err_make (GPG_ERR_SOURCE_USER_1, GPG_ERR_NO_ERROR);
         | 
| 1441 1441 | 
             
            }
         | 
| 1442 1442 |  | 
| 1443 1443 | 
             
            static VALUE
         | 
| 1444 1444 | 
             
            rb_s_gpgme_op_edit (VALUE dummy, VALUE vctx, VALUE vkey,
         | 
| 1445 | 
            -
             | 
| 1445 | 
            +
                                VALUE veditfunc, VALUE vhook_value, VALUE vout)
         | 
| 1446 1446 | 
             
            {
         | 
| 1447 1447 | 
             
              gpgme_ctx_t ctx;
         | 
| 1448 1448 | 
             
              gpgme_key_t key;
         | 
| @@ -1471,7 +1471,7 @@ rb_s_gpgme_op_edit (VALUE dummy, VALUE vctx, VALUE vkey, | |
| 1471 1471 |  | 
| 1472 1472 | 
             
            static VALUE
         | 
| 1473 1473 | 
             
            rb_s_gpgme_op_edit_start (VALUE dummy, VALUE vctx, VALUE vkey,
         | 
| 1474 | 
            -
             | 
| 1474 | 
            +
                                      VALUE veditfunc, VALUE vhook_value, VALUE vout)
         | 
| 1475 1475 | 
             
            {
         | 
| 1476 1476 | 
             
              gpgme_ctx_t ctx;
         | 
| 1477 1477 | 
             
              gpgme_key_t key;
         | 
| @@ -1500,7 +1500,7 @@ rb_s_gpgme_op_edit_start (VALUE dummy, VALUE vctx, VALUE vkey, | |
| 1500 1500 |  | 
| 1501 1501 | 
             
            static VALUE
         | 
| 1502 1502 | 
             
            rb_s_gpgme_op_card_edit (VALUE dummy, VALUE vctx, VALUE vkey,
         | 
| 1503 | 
            -
             | 
| 1503 | 
            +
                                VALUE veditfunc, VALUE vhook_value, VALUE vout)
         | 
| 1504 1504 | 
             
            {
         | 
| 1505 1505 | 
             
              gpgme_ctx_t ctx;
         | 
| 1506 1506 | 
             
              gpgme_key_t key;
         | 
| @@ -1529,7 +1529,7 @@ rb_s_gpgme_op_card_edit (VALUE dummy, VALUE vctx, VALUE vkey, | |
| 1529 1529 |  | 
| 1530 1530 | 
             
            static VALUE
         | 
| 1531 1531 | 
             
            rb_s_gpgme_op_card_edit_start (VALUE dummy, VALUE vctx, VALUE vkey,
         | 
| 1532 | 
            -
             | 
| 1532 | 
            +
                                           VALUE veditfunc, VALUE vhook_value, VALUE vout)
         | 
| 1533 1533 | 
             
            {
         | 
| 1534 1534 | 
             
              gpgme_ctx_t ctx;
         | 
| 1535 1535 | 
             
              gpgme_key_t key;
         | 
| @@ -1558,7 +1558,7 @@ rb_s_gpgme_op_card_edit_start (VALUE dummy, VALUE vctx, VALUE vkey, | |
| 1558 1558 |  | 
| 1559 1559 | 
             
            static VALUE
         | 
| 1560 1560 | 
             
            rb_s_gpgme_op_trustlist_start (VALUE dummy, VALUE vctx, VALUE vpattern,
         | 
| 1561 | 
            -
             | 
| 1561 | 
            +
                                           VALUE vmax_level)
         | 
| 1562 1562 | 
             
            {
         | 
| 1563 1563 | 
             
              gpgme_ctx_t ctx;
         | 
| 1564 1564 | 
             
              gpgme_error_t err;
         | 
| @@ -1569,7 +1569,7 @@ rb_s_gpgme_op_trustlist_start (VALUE dummy, VALUE vctx, VALUE vpattern, | |
| 1569 1569 | 
             
              if (!ctx)
         | 
| 1570 1570 | 
             
                rb_raise (rb_eArgError, "released ctx");
         | 
| 1571 1571 | 
             
              err = gpgme_op_trustlist_start (ctx, StringValueCStr(vpattern),
         | 
| 1572 | 
            -
             | 
| 1572 | 
            +
                                              NUM2INT(vmax_level));
         | 
| 1573 1573 | 
             
              return LONG2NUM(err);
         | 
| 1574 1574 | 
             
            }
         | 
| 1575 1575 |  | 
| @@ -1595,10 +1595,10 @@ rb_s_gpgme_op_trustlist_next (VALUE dummy, VALUE vctx, VALUE ritem) | |
| 1595 1595 | 
             
                  rb_iv_set (vitem, "@type", INT2FIX(item->type));
         | 
| 1596 1596 | 
             
                  rb_iv_set (vitem, "@level", INT2FIX(item->level));
         | 
| 1597 1597 | 
             
                  if (item->owner_trust)
         | 
| 1598 | 
            -
             | 
| 1598 | 
            +
                    rb_iv_set (vitem, "@owner_trust", rb_str_new2 (item->owner_trust));
         | 
| 1599 1599 | 
             
                  rb_iv_set (vitem, "@validity", rb_str_new2 (item->validity));
         | 
| 1600 1600 | 
             
                  if (item->name)
         | 
| 1601 | 
            -
             | 
| 1601 | 
            +
                    rb_iv_set (vitem, "@name", rb_str_new2 (item->name));
         | 
| 1602 1602 | 
             
                  rb_ary_store (ritem, 0, vitem);
         | 
| 1603 1603 | 
             
                }
         | 
| 1604 1604 | 
             
              return LONG2NUM(err);
         | 
| @@ -1641,7 +1641,7 @@ rb_s_gpgme_op_decrypt (VALUE dummy, VALUE vctx, VALUE vcipher, VALUE vplain) | |
| 1641 1641 |  | 
| 1642 1642 | 
             
            static VALUE
         | 
| 1643 1643 | 
             
            rb_s_gpgme_op_decrypt_start (VALUE dummy, VALUE vctx, VALUE vcipher,
         | 
| 1644 | 
            -
             | 
| 1644 | 
            +
                                         VALUE vplain)
         | 
| 1645 1645 | 
             
            {
         | 
| 1646 1646 | 
             
              gpgme_ctx_t ctx;
         | 
| 1647 1647 | 
             
              gpgme_data_t cipher, plain;
         | 
| @@ -1678,7 +1678,7 @@ rb_s_gpgme_op_decrypt_result (VALUE dummy, VALUE vctx) | |
| 1678 1678 | 
             
              vresult = rb_class_new_instance (0, NULL, cDecryptResult);
         | 
| 1679 1679 | 
             
              if (result->unsupported_algorithm)
         | 
| 1680 1680 | 
             
                rb_iv_set (vresult, "@unsupported_algorithm",
         | 
| 1681 | 
            -
             | 
| 1681 | 
            +
                           rb_str_new2 (result->unsupported_algorithm));
         | 
| 1682 1682 | 
             
              rb_iv_set (vresult, "@wrong_key_usage", INT2FIX(result->wrong_key_usage));
         | 
| 1683 1683 | 
             
              vrecipients = rb_ary_new ();
         | 
| 1684 1684 | 
             
              rb_iv_set (vresult, "@recipients", vrecipients);
         | 
| @@ -1697,7 +1697,7 @@ rb_s_gpgme_op_decrypt_result (VALUE dummy, VALUE vctx) | |
| 1697 1697 |  | 
| 1698 1698 | 
             
            static VALUE
         | 
| 1699 1699 | 
             
            rb_s_gpgme_op_verify (VALUE dummy, VALUE vctx, VALUE vsig, VALUE vsigned_text,
         | 
| 1700 | 
            -
             | 
| 1700 | 
            +
                                  VALUE vplain)
         | 
| 1701 1701 | 
             
            {
         | 
| 1702 1702 | 
             
              gpgme_ctx_t ctx;
         | 
| 1703 1703 | 
             
              gpgme_data_t sig, signed_text = NULL, plain = NULL;
         | 
| @@ -1720,7 +1720,7 @@ rb_s_gpgme_op_verify (VALUE dummy, VALUE vctx, VALUE vsig, VALUE vsigned_text, | |
| 1720 1720 |  | 
| 1721 1721 | 
             
            static VALUE
         | 
| 1722 1722 | 
             
            rb_s_gpgme_op_verify_start (VALUE dummy, VALUE vctx, VALUE vsig,
         | 
| 1723 | 
            -
             | 
| 1723 | 
            +
                                        VALUE vsigned_text, VALUE vplain)
         | 
| 1724 1724 | 
             
            {
         | 
| 1725 1725 | 
             
              gpgme_ctx_t ctx;
         | 
| 1726 1726 | 
             
              gpgme_data_t sig, signed_text = NULL, plain = NULL;
         | 
| @@ -1763,39 +1763,39 @@ rb_s_gpgme_op_verify_result (VALUE dummy, VALUE vctx) | |
| 1763 1763 | 
             
                   signature = signature->next)
         | 
| 1764 1764 | 
             
                {
         | 
| 1765 1765 | 
             
                  VALUE vsignature = rb_class_new_instance(0, NULL, cSignature),
         | 
| 1766 | 
            -
             | 
| 1766 | 
            +
                    vnotations = rb_ary_new ();
         | 
| 1767 1767 | 
             
                  gpgme_sig_notation_t notation;
         | 
| 1768 1768 | 
             
                  rb_iv_set (vsignature, "@summary", INT2FIX(signature->summary));
         | 
| 1769 1769 | 
             
                  rb_iv_set (vsignature, "@fpr", rb_str_new2 (signature->fpr));
         | 
| 1770 1770 | 
             
                  rb_iv_set (vsignature, "@status", LONG2NUM(signature->status));
         | 
| 1771 1771 | 
             
                  rb_iv_set (vsignature, "@notations", vnotations);
         | 
| 1772 1772 | 
             
                  for (notation = signature->notations; notation;
         | 
| 1773 | 
            -
             | 
| 1774 | 
            -
             | 
| 1775 | 
            -
             | 
| 1776 | 
            -
             | 
| 1777 | 
            -
             | 
| 1778 | 
            -
             | 
| 1779 | 
            -
             | 
| 1780 | 
            -
             | 
| 1781 | 
            -
             | 
| 1782 | 
            -
             | 
| 1783 | 
            -
             | 
| 1784 | 
            -
             | 
| 1785 | 
            -
             | 
| 1773 | 
            +
                       notation = notation->next)
         | 
| 1774 | 
            +
                    {
         | 
| 1775 | 
            +
                      VALUE vnotation = rb_class_new_instance(0, NULL, cSigNotation);
         | 
| 1776 | 
            +
                      /* The docs say:
         | 
| 1777 | 
            +
                       * The name of the notation field. If this is NULL, then the member
         | 
| 1778 | 
            +
                       * value will contain a policy URL. */
         | 
| 1779 | 
            +
                      if (notation->name == NULL)
         | 
| 1780 | 
            +
                        rb_iv_set (vnotation, "@name", Qnil);
         | 
| 1781 | 
            +
                      else
         | 
| 1782 | 
            +
                        rb_iv_set (vnotation, "@name", rb_str_new2 (notation->name));
         | 
| 1783 | 
            +
                      rb_iv_set (vnotation, "@value", rb_str_new2 (notation->value));
         | 
| 1784 | 
            +
                      rb_ary_push (vnotations, vnotation);
         | 
| 1785 | 
            +
                    }
         | 
| 1786 1786 | 
             
                  rb_iv_set (vsignature, "@timestamp", ULONG2NUM(signature->timestamp));
         | 
| 1787 1787 | 
             
                  rb_iv_set (vsignature, "@exp_timestamp",
         | 
| 1788 | 
            -
             | 
| 1788 | 
            +
                             ULONG2NUM(signature->exp_timestamp));
         | 
| 1789 1789 | 
             
                  rb_iv_set (vsignature, "@wrong_key_usage",
         | 
| 1790 | 
            -
             | 
| 1790 | 
            +
                             INT2FIX(signature->wrong_key_usage));
         | 
| 1791 1791 | 
             
                  rb_iv_set (vsignature, "@validity", INT2FIX(signature->validity));
         | 
| 1792 1792 | 
             
                  rb_iv_set (vsignature, "@validity_reason",
         | 
| 1793 | 
            -
             | 
| 1793 | 
            +
                             LONG2NUM(signature->validity_reason));
         | 
| 1794 1794 | 
             
                  /* PKA related fields were added in 1.1.1. */
         | 
| 1795 1795 | 
             
            #ifdef GPGME_STATUS_PKA_TRUST_BAD
         | 
| 1796 1796 | 
             
                  rb_iv_set (vsignature, "@pka_trust", INT2FIX(signature->pka_trust));
         | 
| 1797 1797 | 
             
                  rb_iv_set (vsignature, "@pka_address",
         | 
| 1798 | 
            -
             | 
| 1798 | 
            +
                             rb_str_new2 (signature->pka_address));
         | 
| 1799 1799 | 
             
            #endif
         | 
| 1800 1800 | 
             
                  rb_ary_push (vsignatures, vsignature);
         | 
| 1801 1801 | 
             
                }
         | 
| @@ -1804,7 +1804,7 @@ rb_s_gpgme_op_verify_result (VALUE dummy, VALUE vctx) | |
| 1804 1804 |  | 
| 1805 1805 | 
             
            static VALUE
         | 
| 1806 1806 | 
             
            rb_s_gpgme_op_decrypt_verify (VALUE dummy, VALUE vctx, VALUE vcipher,
         | 
| 1807 | 
            -
             | 
| 1807 | 
            +
                                          VALUE vplain)
         | 
| 1808 1808 | 
             
            {
         | 
| 1809 1809 | 
             
              gpgme_ctx_t ctx;
         | 
| 1810 1810 | 
             
              gpgme_data_t cipher, plain;
         | 
| @@ -1824,7 +1824,7 @@ rb_s_gpgme_op_decrypt_verify (VALUE dummy, VALUE vctx, VALUE vcipher, | |
| 1824 1824 |  | 
| 1825 1825 | 
             
            static VALUE
         | 
| 1826 1826 | 
             
            rb_s_gpgme_op_decrypt_verify_start (VALUE dummy, VALUE vctx, VALUE vcipher,
         | 
| 1827 | 
            -
             | 
| 1827 | 
            +
                                                VALUE vplain)
         | 
| 1828 1828 | 
             
            {
         | 
| 1829 1829 | 
             
              gpgme_ctx_t ctx;
         | 
| 1830 1830 | 
             
              gpgme_data_t cipher, plain;
         | 
| @@ -1888,7 +1888,7 @@ rb_s_gpgme_signers_enum (VALUE dummy, VALUE vctx, VALUE vseq) | |
| 1888 1888 |  | 
| 1889 1889 | 
             
            static VALUE
         | 
| 1890 1890 | 
             
            rb_s_gpgme_op_sign (VALUE dummy, VALUE vctx, VALUE vplain, VALUE vsig,
         | 
| 1891 | 
            -
             | 
| 1891 | 
            +
                                VALUE vmode)
         | 
| 1892 1892 | 
             
            {
         | 
| 1893 1893 | 
             
              gpgme_ctx_t ctx;
         | 
| 1894 1894 | 
             
              gpgme_data_t plain, sig;
         | 
| @@ -1908,7 +1908,7 @@ rb_s_gpgme_op_sign (VALUE dummy, VALUE vctx, VALUE vplain, VALUE vsig, | |
| 1908 1908 |  | 
| 1909 1909 | 
             
            static VALUE
         | 
| 1910 1910 | 
             
            rb_s_gpgme_op_sign_start (VALUE dummy, VALUE vctx, VALUE vplain, VALUE vsig,
         | 
| 1911 | 
            -
             | 
| 1911 | 
            +
                                      VALUE vmode)
         | 
| 1912 1912 | 
             
            {
         | 
| 1913 1913 | 
             
              gpgme_ctx_t ctx;
         | 
| 1914 1914 | 
             
              gpgme_data_t plain, sig;
         | 
| @@ -1950,7 +1950,7 @@ rb_s_gpgme_op_sign_result (VALUE dummy, VALUE vctx) | |
| 1950 1950 | 
             
                   invalid_key = invalid_key->next)
         | 
| 1951 1951 | 
             
                {
         | 
| 1952 1952 | 
             
                  VALUE vinvalid_key =
         | 
| 1953 | 
            -
             | 
| 1953 | 
            +
                    rb_class_new_instance (0, NULL, cInvalidKey);
         | 
| 1954 1954 | 
             
                  rb_iv_set (vinvalid_key, "@fpr", rb_str_new2 (invalid_key->fpr));
         | 
| 1955 1955 | 
             
                  rb_iv_set (vinvalid_key, "@reason", LONG2NUM(invalid_key->reason));
         | 
| 1956 1956 | 
             
                  rb_ary_push (vinvalid_signers, vinvalid_key);
         | 
| @@ -1961,16 +1961,16 @@ rb_s_gpgme_op_sign_result (VALUE dummy, VALUE vctx) | |
| 1961 1961 | 
             
                   new_signature = new_signature->next)
         | 
| 1962 1962 | 
             
                {
         | 
| 1963 1963 | 
             
                  VALUE vnew_signature =
         | 
| 1964 | 
            -
             | 
| 1964 | 
            +
                    rb_class_new_instance (0, NULL, cNewSignature);
         | 
| 1965 1965 | 
             
                  rb_iv_set (vnew_signature, "@type", INT2FIX(new_signature->type));
         | 
| 1966 1966 | 
             
                  rb_iv_set (vnew_signature, "@pubkey_algo",
         | 
| 1967 | 
            -
             | 
| 1967 | 
            +
                             INT2FIX(new_signature->pubkey_algo));
         | 
| 1968 1968 | 
             
                  rb_iv_set (vnew_signature, "@hash_algo",
         | 
| 1969 | 
            -
             | 
| 1969 | 
            +
                             INT2FIX(new_signature->hash_algo));
         | 
| 1970 1970 | 
             
                  rb_iv_set (vnew_signature, "@sig_class",
         | 
| 1971 | 
            -
             | 
| 1971 | 
            +
                             UINT2NUM(new_signature->sig_class));
         | 
| 1972 1972 | 
             
                  rb_iv_set (vnew_signature, "@timestamp",
         | 
| 1973 | 
            -
             | 
| 1973 | 
            +
                             LONG2NUM(new_signature->timestamp));
         | 
| 1974 1974 | 
             
                  rb_iv_set (vnew_signature, "@fpr", rb_str_new2 (new_signature->fpr));
         | 
| 1975 1975 | 
             
                  rb_ary_push (vsignatures, vnew_signature);
         | 
| 1976 1976 | 
             
                }
         | 
| @@ -1979,7 +1979,7 @@ rb_s_gpgme_op_sign_result (VALUE dummy, VALUE vctx) | |
| 1979 1979 |  | 
| 1980 1980 | 
             
            static VALUE
         | 
| 1981 1981 | 
             
            rb_s_gpgme_op_encrypt (VALUE dummy, VALUE vctx, VALUE vrecp, VALUE vflags,
         | 
| 1982 | 
            -
             | 
| 1982 | 
            +
                                   VALUE vplain, VALUE vcipher)
         | 
| 1983 1983 | 
             
            {
         | 
| 1984 1984 | 
             
              gpgme_ctx_t ctx;
         | 
| 1985 1985 | 
             
              gpgme_key_t *recp = NULL;
         | 
| @@ -1998,7 +1998,7 @@ rb_s_gpgme_op_encrypt (VALUE dummy, VALUE vctx, VALUE vrecp, VALUE vflags, | |
| 1998 1998 | 
             
                  int i;
         | 
| 1999 1999 | 
             
                  recp = ALLOC_N(gpgme_key_t, RARRAY_LEN(vrecp) + 1);
         | 
| 2000 2000 | 
             
                  for (i = 0; i < RARRAY_LEN(vrecp); i++)
         | 
| 2001 | 
            -
             | 
| 2001 | 
            +
                    UNWRAP_GPGME_KEY(RARRAY_PTR(vrecp)[i], recp[i]);
         | 
| 2002 2002 | 
             
                  recp[i] = NULL;
         | 
| 2003 2003 | 
             
                }
         | 
| 2004 2004 | 
             
              UNWRAP_GPGME_DATA(vplain, plain);
         | 
| @@ -2012,7 +2012,7 @@ rb_s_gpgme_op_encrypt (VALUE dummy, VALUE vctx, VALUE vrecp, VALUE vflags, | |
| 2012 2012 |  | 
| 2013 2013 | 
             
            static VALUE
         | 
| 2014 2014 | 
             
            rb_s_gpgme_op_encrypt_start (VALUE dummy, VALUE vctx, VALUE vrecp,
         | 
| 2015 | 
            -
             | 
| 2015 | 
            +
                                         VALUE vflags, VALUE vplain, VALUE vcipher)
         | 
| 2016 2016 | 
             
            {
         | 
| 2017 2017 | 
             
              gpgme_ctx_t ctx;
         | 
| 2018 2018 | 
             
              gpgme_key_t *recp = NULL;
         | 
| @@ -2031,7 +2031,7 @@ rb_s_gpgme_op_encrypt_start (VALUE dummy, VALUE vctx, VALUE vrecp, | |
| 2031 2031 | 
             
                  int i;
         | 
| 2032 2032 | 
             
                  recp = ALLOC_N(gpgme_key_t, RARRAY_LEN(vrecp) + 1);
         | 
| 2033 2033 | 
             
                  for (i = 0; i < RARRAY_LEN(vrecp); i++)
         | 
| 2034 | 
            -
             | 
| 2034 | 
            +
                    UNWRAP_GPGME_KEY(RARRAY_PTR(vrecp)[i], recp[i]);
         | 
| 2035 2035 | 
             
                  recp[i] = NULL;
         | 
| 2036 2036 | 
             
                }
         | 
| 2037 2037 | 
             
              UNWRAP_GPGME_DATA(vplain, plain);
         | 
| @@ -2068,7 +2068,7 @@ rb_s_gpgme_op_encrypt_result (VALUE dummy, VALUE vctx) | |
| 2068 2068 | 
             
                   invalid_key = invalid_key->next)
         | 
| 2069 2069 | 
             
                {
         | 
| 2070 2070 | 
             
                  VALUE vinvalid_key =
         | 
| 2071 | 
            -
             | 
| 2071 | 
            +
                    rb_class_new_instance (0, NULL, cInvalidKey);
         | 
| 2072 2072 | 
             
                  rb_iv_set (vinvalid_key, "@fpr", rb_str_new2 (invalid_key->fpr));
         | 
| 2073 2073 | 
             
                  rb_iv_set (vinvalid_key, "@reason", LONG2NUM(invalid_key->reason));
         | 
| 2074 2074 | 
             
                  rb_ary_push (vinvalid_recipients, vinvalid_key);
         | 
| @@ -2078,7 +2078,7 @@ rb_s_gpgme_op_encrypt_result (VALUE dummy, VALUE vctx) | |
| 2078 2078 |  | 
| 2079 2079 | 
             
            static VALUE
         | 
| 2080 2080 | 
             
            rb_s_gpgme_op_encrypt_sign (VALUE dummy, VALUE vctx, VALUE vrecp, VALUE vflags,
         | 
| 2081 | 
            -
             | 
| 2081 | 
            +
                                        VALUE vplain, VALUE vcipher)
         | 
| 2082 2082 | 
             
            {
         | 
| 2083 2083 | 
             
              gpgme_ctx_t ctx;
         | 
| 2084 2084 | 
             
              gpgme_key_t *recp = NULL;
         | 
| @@ -2097,7 +2097,7 @@ rb_s_gpgme_op_encrypt_sign (VALUE dummy, VALUE vctx, VALUE vrecp, VALUE vflags, | |
| 2097 2097 | 
             
                  int i;
         | 
| 2098 2098 | 
             
                  recp = ALLOC_N(gpgme_key_t, RARRAY_LEN(vrecp) + 1);
         | 
| 2099 2099 | 
             
                  for (i = 0; i < RARRAY_LEN(vrecp); i++)
         | 
| 2100 | 
            -
             | 
| 2100 | 
            +
                    UNWRAP_GPGME_KEY(RARRAY_PTR(vrecp)[i], recp[i]);
         | 
| 2101 2101 | 
             
                  recp[i] = NULL;
         | 
| 2102 2102 | 
             
                }
         | 
| 2103 2103 | 
             
              UNWRAP_GPGME_DATA(vplain, plain);
         | 
| @@ -2111,7 +2111,7 @@ rb_s_gpgme_op_encrypt_sign (VALUE dummy, VALUE vctx, VALUE vrecp, VALUE vflags, | |
| 2111 2111 |  | 
| 2112 2112 | 
             
            static VALUE
         | 
| 2113 2113 | 
             
            rb_s_gpgme_op_encrypt_sign_start (VALUE dummy, VALUE vctx, VALUE vrecp,
         | 
| 2114 | 
            -
             | 
| 2114 | 
            +
                                              VALUE vflags, VALUE vplain, VALUE vcipher)
         | 
| 2115 2115 | 
             
            {
         | 
| 2116 2116 | 
             
              gpgme_ctx_t ctx;
         | 
| 2117 2117 | 
             
              gpgme_key_t *recp = NULL;
         | 
| @@ -2130,14 +2130,14 @@ rb_s_gpgme_op_encrypt_sign_start (VALUE dummy, VALUE vctx, VALUE vrecp, | |
| 2130 2130 | 
             
                  int i;
         | 
| 2131 2131 | 
             
                  recp = ALLOC_N(gpgme_key_t, RARRAY_LEN(vrecp) + 1);
         | 
| 2132 2132 | 
             
                  for (i = 0; i < RARRAY_LEN(vrecp); i++)
         | 
| 2133 | 
            -
             | 
| 2133 | 
            +
                    UNWRAP_GPGME_KEY(RARRAY_PTR(vrecp)[i], recp[i]);
         | 
| 2134 2134 | 
             
                  recp[i] = NULL;
         | 
| 2135 2135 | 
             
                }
         | 
| 2136 2136 | 
             
              UNWRAP_GPGME_DATA(vplain, plain);
         | 
| 2137 2137 | 
             
              UNWRAP_GPGME_DATA(vcipher, cipher);
         | 
| 2138 2138 |  | 
| 2139 2139 | 
             
              err = gpgme_op_encrypt_sign_start (ctx, recp, NUM2INT(vflags), plain,
         | 
| 2140 | 
            -
             | 
| 2140 | 
            +
                                                 cipher);
         | 
| 2141 2141 | 
             
              if (recp)
         | 
| 2142 2142 | 
             
                xfree (recp);
         | 
| 2143 2143 | 
             
              return LONG2NUM(err);
         | 
| @@ -2155,7 +2155,7 @@ rb_s_gpgme_wait (VALUE dummy, VALUE vctx, VALUE rstatus, VALUE vhang) | |
| 2155 2155 | 
             
                {
         | 
| 2156 2156 | 
             
                  UNWRAP_GPGME_CTX(vctx, ctx);
         | 
| 2157 2157 | 
             
                  if (!ctx)
         | 
| 2158 | 
            -
             | 
| 2158 | 
            +
                    rb_raise (rb_eArgError, "released ctx");
         | 
| 2159 2159 | 
             
                }
         | 
| 2160 2160 |  | 
| 2161 2161 | 
             
              ret = gpgme_wait (ctx, &status, NUM2INT(vhang));
         | 
| @@ -2163,7 +2163,7 @@ rb_s_gpgme_wait (VALUE dummy, VALUE vctx, VALUE rstatus, VALUE vhang) | |
| 2163 2163 | 
             
                {
         | 
| 2164 2164 | 
             
                  rb_ary_store (rstatus, 0, INT2NUM(status));
         | 
| 2165 2165 | 
             
                  if (ret != ctx)
         | 
| 2166 | 
            -
             | 
| 2166 | 
            +
                    vctx = WRAP_GPGME_CTX(ret);
         | 
| 2167 2167 | 
             
                  return vctx;
         | 
| 2168 2168 | 
             
                }
         | 
| 2169 2169 | 
             
              return Qnil;
         | 
| @@ -2172,8 +2172,8 @@ rb_s_gpgme_wait (VALUE dummy, VALUE vctx, VALUE rstatus, VALUE vhang) | |
| 2172 2172 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010500
         | 
| 2173 2173 | 
             
            static VALUE
         | 
| 2174 2174 | 
             
            rb_s_gpgme_op_spawn_start (VALUE dummy, VALUE vctx, VALUE vfile,
         | 
| 2175 | 
            -
             | 
| 2176 | 
            -
             | 
| 2175 | 
            +
                                       VALUE vargv, VALUE vdatain, VALUE vdataout,
         | 
| 2176 | 
            +
                                       VALUE vdataerr, VALUE vflags)
         | 
| 2177 2177 | 
             
            {
         | 
| 2178 2178 | 
             
              gpgme_ctx_t ctx;
         | 
| 2179 2179 | 
             
              const char *file;
         | 
| @@ -2199,7 +2199,7 @@ rb_s_gpgme_op_spawn_start (VALUE dummy, VALUE vctx, VALUE vfile, | |
| 2199 2199 |  | 
| 2200 2200 | 
             
                  argv = ALLOC_N(const char *, RARRAY_LEN(vargv) + 1);
         | 
| 2201 2201 | 
             
                  for (i = 0; i < RARRAY_LEN(vargv); i++)
         | 
| 2202 | 
            -
             | 
| 2202 | 
            +
                    argv[i] = StringValueCStr(RARRAY_PTR(vargv)[i]);
         | 
| 2203 2203 | 
             
                  argv[i] = NULL;
         | 
| 2204 2204 | 
             
                }
         | 
| 2205 2205 |  | 
| @@ -2208,7 +2208,7 @@ rb_s_gpgme_op_spawn_start (VALUE dummy, VALUE vctx, VALUE vfile, | |
| 2208 2208 | 
             
              UNWRAP_GPGME_DATA(vdataerr, dataerr);
         | 
| 2209 2209 |  | 
| 2210 2210 | 
             
              err = gpgme_op_spawn_start (ctx, file, argv, datain, dataout, dataerr,
         | 
| 2211 | 
            -
             | 
| 2211 | 
            +
                                          NUM2INT(vflags));
         | 
| 2212 2212 | 
             
              if (argv)
         | 
| 2213 2213 | 
             
                xfree (argv);
         | 
| 2214 2214 | 
             
              return LONG2NUM(err);
         | 
| @@ -2216,8 +2216,8 @@ rb_s_gpgme_op_spawn_start (VALUE dummy, VALUE vctx, VALUE vfile, | |
| 2216 2216 |  | 
| 2217 2217 | 
             
            static VALUE
         | 
| 2218 2218 | 
             
            rb_s_gpgme_op_spawn (VALUE dummy, VALUE vctx, VALUE vfile,
         | 
| 2219 | 
            -
             | 
| 2220 | 
            -
             | 
| 2219 | 
            +
                                 VALUE vargv, VALUE vdatain, VALUE vdataout,
         | 
| 2220 | 
            +
                                 VALUE vdataerr, VALUE vflags)
         | 
| 2221 2221 | 
             
            {
         | 
| 2222 2222 | 
             
              gpgme_ctx_t ctx;
         | 
| 2223 2223 | 
             
              const char *file;
         | 
| @@ -2243,7 +2243,7 @@ rb_s_gpgme_op_spawn (VALUE dummy, VALUE vctx, VALUE vfile, | |
| 2243 2243 |  | 
| 2244 2244 | 
             
                  argv = ALLOC_N(const char *, RARRAY_LEN(vargv) + 1);
         | 
| 2245 2245 | 
             
                  for (i = 0; i < RARRAY_LEN(vargv); i++)
         | 
| 2246 | 
            -
             | 
| 2246 | 
            +
                    argv[i] = StringValueCStr(RARRAY_PTR(vargv)[i]);
         | 
| 2247 2247 | 
             
                  argv[i] = NULL;
         | 
| 2248 2248 | 
             
                }
         | 
| 2249 2249 |  | 
| @@ -2252,7 +2252,7 @@ rb_s_gpgme_op_spawn (VALUE dummy, VALUE vctx, VALUE vfile, | |
| 2252 2252 | 
             
              UNWRAP_GPGME_DATA(vdataerr, dataerr);
         | 
| 2253 2253 |  | 
| 2254 2254 | 
             
              err = gpgme_op_spawn (ctx, file, argv, datain, dataout, dataerr,
         | 
| 2255 | 
            -
             | 
| 2255 | 
            +
                                    NUM2INT(vflags));
         | 
| 2256 2256 | 
             
              if (argv)
         | 
| 2257 2257 | 
             
                xfree (argv);
         | 
| 2258 2258 | 
             
              return LONG2NUM(err);
         | 
| @@ -2268,40 +2268,43 @@ Init_gpgme_n (void) | |
| 2268 2268 |  | 
| 2269 2269 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010500
         | 
| 2270 2270 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_dirinfo",
         | 
| 2271 | 
            -
             | 
| 2271 | 
            +
                                         rb_s_gpgme_get_dirinfo, 1);
         | 
| 2272 2272 | 
             
            #endif
         | 
| 2273 2273 | 
             
              rb_define_module_function (mGPGME, "gpgme_check_version",
         | 
| 2274 | 
            -
             | 
| 2274 | 
            +
                                         rb_s_gpgme_check_version, 1);
         | 
| 2275 2275 | 
             
              rb_define_module_function (mGPGME, "gpgme_engine_check_version",
         | 
| 2276 | 
            -
             | 
| 2276 | 
            +
                                         rb_s_gpgme_engine_check_version, 1);
         | 
| 2277 2277 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_engine_info",
         | 
| 2278 | 
            -
             | 
| 2278 | 
            +
                                         rb_s_gpgme_get_engine_info, 1);
         | 
| 2279 2279 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_engine_info",
         | 
| 2280 | 
            -
             | 
| 2280 | 
            +
                                         rb_s_gpgme_set_engine_info, 3);
         | 
| 2281 2281 | 
             
              rb_define_module_function (mGPGME, "gpgme_ctx_get_engine_info",
         | 
| 2282 2282 | 
             
                       rb_s_gpgme_ctx_get_engine_info, 2);
         | 
| 2283 2283 | 
             
              rb_define_module_function (mGPGME, "gpgme_ctx_set_engine_info",
         | 
| 2284 2284 | 
             
                       rb_s_gpgme_ctx_set_engine_info, 4);
         | 
| 2285 2285 | 
             
              rb_define_module_function (mGPGME, "gpgme_pubkey_algo_name",
         | 
| 2286 | 
            -
             | 
| 2286 | 
            +
                                         rb_s_gpgme_pubkey_algo_name, 1);
         | 
| 2287 2287 | 
             
              rb_define_module_function (mGPGME, "gpgme_hash_algo_name",
         | 
| 2288 | 
            -
             | 
| 2288 | 
            +
                                         rb_s_gpgme_hash_algo_name, 1);
         | 
| 2289 2289 |  | 
| 2290 2290 | 
             
              rb_define_module_function (mGPGME, "gpgme_err_code",
         | 
| 2291 | 
            -
             | 
| 2291 | 
            +
                                         rb_s_gpgme_err_code, 1);
         | 
| 2292 2292 | 
             
              rb_define_module_function (mGPGME, "gpgme_err_source",
         | 
| 2293 | 
            -
             | 
| 2293 | 
            +
                                         rb_s_gpgme_err_source, 1);
         | 
| 2294 2294 | 
             
              rb_define_module_function (mGPGME, "gpgme_strerror",
         | 
| 2295 | 
            -
             | 
| 2295 | 
            +
                                         rb_s_gpgme_strerror, 1);
         | 
| 2296 2296 |  | 
| 2297 2297 | 
             
              cEngineInfo =
         | 
| 2298 2298 | 
             
                rb_define_class_under (mGPGME, "EngineInfo", rb_cObject);
         | 
| 2299 2299 | 
             
              cCtx =
         | 
| 2300 2300 | 
             
                rb_define_class_under (mGPGME, "Ctx", rb_cObject);
         | 
| 2301 | 
            +
              rb_undef_alloc_func(cCtx);
         | 
| 2301 2302 | 
             
              cData =
         | 
| 2302 2303 | 
             
                rb_define_class_under (mGPGME, "Data", rb_cObject);
         | 
| 2304 | 
            +
              rb_undef_alloc_func(cData);
         | 
| 2303 2305 | 
             
              cKey =
         | 
| 2304 2306 | 
             
                rb_define_class_under (mGPGME, "Key", rb_cObject);
         | 
| 2307 | 
            +
              rb_undef_alloc_func(cKey);
         | 
| 2305 2308 | 
             
              cSubKey =
         | 
| 2306 2309 | 
             
                rb_define_class_under (mGPGME, "SubKey", rb_cObject);
         | 
| 2307 2310 | 
             
              cUserID =
         | 
| @@ -2338,204 +2341,204 @@ Init_gpgme_n (void) | |
| 2338 2341 | 
             
               * gpgme_data_new_from_filepart is not currently supported.
         | 
| 2339 2342 | 
             
               */
         | 
| 2340 2343 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_new",
         | 
| 2341 | 
            -
             | 
| 2344 | 
            +
                                         rb_s_gpgme_data_new, 1);
         | 
| 2342 2345 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_new_from_mem",
         | 
| 2343 | 
            -
             | 
| 2346 | 
            +
                                         rb_s_gpgme_data_new_from_mem, 3);
         | 
| 2344 2347 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_new_from_fd",
         | 
| 2345 | 
            -
             | 
| 2348 | 
            +
                                         rb_s_gpgme_data_new_from_fd, 2);
         | 
| 2346 2349 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_new_from_cbs",
         | 
| 2347 | 
            -
             | 
| 2350 | 
            +
                                         rb_s_gpgme_data_new_from_cbs, 3);
         | 
| 2348 2351 |  | 
| 2349 2352 | 
             
              /* Manipulating Data Buffers */
         | 
| 2350 2353 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_read",
         | 
| 2351 | 
            -
             | 
| 2354 | 
            +
                                         rb_s_gpgme_data_read, 2);
         | 
| 2352 2355 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_seek",
         | 
| 2353 | 
            -
             | 
| 2356 | 
            +
                                         rb_s_gpgme_data_seek, 3);
         | 
| 2354 2357 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_write",
         | 
| 2355 | 
            -
             | 
| 2358 | 
            +
                                         rb_s_gpgme_data_write, 3);
         | 
| 2356 2359 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_get_encoding",
         | 
| 2357 | 
            -
             | 
| 2360 | 
            +
                                         rb_s_gpgme_data_get_encoding, 1);
         | 
| 2358 2361 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_set_encoding",
         | 
| 2359 | 
            -
             | 
| 2362 | 
            +
                                         rb_s_gpgme_data_set_encoding, 2);
         | 
| 2360 2363 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_get_file_name",
         | 
| 2361 | 
            -
             | 
| 2364 | 
            +
                                         rb_s_gpgme_data_get_file_name, 1);
         | 
| 2362 2365 | 
             
              rb_define_module_function (mGPGME, "gpgme_data_set_file_name",
         | 
| 2363 | 
            -
             | 
| 2366 | 
            +
                                         rb_s_gpgme_data_set_file_name, 2);
         | 
| 2364 2367 |  | 
| 2365 2368 | 
             
              /* Creating Contexts */
         | 
| 2366 2369 | 
             
              rb_define_module_function (mGPGME, "gpgme_new",
         | 
| 2367 | 
            -
             | 
| 2370 | 
            +
                                         rb_s_gpgme_new, 1);
         | 
| 2368 2371 | 
             
              rb_define_module_function (mGPGME, "gpgme_release",
         | 
| 2369 | 
            -
             | 
| 2372 | 
            +
                                         rb_s_gpgme_release, 1);
         | 
| 2370 2373 |  | 
| 2371 2374 | 
             
              /* Context Attributes */
         | 
| 2372 2375 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_protocol",
         | 
| 2373 | 
            -
             | 
| 2376 | 
            +
                                         rb_s_gpgme_set_protocol, 2);
         | 
| 2374 2377 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_protocol",
         | 
| 2375 | 
            -
             | 
| 2378 | 
            +
                                         rb_s_gpgme_get_protocol, 1);
         | 
| 2376 2379 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_armor",
         | 
| 2377 | 
            -
             | 
| 2380 | 
            +
                                         rb_s_gpgme_set_armor, 2);
         | 
| 2378 2381 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_armor",
         | 
| 2379 | 
            -
             | 
| 2382 | 
            +
                                         rb_s_gpgme_get_armor, 1);
         | 
| 2380 2383 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_textmode",
         | 
| 2381 | 
            -
             | 
| 2384 | 
            +
                                         rb_s_gpgme_set_textmode, 2);
         | 
| 2382 2385 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_textmode",
         | 
| 2383 | 
            -
             | 
| 2386 | 
            +
                                         rb_s_gpgme_get_textmode, 1);
         | 
| 2384 2387 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_include_certs",
         | 
| 2385 | 
            -
             | 
| 2388 | 
            +
                                         rb_s_gpgme_set_include_certs, 2);
         | 
| 2386 2389 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_include_certs",
         | 
| 2387 | 
            -
             | 
| 2390 | 
            +
                                         rb_s_gpgme_get_include_certs, 1);
         | 
| 2388 2391 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_keylist_mode",
         | 
| 2389 | 
            -
             | 
| 2392 | 
            +
                                         rb_s_gpgme_set_keylist_mode, 2);
         | 
| 2390 2393 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_keylist_mode",
         | 
| 2391 | 
            -
             | 
| 2394 | 
            +
                                         rb_s_gpgme_get_keylist_mode, 1);
         | 
| 2392 2395 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010400
         | 
| 2393 2396 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_pinentry_mode",
         | 
| 2394 | 
            -
             | 
| 2397 | 
            +
                                         rb_s_gpgme_set_pinentry_mode, 2);
         | 
| 2395 2398 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_pinentry_mode",
         | 
| 2396 | 
            -
             | 
| 2399 | 
            +
                                         rb_s_gpgme_get_pinentry_mode, 1);
         | 
| 2397 2400 | 
             
            #endif
         | 
| 2398 2401 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_passphrase_cb",
         | 
| 2399 | 
            -
             | 
| 2402 | 
            +
                                         rb_s_gpgme_set_passphrase_cb, 3);
         | 
| 2400 2403 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_passphrase_cb",
         | 
| 2401 | 
            -
             | 
| 2404 | 
            +
                                         rb_s_gpgme_get_passphrase_cb, 3);
         | 
| 2402 2405 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_progress_cb",
         | 
| 2403 | 
            -
             | 
| 2406 | 
            +
                                         rb_s_gpgme_set_progress_cb, 3);
         | 
| 2404 2407 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_progress_cb",
         | 
| 2405 | 
            -
             | 
| 2408 | 
            +
                                         rb_s_gpgme_get_progress_cb, 3);
         | 
| 2406 2409 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_locale",
         | 
| 2407 | 
            -
             | 
| 2410 | 
            +
                                         rb_s_gpgme_set_locale, 3);
         | 
| 2408 2411 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010600
         | 
| 2409 2412 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_offline",
         | 
| 2410 | 
            -
             | 
| 2413 | 
            +
                                         rb_s_gpgme_set_offline, 2);
         | 
| 2411 2414 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_offline",
         | 
| 2412 | 
            -
             | 
| 2415 | 
            +
                                         rb_s_gpgme_get_offline, 1);
         | 
| 2413 2416 | 
             
              rb_define_module_function (mGPGME, "gpgme_set_status_cb",
         | 
| 2414 | 
            -
             | 
| 2417 | 
            +
                                         rb_s_gpgme_set_status_cb, 3);
         | 
| 2415 2418 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_status_cb",
         | 
| 2416 | 
            -
             | 
| 2419 | 
            +
                                         rb_s_gpgme_get_status_cb, 3);
         | 
| 2417 2420 | 
             
            #endif
         | 
| 2418 2421 |  | 
| 2419 2422 | 
             
              /* Key Management */
         | 
| 2420 2423 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_keylist_start",
         | 
| 2421 | 
            -
             | 
| 2424 | 
            +
                                         rb_s_gpgme_op_keylist_start, 3);
         | 
| 2422 2425 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_keylist_ext_start",
         | 
| 2423 | 
            -
             | 
| 2426 | 
            +
                                         rb_s_gpgme_op_keylist_ext_start, 4);
         | 
| 2424 2427 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_keylist_next",
         | 
| 2425 | 
            -
             | 
| 2428 | 
            +
                                         rb_s_gpgme_op_keylist_next, 2);
         | 
| 2426 2429 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_keylist_end",
         | 
| 2427 | 
            -
             | 
| 2430 | 
            +
                                         rb_s_gpgme_op_keylist_end, 1);
         | 
| 2428 2431 | 
             
              rb_define_module_function (mGPGME, "gpgme_get_key",
         | 
| 2429 | 
            -
             | 
| 2432 | 
            +
                                         rb_s_gpgme_get_key, 4);
         | 
| 2430 2433 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_genkey",
         | 
| 2431 | 
            -
             | 
| 2434 | 
            +
                                         rb_s_gpgme_op_genkey, 4);
         | 
| 2432 2435 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_genkey_start",
         | 
| 2433 | 
            -
             | 
| 2436 | 
            +
                                         rb_s_gpgme_op_genkey_start, 4);
         | 
| 2434 2437 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_export",
         | 
| 2435 | 
            -
             | 
| 2438 | 
            +
                                         rb_s_gpgme_op_export, 4);
         | 
| 2436 2439 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_export_start",
         | 
| 2437 | 
            -
             | 
| 2440 | 
            +
                                         rb_s_gpgme_op_export_start, 4);
         | 
| 2438 2441 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_export_ext",
         | 
| 2439 | 
            -
             | 
| 2442 | 
            +
                                         rb_s_gpgme_op_export_ext, 4);
         | 
| 2440 2443 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_export_ext_start",
         | 
| 2441 | 
            -
             | 
| 2444 | 
            +
                                         rb_s_gpgme_op_export_ext_start, 4);
         | 
| 2442 2445 | 
             
            #ifdef HAVE_GPGME_OP_EXPORT_KEYS
         | 
| 2443 2446 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_export_keys",
         | 
| 2444 | 
            -
             | 
| 2447 | 
            +
                                         rb_s_gpgme_op_export_keys, 4);
         | 
| 2445 2448 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_export_keys_start",
         | 
| 2446 | 
            -
             | 
| 2449 | 
            +
                                         rb_s_gpgme_op_export_keys_start, 4);
         | 
| 2447 2450 | 
             
            #endif
         | 
| 2448 2451 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_import",
         | 
| 2449 | 
            -
             | 
| 2452 | 
            +
                                         rb_s_gpgme_op_import, 2);
         | 
| 2450 2453 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_import_start",
         | 
| 2451 | 
            -
             | 
| 2454 | 
            +
                                         rb_s_gpgme_op_import_start, 2);
         | 
| 2452 2455 | 
             
            #ifdef HAVE_GPGME_OP_EXPORT_KEYS
         | 
| 2453 2456 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_import_keys",
         | 
| 2454 | 
            -
             | 
| 2457 | 
            +
                                         rb_s_gpgme_op_import_keys, 2);
         | 
| 2455 2458 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_import_keys_start",
         | 
| 2456 | 
            -
             | 
| 2459 | 
            +
                                         rb_s_gpgme_op_import_keys_start, 2);
         | 
| 2457 2460 | 
             
            #endif
         | 
| 2458 2461 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_import_result",
         | 
| 2459 | 
            -
             | 
| 2462 | 
            +
                                         rb_s_gpgme_op_import_result, 1);
         | 
| 2460 2463 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_delete",
         | 
| 2461 | 
            -
             | 
| 2464 | 
            +
                                         rb_s_gpgme_op_delete, 3);
         | 
| 2462 2465 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_delete_start",
         | 
| 2463 | 
            -
             | 
| 2466 | 
            +
                                         rb_s_gpgme_op_delete_start, 3);
         | 
| 2464 2467 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_edit",
         | 
| 2465 | 
            -
             | 
| 2468 | 
            +
                                         rb_s_gpgme_op_edit, 5);
         | 
| 2466 2469 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_edit_start",
         | 
| 2467 | 
            -
             | 
| 2470 | 
            +
                                         rb_s_gpgme_op_edit_start, 5);
         | 
| 2468 2471 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_card_edit",
         | 
| 2469 | 
            -
             | 
| 2472 | 
            +
                                         rb_s_gpgme_op_card_edit, 5);
         | 
| 2470 2473 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_card_edit_start",
         | 
| 2471 | 
            -
             | 
| 2474 | 
            +
                                         rb_s_gpgme_op_card_edit_start, 5);
         | 
| 2472 2475 |  | 
| 2473 2476 | 
             
              /* Trust Item Management */
         | 
| 2474 2477 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_trustlist_start",
         | 
| 2475 | 
            -
             | 
| 2478 | 
            +
                                         rb_s_gpgme_op_trustlist_start, 3);
         | 
| 2476 2479 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_trustlist_next",
         | 
| 2477 | 
            -
             | 
| 2480 | 
            +
                                         rb_s_gpgme_op_trustlist_next, 2);
         | 
| 2478 2481 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_trustlist_end",
         | 
| 2479 | 
            -
             | 
| 2482 | 
            +
                                         rb_s_gpgme_op_trustlist_end, 1);
         | 
| 2480 2483 |  | 
| 2481 2484 | 
             
              /* Decrypt */
         | 
| 2482 2485 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_decrypt",
         | 
| 2483 | 
            -
             | 
| 2486 | 
            +
                                         rb_s_gpgme_op_decrypt, 3);
         | 
| 2484 2487 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_decrypt_start",
         | 
| 2485 | 
            -
             | 
| 2488 | 
            +
                                         rb_s_gpgme_op_decrypt_start, 3);
         | 
| 2486 2489 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_decrypt_result",
         | 
| 2487 | 
            -
             | 
| 2490 | 
            +
                                         rb_s_gpgme_op_decrypt_result, 1);
         | 
| 2488 2491 |  | 
| 2489 2492 | 
             
              /* Verify */
         | 
| 2490 2493 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_verify",
         | 
| 2491 | 
            -
             | 
| 2494 | 
            +
                                         rb_s_gpgme_op_verify, 4);
         | 
| 2492 2495 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_verify_start",
         | 
| 2493 | 
            -
             | 
| 2496 | 
            +
                                         rb_s_gpgme_op_verify_start, 4);
         | 
| 2494 2497 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_verify_result",
         | 
| 2495 | 
            -
             | 
| 2498 | 
            +
                                         rb_s_gpgme_op_verify_result, 1);
         | 
| 2496 2499 |  | 
| 2497 2500 | 
             
              /* Decrypt and Verify */
         | 
| 2498 2501 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_decrypt_verify",
         | 
| 2499 | 
            -
             | 
| 2502 | 
            +
                                         rb_s_gpgme_op_decrypt_verify, 3);
         | 
| 2500 2503 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_decrypt_verify_start",
         | 
| 2501 | 
            -
             | 
| 2504 | 
            +
                                         rb_s_gpgme_op_decrypt_verify_start, 3);
         | 
| 2502 2505 |  | 
| 2503 2506 | 
             
              /* Sign */
         | 
| 2504 2507 | 
             
              rb_define_module_function (mGPGME, "gpgme_signers_clear",
         | 
| 2505 | 
            -
             | 
| 2508 | 
            +
                                         rb_s_gpgme_signers_clear, 1);
         | 
| 2506 2509 | 
             
              rb_define_module_function (mGPGME, "gpgme_signers_add",
         | 
| 2507 | 
            -
             | 
| 2510 | 
            +
                                         rb_s_gpgme_signers_add, 2);
         | 
| 2508 2511 | 
             
              rb_define_module_function (mGPGME, "gpgme_signers_enum",
         | 
| 2509 | 
            -
             | 
| 2512 | 
            +
                                         rb_s_gpgme_signers_enum, 2);
         | 
| 2510 2513 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_sign",
         | 
| 2511 | 
            -
             | 
| 2514 | 
            +
                                         rb_s_gpgme_op_sign, 4);
         | 
| 2512 2515 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_sign_start",
         | 
| 2513 | 
            -
             | 
| 2516 | 
            +
                                         rb_s_gpgme_op_sign_start, 4);
         | 
| 2514 2517 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_sign_result",
         | 
| 2515 | 
            -
             | 
| 2518 | 
            +
                                         rb_s_gpgme_op_sign_result, 1);
         | 
| 2516 2519 |  | 
| 2517 2520 | 
             
              /* Encrypt */
         | 
| 2518 2521 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_encrypt",
         | 
| 2519 | 
            -
             | 
| 2522 | 
            +
                                         rb_s_gpgme_op_encrypt, 5);
         | 
| 2520 2523 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_encrypt_start",
         | 
| 2521 | 
            -
             | 
| 2524 | 
            +
                                         rb_s_gpgme_op_encrypt_start, 5);
         | 
| 2522 2525 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_encrypt_result",
         | 
| 2523 | 
            -
             | 
| 2526 | 
            +
                                         rb_s_gpgme_op_encrypt_result, 1);
         | 
| 2524 2527 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_encrypt_sign",
         | 
| 2525 | 
            -
             | 
| 2528 | 
            +
                                         rb_s_gpgme_op_encrypt_sign, 5);
         | 
| 2526 2529 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_encrypt_sign_start",
         | 
| 2527 | 
            -
             | 
| 2530 | 
            +
                                         rb_s_gpgme_op_encrypt_sign_start, 5);
         | 
| 2528 2531 |  | 
| 2529 2532 | 
             
              /* Run Control */
         | 
| 2530 2533 | 
             
              rb_define_module_function (mGPGME, "gpgme_wait",
         | 
| 2531 | 
            -
             | 
| 2534 | 
            +
                                         rb_s_gpgme_wait, 3);
         | 
| 2532 2535 |  | 
| 2533 2536 | 
             
              /* Running other Programs */
         | 
| 2534 2537 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010500
         | 
| 2535 2538 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_spawn",
         | 
| 2536 | 
            -
             | 
| 2539 | 
            +
                                         rb_s_gpgme_op_spawn, 7);
         | 
| 2537 2540 | 
             
              rb_define_module_function (mGPGME, "gpgme_op_spawn_start",
         | 
| 2538 | 
            -
             | 
| 2541 | 
            +
                                         rb_s_gpgme_op_spawn_start, 7);
         | 
| 2539 2542 | 
             
            #endif
         | 
| 2540 2543 |  | 
| 2541 2544 | 
             
              /* gpgme_pubkey_algo_t */
         | 
| @@ -2565,245 +2568,245 @@ Init_gpgme_n (void) | |
| 2565 2568 | 
             
              rb_define_const (mGPGME, "GPGME_MD_MD4", INT2FIX(GPGME_MD_MD4));
         | 
| 2566 2569 | 
             
              rb_define_const (mGPGME, "GPGME_MD_CRC32", INT2FIX(GPGME_MD_CRC32));
         | 
| 2567 2570 | 
             
              rb_define_const (mGPGME, "GPGME_MD_CRC32_RFC1510",
         | 
| 2568 | 
            -
             | 
| 2571 | 
            +
                               INT2FIX(GPGME_MD_CRC32_RFC1510));
         | 
| 2569 2572 | 
             
              rb_define_const (mGPGME, "GPGME_MD_CRC24_RFC2440",
         | 
| 2570 | 
            -
             | 
| 2573 | 
            +
                               INT2FIX(GPGME_MD_CRC24_RFC2440));
         | 
| 2571 2574 |  | 
| 2572 2575 | 
             
              /* gpgme_err_code_t */
         | 
| 2573 2576 | 
             
              rb_define_const (mGPGME, "GPG_ERR_EOF",
         | 
| 2574 | 
            -
             | 
| 2577 | 
            +
                               INT2FIX(GPG_ERR_EOF));
         | 
| 2575 2578 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NO_ERROR",
         | 
| 2576 | 
            -
             | 
| 2579 | 
            +
                               INT2FIX(GPG_ERR_NO_ERROR));
         | 
| 2577 2580 | 
             
              rb_define_const (mGPGME, "GPG_ERR_GENERAL",
         | 
| 2578 | 
            -
             | 
| 2581 | 
            +
                               INT2FIX(GPG_ERR_GENERAL));
         | 
| 2579 2582 | 
             
              rb_define_const (mGPGME, "GPG_ERR_ENOMEM",
         | 
| 2580 | 
            -
             | 
| 2583 | 
            +
                               INT2FIX(GPG_ERR_ENOMEM));
         | 
| 2581 2584 | 
             
              rb_define_const (mGPGME, "GPG_ERR_INV_VALUE",
         | 
| 2582 | 
            -
             | 
| 2585 | 
            +
                               INT2FIX(GPG_ERR_INV_VALUE));
         | 
| 2583 2586 | 
             
              rb_define_const (mGPGME, "GPG_ERR_UNUSABLE_PUBKEY",
         | 
| 2584 | 
            -
             | 
| 2587 | 
            +
                               INT2FIX(GPG_ERR_UNUSABLE_PUBKEY));
         | 
| 2585 2588 | 
             
              rb_define_const (mGPGME, "GPG_ERR_UNUSABLE_SECKEY",
         | 
| 2586 | 
            -
             | 
| 2589 | 
            +
                               INT2FIX(GPG_ERR_UNUSABLE_SECKEY));
         | 
| 2587 2590 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NO_DATA",
         | 
| 2588 | 
            -
             | 
| 2591 | 
            +
                               INT2FIX(GPG_ERR_NO_DATA));
         | 
| 2589 2592 | 
             
              rb_define_const (mGPGME, "GPG_ERR_CONFLICT",
         | 
| 2590 | 
            -
             | 
| 2593 | 
            +
                               INT2FIX(GPG_ERR_CONFLICT));
         | 
| 2591 2594 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NOT_IMPLEMENTED",
         | 
| 2592 | 
            -
             | 
| 2595 | 
            +
                               INT2FIX(GPG_ERR_NOT_IMPLEMENTED));
         | 
| 2593 2596 | 
             
              rb_define_const (mGPGME, "GPG_ERR_DECRYPT_FAILED",
         | 
| 2594 | 
            -
             | 
| 2597 | 
            +
                               INT2FIX(GPG_ERR_DECRYPT_FAILED));
         | 
| 2595 2598 | 
             
              rb_define_const (mGPGME, "GPG_ERR_BAD_PASSPHRASE",
         | 
| 2596 | 
            -
             | 
| 2599 | 
            +
                               INT2FIX(GPG_ERR_BAD_PASSPHRASE));
         | 
| 2597 2600 | 
             
              rb_define_const (mGPGME, "GPG_ERR_KEY_EXPIRED",
         | 
| 2598 | 
            -
             | 
| 2601 | 
            +
                               INT2FIX(GPG_ERR_KEY_EXPIRED));
         | 
| 2599 2602 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SIG_EXPIRED",
         | 
| 2600 | 
            -
             | 
| 2603 | 
            +
                               INT2FIX(GPG_ERR_SIG_EXPIRED));
         | 
| 2601 2604 | 
             
              rb_define_const (mGPGME, "GPG_ERR_CANCELED",
         | 
| 2602 | 
            -
             | 
| 2605 | 
            +
                               INT2FIX(GPG_ERR_CANCELED));
         | 
| 2603 2606 | 
             
              rb_define_const (mGPGME, "GPG_ERR_INV_ENGINE",
         | 
| 2604 | 
            -
             | 
| 2607 | 
            +
                               INT2FIX(GPG_ERR_INV_ENGINE));
         | 
| 2605 2608 | 
             
              rb_define_const (mGPGME, "GPG_ERR_AMBIGUOUS_NAME",
         | 
| 2606 | 
            -
             | 
| 2609 | 
            +
                               INT2FIX(GPG_ERR_AMBIGUOUS_NAME));
         | 
| 2607 2610 | 
             
              rb_define_const (mGPGME, "GPG_ERR_WRONG_KEY_USAGE",
         | 
| 2608 | 
            -
             | 
| 2611 | 
            +
                               INT2FIX(GPG_ERR_WRONG_KEY_USAGE));
         | 
| 2609 2612 | 
             
              rb_define_const (mGPGME, "GPG_ERR_CERT_REVOKED",
         | 
| 2610 | 
            -
             | 
| 2613 | 
            +
                               INT2FIX(GPG_ERR_CERT_REVOKED));
         | 
| 2611 2614 | 
             
              rb_define_const (mGPGME, "GPG_ERR_CERT_EXPIRED",
         | 
| 2612 | 
            -
             | 
| 2615 | 
            +
                               INT2FIX(GPG_ERR_CERT_EXPIRED));
         | 
| 2613 2616 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NO_CRL_KNOWN",
         | 
| 2614 | 
            -
             | 
| 2617 | 
            +
                               INT2FIX(GPG_ERR_NO_CRL_KNOWN));
         | 
| 2615 2618 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NO_POLICY_MATCH",
         | 
| 2616 | 
            -
             | 
| 2619 | 
            +
                               INT2FIX(GPG_ERR_NO_POLICY_MATCH));
         | 
| 2617 2620 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NO_SECKEY",
         | 
| 2618 | 
            -
             | 
| 2621 | 
            +
                               INT2FIX(GPG_ERR_NO_SECKEY));
         | 
| 2619 2622 | 
             
              rb_define_const (mGPGME, "GPG_ERR_MISSING_CERT",
         | 
| 2620 | 
            -
             | 
| 2623 | 
            +
                               INT2FIX(GPG_ERR_MISSING_CERT));
         | 
| 2621 2624 | 
             
              rb_define_const (mGPGME, "GPG_ERR_BAD_CERT_CHAIN",
         | 
| 2622 | 
            -
             | 
| 2625 | 
            +
                               INT2FIX(GPG_ERR_BAD_CERT_CHAIN));
         | 
| 2623 2626 | 
             
              rb_define_const (mGPGME, "GPG_ERR_UNSUPPORTED_ALGORITHM",
         | 
| 2624 | 
            -
             | 
| 2627 | 
            +
                               INT2FIX(GPG_ERR_UNSUPPORTED_ALGORITHM));
         | 
| 2625 2628 | 
             
              rb_define_const (mGPGME, "GPG_ERR_BAD_SIGNATURE",
         | 
| 2626 | 
            -
             | 
| 2629 | 
            +
                               INT2FIX(GPG_ERR_BAD_SIGNATURE));
         | 
| 2627 2630 | 
             
              rb_define_const (mGPGME, "GPG_ERR_NO_PUBKEY",
         | 
| 2628 | 
            -
             | 
| 2631 | 
            +
                               INT2FIX(GPG_ERR_NO_PUBKEY));
         | 
| 2629 2632 |  | 
| 2630 2633 | 
             
              /* gpgme_err_source_t */
         | 
| 2631 2634 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_UNKNOWN",
         | 
| 2632 | 
            -
             | 
| 2635 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_UNKNOWN));
         | 
| 2633 2636 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_GPGME",
         | 
| 2634 | 
            -
             | 
| 2637 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_GPGME));
         | 
| 2635 2638 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_GPG",
         | 
| 2636 | 
            -
             | 
| 2639 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_GPG));
         | 
| 2637 2640 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_GPGSM",
         | 
| 2638 | 
            -
             | 
| 2641 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_GPGSM));
         | 
| 2639 2642 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_GCRYPT",
         | 
| 2640 | 
            -
             | 
| 2643 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_GCRYPT));
         | 
| 2641 2644 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_GPGAGENT",
         | 
| 2642 | 
            -
             | 
| 2645 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_GPGAGENT));
         | 
| 2643 2646 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_PINENTRY",
         | 
| 2644 | 
            -
             | 
| 2647 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_PINENTRY));
         | 
| 2645 2648 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_SCD",
         | 
| 2646 | 
            -
             | 
| 2649 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_SCD));
         | 
| 2647 2650 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_KEYBOX",
         | 
| 2648 | 
            -
             | 
| 2651 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_KEYBOX));
         | 
| 2649 2652 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_USER_1",
         | 
| 2650 | 
            -
             | 
| 2653 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_USER_1));
         | 
| 2651 2654 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_USER_2",
         | 
| 2652 | 
            -
             | 
| 2655 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_USER_2));
         | 
| 2653 2656 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_USER_3",
         | 
| 2654 | 
            -
             | 
| 2657 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_USER_3));
         | 
| 2655 2658 | 
             
              rb_define_const (mGPGME, "GPG_ERR_SOURCE_USER_4",
         | 
| 2656 | 
            -
             | 
| 2659 | 
            +
                               INT2FIX(GPG_ERR_SOURCE_USER_4));
         | 
| 2657 2660 |  | 
| 2658 2661 | 
             
              /* gpgme_data_encoding_t */
         | 
| 2659 2662 | 
             
              rb_define_const (mGPGME, "GPGME_DATA_ENCODING_NONE",
         | 
| 2660 | 
            -
             | 
| 2663 | 
            +
                               INT2FIX(GPGME_DATA_ENCODING_NONE));
         | 
| 2661 2664 | 
             
              rb_define_const (mGPGME, "GPGME_DATA_ENCODING_BINARY",
         | 
| 2662 | 
            -
             | 
| 2665 | 
            +
                               INT2FIX(GPGME_DATA_ENCODING_BINARY));
         | 
| 2663 2666 | 
             
              rb_define_const (mGPGME, "GPGME_DATA_ENCODING_BASE64",
         | 
| 2664 | 
            -
             | 
| 2667 | 
            +
                               INT2FIX(GPGME_DATA_ENCODING_BASE64));
         | 
| 2665 2668 | 
             
              rb_define_const (mGPGME, "GPGME_DATA_ENCODING_ARMOR",
         | 
| 2666 | 
            -
             | 
| 2669 | 
            +
                               INT2FIX(GPGME_DATA_ENCODING_ARMOR));
         | 
| 2667 2670 |  | 
| 2668 2671 | 
             
              /* gpgme_sig_stat_t */
         | 
| 2669 2672 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_NONE",
         | 
| 2670 | 
            -
             | 
| 2673 | 
            +
                               INT2FIX(GPGME_SIG_STAT_NONE));
         | 
| 2671 2674 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_GOOD",
         | 
| 2672 | 
            -
             | 
| 2675 | 
            +
                               INT2FIX(GPGME_SIG_STAT_GOOD));
         | 
| 2673 2676 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_BAD",
         | 
| 2674 | 
            -
             | 
| 2677 | 
            +
                               INT2FIX(GPGME_SIG_STAT_BAD));
         | 
| 2675 2678 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_NOKEY",
         | 
| 2676 | 
            -
             | 
| 2679 | 
            +
                               INT2FIX(GPGME_SIG_STAT_NOKEY));
         | 
| 2677 2680 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_NOSIG",
         | 
| 2678 | 
            -
             | 
| 2681 | 
            +
                               INT2FIX(GPGME_SIG_STAT_NOSIG));
         | 
| 2679 2682 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_ERROR",
         | 
| 2680 | 
            -
             | 
| 2683 | 
            +
                               INT2FIX(GPGME_SIG_STAT_ERROR));
         | 
| 2681 2684 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_DIFF",
         | 
| 2682 | 
            -
             | 
| 2685 | 
            +
                               INT2FIX(GPGME_SIG_STAT_DIFF));
         | 
| 2683 2686 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_GOOD_EXP",
         | 
| 2684 | 
            -
             | 
| 2687 | 
            +
                               INT2FIX(GPGME_SIG_STAT_GOOD_EXP));
         | 
| 2685 2688 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_STAT_GOOD_EXPKEY",
         | 
| 2686 | 
            -
             | 
| 2689 | 
            +
                               INT2FIX(GPGME_SIG_STAT_GOOD_EXPKEY));
         | 
| 2687 2690 |  | 
| 2688 2691 | 
             
              /* gpgme_sigsum_t */
         | 
| 2689 2692 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_VALID",
         | 
| 2690 | 
            -
             | 
| 2693 | 
            +
                               INT2FIX(GPGME_SIGSUM_VALID));
         | 
| 2691 2694 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_GREEN",
         | 
| 2692 | 
            -
             | 
| 2695 | 
            +
                               INT2FIX(GPGME_SIGSUM_GREEN));
         | 
| 2693 2696 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_RED",
         | 
| 2694 | 
            -
             | 
| 2697 | 
            +
                               INT2FIX(GPGME_SIGSUM_RED));
         | 
| 2695 2698 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_KEY_REVOKED",
         | 
| 2696 | 
            -
             | 
| 2699 | 
            +
                               INT2FIX(GPGME_SIGSUM_KEY_REVOKED));
         | 
| 2697 2700 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_KEY_EXPIRED",
         | 
| 2698 | 
            -
             | 
| 2701 | 
            +
                               INT2FIX(GPGME_SIGSUM_KEY_EXPIRED));
         | 
| 2699 2702 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_SIG_EXPIRED",
         | 
| 2700 | 
            -
             | 
| 2703 | 
            +
                               INT2FIX(GPGME_SIGSUM_SIG_EXPIRED));
         | 
| 2701 2704 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_KEY_MISSING",
         | 
| 2702 | 
            -
             | 
| 2705 | 
            +
                               INT2FIX(GPGME_SIGSUM_KEY_MISSING));
         | 
| 2703 2706 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_CRL_MISSING",
         | 
| 2704 | 
            -
             | 
| 2707 | 
            +
                               INT2FIX(GPGME_SIGSUM_CRL_MISSING));
         | 
| 2705 2708 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_CRL_TOO_OLD",
         | 
| 2706 | 
            -
             | 
| 2709 | 
            +
                               INT2FIX(GPGME_SIGSUM_CRL_TOO_OLD));
         | 
| 2707 2710 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_BAD_POLICY",
         | 
| 2708 | 
            -
             | 
| 2711 | 
            +
                               INT2FIX(GPGME_SIGSUM_BAD_POLICY));
         | 
| 2709 2712 | 
             
              rb_define_const (mGPGME, "GPGME_SIGSUM_SYS_ERROR",
         | 
| 2710 | 
            -
             | 
| 2713 | 
            +
                               INT2FIX(GPGME_SIGSUM_SYS_ERROR));
         | 
| 2711 2714 |  | 
| 2712 2715 | 
             
              /* gpgme_sig_mode_t */
         | 
| 2713 2716 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_MODE_NORMAL",
         | 
| 2714 | 
            -
             | 
| 2717 | 
            +
                               INT2FIX(GPGME_SIG_MODE_NORMAL));
         | 
| 2715 2718 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_MODE_DETACH",
         | 
| 2716 | 
            -
             | 
| 2719 | 
            +
                               INT2FIX(GPGME_SIG_MODE_DETACH));
         | 
| 2717 2720 | 
             
              rb_define_const (mGPGME, "GPGME_SIG_MODE_CLEAR",
         | 
| 2718 | 
            -
             | 
| 2721 | 
            +
                               INT2FIX(GPGME_SIG_MODE_CLEAR));
         | 
| 2719 2722 |  | 
| 2720 2723 | 
             
              /* gpgme_attr_t */
         | 
| 2721 2724 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_KEYID",
         | 
| 2722 | 
            -
             | 
| 2725 | 
            +
                               INT2FIX(GPGME_ATTR_KEYID));
         | 
| 2723 2726 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_FPR",
         | 
| 2724 | 
            -
             | 
| 2727 | 
            +
                               INT2FIX(GPGME_ATTR_FPR));
         | 
| 2725 2728 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_ALGO",
         | 
| 2726 | 
            -
             | 
| 2729 | 
            +
                               INT2FIX(GPGME_ATTR_ALGO));
         | 
| 2727 2730 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_LEN",
         | 
| 2728 | 
            -
             | 
| 2731 | 
            +
                               INT2FIX(GPGME_ATTR_LEN));
         | 
| 2729 2732 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_CREATED",
         | 
| 2730 | 
            -
             | 
| 2733 | 
            +
                               INT2FIX(GPGME_ATTR_CREATED));
         | 
| 2731 2734 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_EXPIRE",
         | 
| 2732 | 
            -
             | 
| 2735 | 
            +
                               INT2FIX(GPGME_ATTR_EXPIRE));
         | 
| 2733 2736 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_OTRUST",
         | 
| 2734 | 
            -
             | 
| 2737 | 
            +
                               INT2FIX(GPGME_ATTR_OTRUST));
         | 
| 2735 2738 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_USERID",
         | 
| 2736 | 
            -
             | 
| 2739 | 
            +
                               INT2FIX(GPGME_ATTR_USERID));
         | 
| 2737 2740 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_NAME",
         | 
| 2738 | 
            -
             | 
| 2741 | 
            +
                               INT2FIX(GPGME_ATTR_NAME));
         | 
| 2739 2742 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_EMAIL",
         | 
| 2740 | 
            -
             | 
| 2743 | 
            +
                               INT2FIX(GPGME_ATTR_EMAIL));
         | 
| 2741 2744 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_COMMENT",
         | 
| 2742 | 
            -
             | 
| 2745 | 
            +
                               INT2FIX(GPGME_ATTR_COMMENT));
         | 
| 2743 2746 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_VALIDITY",
         | 
| 2744 | 
            -
             | 
| 2747 | 
            +
                               INT2FIX(GPGME_ATTR_VALIDITY));
         | 
| 2745 2748 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_LEVEL",
         | 
| 2746 | 
            -
             | 
| 2749 | 
            +
                               INT2FIX(GPGME_ATTR_LEVEL));
         | 
| 2747 2750 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_TYPE",
         | 
| 2748 | 
            -
             | 
| 2751 | 
            +
                               INT2FIX(GPGME_ATTR_TYPE));
         | 
| 2749 2752 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_IS_SECRET",
         | 
| 2750 | 
            -
             | 
| 2753 | 
            +
                               INT2FIX(GPGME_ATTR_IS_SECRET));
         | 
| 2751 2754 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_KEY_REVOKED",
         | 
| 2752 | 
            -
             | 
| 2755 | 
            +
                               INT2FIX(GPGME_ATTR_KEY_REVOKED));
         | 
| 2753 2756 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_KEY_INVALID",
         | 
| 2754 | 
            -
             | 
| 2757 | 
            +
                               INT2FIX(GPGME_ATTR_KEY_INVALID));
         | 
| 2755 2758 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_UID_REVOKED",
         | 
| 2756 | 
            -
             | 
| 2759 | 
            +
                               INT2FIX(GPGME_ATTR_UID_REVOKED));
         | 
| 2757 2760 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_UID_INVALID",
         | 
| 2758 | 
            -
             | 
| 2761 | 
            +
                               INT2FIX(GPGME_ATTR_UID_INVALID));
         | 
| 2759 2762 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_KEY_CAPS",
         | 
| 2760 | 
            -
             | 
| 2763 | 
            +
                               INT2FIX(GPGME_ATTR_KEY_CAPS));
         | 
| 2761 2764 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_CAN_ENCRYPT",
         | 
| 2762 | 
            -
             | 
| 2765 | 
            +
                               INT2FIX(GPGME_ATTR_CAN_ENCRYPT));
         | 
| 2763 2766 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_CAN_SIGN",
         | 
| 2764 | 
            -
             | 
| 2767 | 
            +
                               INT2FIX(GPGME_ATTR_CAN_SIGN));
         | 
| 2765 2768 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_CAN_CERTIFY",
         | 
| 2766 | 
            -
             | 
| 2769 | 
            +
                               INT2FIX(GPGME_ATTR_CAN_CERTIFY));
         | 
| 2767 2770 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_KEY_EXPIRED",
         | 
| 2768 | 
            -
             | 
| 2771 | 
            +
                               INT2FIX(GPGME_ATTR_KEY_EXPIRED));
         | 
| 2769 2772 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_KEY_DISABLED",
         | 
| 2770 | 
            -
             | 
| 2773 | 
            +
                               INT2FIX(GPGME_ATTR_KEY_DISABLED));
         | 
| 2771 2774 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_SERIAL",
         | 
| 2772 | 
            -
             | 
| 2775 | 
            +
                               INT2FIX(GPGME_ATTR_SERIAL));
         | 
| 2773 2776 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_ISSUER",
         | 
| 2774 | 
            -
             | 
| 2777 | 
            +
                               INT2FIX(GPGME_ATTR_ISSUER));
         | 
| 2775 2778 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_CHAINID",
         | 
| 2776 | 
            -
             | 
| 2779 | 
            +
                               INT2FIX(GPGME_ATTR_CHAINID));
         | 
| 2777 2780 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_SIG_STATUS",
         | 
| 2778 | 
            -
             | 
| 2781 | 
            +
                               INT2FIX(GPGME_ATTR_SIG_STATUS));
         | 
| 2779 2782 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_ERRTOK",
         | 
| 2780 | 
            -
             | 
| 2783 | 
            +
                               INT2FIX(GPGME_ATTR_ERRTOK));
         | 
| 2781 2784 | 
             
              rb_define_const (mGPGME, "GPGME_ATTR_SIG_SUMMARY",
         | 
| 2782 | 
            -
             | 
| 2785 | 
            +
                               INT2FIX(GPGME_ATTR_SIG_SUMMARY));
         | 
| 2783 2786 |  | 
| 2784 2787 | 
             
              /* gpgme_validity_t */
         | 
| 2785 2788 | 
             
              rb_define_const (mGPGME, "GPGME_VALIDITY_UNKNOWN",
         | 
| 2786 | 
            -
             | 
| 2789 | 
            +
                               INT2FIX(GPGME_VALIDITY_UNKNOWN));
         | 
| 2787 2790 | 
             
              rb_define_const (mGPGME, "GPGME_VALIDITY_UNDEFINED",
         | 
| 2788 | 
            -
             | 
| 2791 | 
            +
                               INT2FIX(GPGME_VALIDITY_UNDEFINED));
         | 
| 2789 2792 | 
             
              rb_define_const (mGPGME, "GPGME_VALIDITY_NEVER",
         | 
| 2790 | 
            -
             | 
| 2793 | 
            +
                               INT2FIX(GPGME_VALIDITY_NEVER));
         | 
| 2791 2794 | 
             
              rb_define_const (mGPGME, "GPGME_VALIDITY_MARGINAL",
         | 
| 2792 | 
            -
             | 
| 2795 | 
            +
                               INT2FIX(GPGME_VALIDITY_MARGINAL));
         | 
| 2793 2796 | 
             
              rb_define_const (mGPGME, "GPGME_VALIDITY_FULL",
         | 
| 2794 | 
            -
             | 
| 2797 | 
            +
                               INT2FIX(GPGME_VALIDITY_FULL));
         | 
| 2795 2798 | 
             
              rb_define_const (mGPGME, "GPGME_VALIDITY_ULTIMATE",
         | 
| 2796 | 
            -
             | 
| 2799 | 
            +
                               INT2FIX(GPGME_VALIDITY_ULTIMATE));
         | 
| 2797 2800 |  | 
| 2798 2801 | 
             
              /* gpgme_protocol_t */
         | 
| 2799 2802 | 
             
              rb_define_const (mGPGME, "GPGME_PROTOCOL_OpenPGP",
         | 
| 2800 | 
            -
             | 
| 2803 | 
            +
                               INT2FIX(GPGME_PROTOCOL_OpenPGP));
         | 
| 2801 2804 | 
             
              rb_define_const (mGPGME, "GPGME_PROTOCOL_CMS",
         | 
| 2802 | 
            -
             | 
| 2805 | 
            +
                               INT2FIX(GPGME_PROTOCOL_CMS));
         | 
| 2803 2806 | 
             
              /* This protocol was added in 1.2.0. */
         | 
| 2804 2807 | 
             
            #ifdef GPGME_PROTOCOL_ASSUAN
         | 
| 2805 2808 | 
             
              rb_define_const (mGPGME, "GPGME_PROTOCOL_ASSUAN",
         | 
| 2806 | 
            -
             | 
| 2809 | 
            +
                               INT2FIX(GPGME_PROTOCOL_ASSUAN))
         | 
| 2807 2810 | 
             
            #endif
         | 
| 2808 2811 | 
             
              /* This protocol was added in 1.5.0. */
         | 
| 2809 2812 | 
             
            #ifdef GPGME_PROTOCOL_SPAWN
         | 
| @@ -2813,158 +2816,158 @@ Init_gpgme_n (void) | |
| 2813 2816 |  | 
| 2814 2817 | 
             
              /* gpgme_status_code_t */
         | 
| 2815 2818 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_EOF",
         | 
| 2816 | 
            -
             | 
| 2819 | 
            +
                               INT2FIX(GPGME_STATUS_EOF));
         | 
| 2817 2820 | 
             
              /* mkstatus starts here */
         | 
| 2818 2821 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ENTER",
         | 
| 2819 | 
            -
             | 
| 2822 | 
            +
                               INT2FIX(GPGME_STATUS_ENTER));
         | 
| 2820 2823 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_LEAVE",
         | 
| 2821 | 
            -
             | 
| 2824 | 
            +
                               INT2FIX(GPGME_STATUS_LEAVE));
         | 
| 2822 2825 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ABORT",
         | 
| 2823 | 
            -
             | 
| 2826 | 
            +
                               INT2FIX(GPGME_STATUS_ABORT));
         | 
| 2824 2827 |  | 
| 2825 2828 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GOODSIG",
         | 
| 2826 | 
            -
             | 
| 2829 | 
            +
                               INT2FIX(GPGME_STATUS_GOODSIG));
         | 
| 2827 2830 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BADSIG",
         | 
| 2828 | 
            -
             | 
| 2831 | 
            +
                               INT2FIX(GPGME_STATUS_BADSIG));
         | 
| 2829 2832 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ERRSIG",
         | 
| 2830 | 
            -
             | 
| 2833 | 
            +
                               INT2FIX(GPGME_STATUS_ERRSIG));
         | 
| 2831 2834 |  | 
| 2832 2835 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BADARMOR",
         | 
| 2833 | 
            -
             | 
| 2836 | 
            +
                               INT2FIX(GPGME_STATUS_BADARMOR));
         | 
| 2834 2837 |  | 
| 2835 2838 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_RSA_OR_IDEA",
         | 
| 2836 | 
            -
             | 
| 2839 | 
            +
                               INT2FIX(GPGME_STATUS_RSA_OR_IDEA));
         | 
| 2837 2840 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_KEYEXPIRED",
         | 
| 2838 | 
            -
             | 
| 2841 | 
            +
                               INT2FIX(GPGME_STATUS_KEYEXPIRED));
         | 
| 2839 2842 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_KEYREVOKED",
         | 
| 2840 | 
            -
             | 
| 2843 | 
            +
                               INT2FIX(GPGME_STATUS_KEYREVOKED));
         | 
| 2841 2844 |  | 
| 2842 2845 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_TRUST_UNDEFINED",
         | 
| 2843 | 
            -
             | 
| 2846 | 
            +
                               INT2FIX(GPGME_STATUS_TRUST_UNDEFINED));
         | 
| 2844 2847 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_TRUST_NEVER",
         | 
| 2845 | 
            -
             | 
| 2848 | 
            +
                               INT2FIX(GPGME_STATUS_TRUST_NEVER));
         | 
| 2846 2849 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_TRUST_MARGINAL",
         | 
| 2847 | 
            -
             | 
| 2850 | 
            +
                               INT2FIX(GPGME_STATUS_TRUST_MARGINAL));
         | 
| 2848 2851 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_TRUST_FULLY",
         | 
| 2849 | 
            -
             | 
| 2852 | 
            +
                               INT2FIX(GPGME_STATUS_TRUST_FULLY));
         | 
| 2850 2853 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_TRUST_ULTIMATE",
         | 
| 2851 | 
            -
             | 
| 2854 | 
            +
                               INT2FIX(GPGME_STATUS_TRUST_ULTIMATE));
         | 
| 2852 2855 |  | 
| 2853 2856 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SHM_INFO",
         | 
| 2854 | 
            -
             | 
| 2857 | 
            +
                               INT2FIX(GPGME_STATUS_SHM_INFO));
         | 
| 2855 2858 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SHM_GET",
         | 
| 2856 | 
            -
             | 
| 2859 | 
            +
                               INT2FIX(GPGME_STATUS_SHM_GET));
         | 
| 2857 2860 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SHM_GET_BOOL",
         | 
| 2858 | 
            -
             | 
| 2861 | 
            +
                               INT2FIX(GPGME_STATUS_SHM_GET_BOOL));
         | 
| 2859 2862 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SHM_GET_HIDDEN",
         | 
| 2860 | 
            -
             | 
| 2863 | 
            +
                               INT2FIX(GPGME_STATUS_SHM_GET_HIDDEN));
         | 
| 2861 2864 |  | 
| 2862 2865 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NEED_PASSPHRASE",
         | 
| 2863 | 
            -
             | 
| 2866 | 
            +
                               INT2FIX(GPGME_STATUS_NEED_PASSPHRASE));
         | 
| 2864 2867 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_VALIDSIG",
         | 
| 2865 | 
            -
             | 
| 2868 | 
            +
                               INT2FIX(GPGME_STATUS_VALIDSIG));
         | 
| 2866 2869 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SIG_ID",
         | 
| 2867 | 
            -
             | 
| 2870 | 
            +
                               INT2FIX(GPGME_STATUS_SIG_ID));
         | 
| 2868 2871 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ENC_TO",
         | 
| 2869 | 
            -
             | 
| 2872 | 
            +
                               INT2FIX(GPGME_STATUS_ENC_TO));
         | 
| 2870 2873 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NODATA",
         | 
| 2871 | 
            -
             | 
| 2874 | 
            +
                               INT2FIX(GPGME_STATUS_NODATA));
         | 
| 2872 2875 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BAD_PASSPHRASE",
         | 
| 2873 | 
            -
             | 
| 2876 | 
            +
                               INT2FIX(GPGME_STATUS_BAD_PASSPHRASE));
         | 
| 2874 2877 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NO_PUBKEY",
         | 
| 2875 | 
            -
             | 
| 2878 | 
            +
                               INT2FIX(GPGME_STATUS_NO_PUBKEY));
         | 
| 2876 2879 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NO_SECKEY",
         | 
| 2877 | 
            -
             | 
| 2880 | 
            +
                               INT2FIX(GPGME_STATUS_NO_SECKEY));
         | 
| 2878 2881 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NEED_PASSPHRASE_SYM",
         | 
| 2879 | 
            -
             | 
| 2882 | 
            +
                               INT2FIX(GPGME_STATUS_NEED_PASSPHRASE_SYM));
         | 
| 2880 2883 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_DECRYPTION_FAILED",
         | 
| 2881 | 
            -
             | 
| 2884 | 
            +
                               INT2FIX(GPGME_STATUS_DECRYPTION_FAILED));
         | 
| 2882 2885 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_DECRYPTION_OKAY",
         | 
| 2883 | 
            -
             | 
| 2886 | 
            +
                               INT2FIX(GPGME_STATUS_DECRYPTION_OKAY));
         | 
| 2884 2887 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_MISSING_PASSPHRASE",
         | 
| 2885 | 
            -
             | 
| 2888 | 
            +
                               INT2FIX(GPGME_STATUS_MISSING_PASSPHRASE));
         | 
| 2886 2889 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GOOD_PASSPHRASE",
         | 
| 2887 | 
            -
             | 
| 2890 | 
            +
                               INT2FIX(GPGME_STATUS_GOOD_PASSPHRASE));
         | 
| 2888 2891 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GOODMDC",
         | 
| 2889 | 
            -
             | 
| 2892 | 
            +
                               INT2FIX(GPGME_STATUS_GOODMDC));
         | 
| 2890 2893 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BADMDC",
         | 
| 2891 | 
            -
             | 
| 2894 | 
            +
                               INT2FIX(GPGME_STATUS_BADMDC));
         | 
| 2892 2895 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ERRMDC",
         | 
| 2893 | 
            -
             | 
| 2896 | 
            +
                               INT2FIX(GPGME_STATUS_ERRMDC));
         | 
| 2894 2897 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_IMPORTED",
         | 
| 2895 | 
            -
             | 
| 2898 | 
            +
                               INT2FIX(GPGME_STATUS_IMPORTED));
         | 
| 2896 2899 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_IMPORT_RES",
         | 
| 2897 | 
            -
             | 
| 2900 | 
            +
                               INT2FIX(GPGME_STATUS_IMPORT_RES));
         | 
| 2898 2901 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_FILE_START",
         | 
| 2899 | 
            -
             | 
| 2902 | 
            +
                               INT2FIX(GPGME_STATUS_FILE_START));
         | 
| 2900 2903 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_FILE_DONE",
         | 
| 2901 | 
            -
             | 
| 2904 | 
            +
                               INT2FIX(GPGME_STATUS_FILE_DONE));
         | 
| 2902 2905 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_FILE_ERROR",
         | 
| 2903 | 
            -
             | 
| 2906 | 
            +
                               INT2FIX(GPGME_STATUS_FILE_ERROR));
         | 
| 2904 2907 |  | 
| 2905 2908 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BEGIN_DECRYPTION",
         | 
| 2906 | 
            -
             | 
| 2909 | 
            +
                               INT2FIX(GPGME_STATUS_BEGIN_DECRYPTION));
         | 
| 2907 2910 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_END_DECRYPTION",
         | 
| 2908 | 
            -
             | 
| 2911 | 
            +
                               INT2FIX(GPGME_STATUS_END_DECRYPTION));
         | 
| 2909 2912 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BEGIN_ENCRYPTION",
         | 
| 2910 | 
            -
             | 
| 2913 | 
            +
                               INT2FIX(GPGME_STATUS_BEGIN_ENCRYPTION));
         | 
| 2911 2914 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_END_ENCRYPTION",
         | 
| 2912 | 
            -
             | 
| 2915 | 
            +
                               INT2FIX(GPGME_STATUS_END_ENCRYPTION));
         | 
| 2913 2916 |  | 
| 2914 2917 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_DELETE_PROBLEM",
         | 
| 2915 | 
            -
             | 
| 2918 | 
            +
                               INT2FIX(GPGME_STATUS_DELETE_PROBLEM));
         | 
| 2916 2919 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GET_BOOL",
         | 
| 2917 | 
            -
             | 
| 2920 | 
            +
                               INT2FIX(GPGME_STATUS_GET_BOOL));
         | 
| 2918 2921 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GET_LINE",
         | 
| 2919 | 
            -
             | 
| 2922 | 
            +
                               INT2FIX(GPGME_STATUS_GET_LINE));
         | 
| 2920 2923 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GET_HIDDEN",
         | 
| 2921 | 
            -
             | 
| 2924 | 
            +
                               INT2FIX(GPGME_STATUS_GET_HIDDEN));
         | 
| 2922 2925 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_GOT_IT",
         | 
| 2923 | 
            -
             | 
| 2926 | 
            +
                               INT2FIX(GPGME_STATUS_GOT_IT));
         | 
| 2924 2927 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_PROGRESS",
         | 
| 2925 | 
            -
             | 
| 2928 | 
            +
                               INT2FIX(GPGME_STATUS_PROGRESS));
         | 
| 2926 2929 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SIG_CREATED",
         | 
| 2927 | 
            -
             | 
| 2930 | 
            +
                               INT2FIX(GPGME_STATUS_SIG_CREATED));
         | 
| 2928 2931 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SESSION_KEY",
         | 
| 2929 | 
            -
             | 
| 2932 | 
            +
                               INT2FIX(GPGME_STATUS_SESSION_KEY));
         | 
| 2930 2933 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NOTATION_NAME",
         | 
| 2931 | 
            -
             | 
| 2934 | 
            +
                               INT2FIX(GPGME_STATUS_NOTATION_NAME));
         | 
| 2932 2935 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NOTATION_DATA",
         | 
| 2933 | 
            -
             | 
| 2936 | 
            +
                               INT2FIX(GPGME_STATUS_NOTATION_DATA));
         | 
| 2934 2937 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_POLICY_URL",
         | 
| 2935 | 
            -
             | 
| 2938 | 
            +
                               INT2FIX(GPGME_STATUS_POLICY_URL));
         | 
| 2936 2939 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BEGIN_STREAM",
         | 
| 2937 | 
            -
             | 
| 2940 | 
            +
                               INT2FIX(GPGME_STATUS_BEGIN_STREAM));
         | 
| 2938 2941 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_END_STREAM",
         | 
| 2939 | 
            -
             | 
| 2942 | 
            +
                               INT2FIX(GPGME_STATUS_END_STREAM));
         | 
| 2940 2943 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_KEY_CREATED",
         | 
| 2941 | 
            -
             | 
| 2944 | 
            +
                               INT2FIX(GPGME_STATUS_KEY_CREATED));
         | 
| 2942 2945 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_USERID_HINT",
         | 
| 2943 | 
            -
             | 
| 2946 | 
            +
                               INT2FIX(GPGME_STATUS_USERID_HINT));
         | 
| 2944 2947 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_UNEXPECTED",
         | 
| 2945 | 
            -
             | 
| 2948 | 
            +
                               INT2FIX(GPGME_STATUS_UNEXPECTED));
         | 
| 2946 2949 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_INV_RECP",
         | 
| 2947 | 
            -
             | 
| 2950 | 
            +
                               INT2FIX(GPGME_STATUS_INV_RECP));
         | 
| 2948 2951 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_NO_RECP",
         | 
| 2949 | 
            -
             | 
| 2952 | 
            +
                               INT2FIX(GPGME_STATUS_NO_RECP));
         | 
| 2950 2953 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ALREADY_SIGNED",
         | 
| 2951 | 
            -
             | 
| 2954 | 
            +
                               INT2FIX(GPGME_STATUS_ALREADY_SIGNED));
         | 
| 2952 2955 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_SIGEXPIRED",
         | 
| 2953 | 
            -
             | 
| 2956 | 
            +
                               INT2FIX(GPGME_STATUS_SIGEXPIRED));
         | 
| 2954 2957 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_EXPSIG",
         | 
| 2955 | 
            -
             | 
| 2958 | 
            +
                               INT2FIX(GPGME_STATUS_EXPSIG));
         | 
| 2956 2959 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_EXPKEYSIG",
         | 
| 2957 | 
            -
             | 
| 2960 | 
            +
                               INT2FIX(GPGME_STATUS_EXPKEYSIG));
         | 
| 2958 2961 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_TRUNCATED",
         | 
| 2959 | 
            -
             | 
| 2962 | 
            +
                               INT2FIX(GPGME_STATUS_TRUNCATED));
         | 
| 2960 2963 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_ERROR",
         | 
| 2961 | 
            -
             | 
| 2964 | 
            +
                               INT2FIX(GPGME_STATUS_ERROR));
         | 
| 2962 2965 | 
             
              /* These status codes have been available since 1.1.1. */
         | 
| 2963 2966 | 
             
            #ifdef GPGME_STATUS_PKA_TRUST_BAD
         | 
| 2964 2967 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_PKA_TRUST_BAD",
         | 
| 2965 | 
            -
             | 
| 2968 | 
            +
                               INT2FIX(GPGME_STATUS_PKA_TRUST_BAD));
         | 
| 2966 2969 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_PKA_TRUST_GOOD",
         | 
| 2967 | 
            -
             | 
| 2970 | 
            +
                               INT2FIX(GPGME_STATUS_PKA_TRUST_GOOD));
         | 
| 2968 2971 | 
             
            #endif
         | 
| 2969 2972 | 
             
              /* These status codes were added in 1.5.0. */
         | 
| 2970 2973 | 
             
            #if defined(GPGME_VERSION_NUMBER) && GPGME_VERSION_NUMBER >= 0x010500
         | 
| @@ -2979,32 +2982,32 @@ Init_gpgme_n (void) | |
| 2979 2982 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_BEGIN_SIGNING",
         | 
| 2980 2983 | 
             
                               INT2FIX(GPGME_STATUS_BEGIN_SIGNING));
         | 
| 2981 2984 | 
             
              rb_define_const (mGPGME, "GPGME_STATUS_KEY_NOT_CREATED",
         | 
| 2982 | 
            -
             | 
| 2985 | 
            +
                               INT2FIX(GPGME_STATUS_KEY_NOT_CREATED));
         | 
| 2983 2986 | 
             
            #endif
         | 
| 2984 2987 |  | 
| 2985 2988 | 
             
              /* The available keylist mode flags.  */
         | 
| 2986 2989 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_LOCAL",
         | 
| 2987 | 
            -
             | 
| 2990 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_LOCAL));
         | 
| 2988 2991 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_EXTERN",
         | 
| 2989 | 
            -
             | 
| 2992 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_EXTERN));
         | 
| 2990 2993 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_SIGS",
         | 
| 2991 | 
            -
             | 
| 2994 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_SIGS));
         | 
| 2992 2995 | 
             
              /* This flag was added in 1.1.1. */
         | 
| 2993 2996 | 
             
            #ifdef GPGME_KEYLIST_MODE_SIG_NOTATIONS
         | 
| 2994 2997 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_SIG_NOTATIONS",
         | 
| 2995 | 
            -
             | 
| 2998 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_SIG_NOTATIONS));
         | 
| 2996 2999 | 
             
            #endif
         | 
| 2997 3000 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_VALIDATE",
         | 
| 2998 | 
            -
             | 
| 3001 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_VALIDATE));
         | 
| 2999 3002 | 
             
              /* This flag was added in 1.2.0. */
         | 
| 3000 3003 | 
             
            #ifdef GPGME_KEYLIST_MODE_EPHEMERAL
         | 
| 3001 3004 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_EPHEMERAL",
         | 
| 3002 | 
            -
             | 
| 3005 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_EPHEMERAL));
         | 
| 3003 3006 | 
             
            #endif
         | 
| 3004 3007 | 
             
              /* This flag was added in 1.5.1. */
         | 
| 3005 3008 | 
             
            #ifdef GPGME_KEYLIST_MODE_WITH_SECRET
         | 
| 3006 3009 | 
             
              rb_define_const (mGPGME, "GPGME_KEYLIST_MODE_WITH_SECRET",
         | 
| 3007 | 
            -
             | 
| 3010 | 
            +
                               INT2FIX(GPGME_KEYLIST_MODE_WITH_SECRET));
         | 
| 3008 3011 | 
             
            #endif
         | 
| 3009 3012 |  | 
| 3010 3013 | 
             
              /* The available flags for status field of gpgme_import_status_t.  */
         | 
| @@ -3012,17 +3015,17 @@ Init_gpgme_n (void) | |
| 3012 3015 | 
             
              rb_define_const (mGPGME, "GPGME_IMPORT_UID", INT2FIX(GPGME_IMPORT_UID));
         | 
| 3013 3016 | 
             
              rb_define_const (mGPGME, "GPGME_IMPORT_SIG", INT2FIX(GPGME_IMPORT_SIG));
         | 
| 3014 3017 | 
             
              rb_define_const (mGPGME, "GPGME_IMPORT_SUBKEY",
         | 
| 3015 | 
            -
             | 
| 3018 | 
            +
                               INT2FIX(GPGME_IMPORT_SUBKEY));
         | 
| 3016 3019 | 
             
              rb_define_const (mGPGME, "GPGME_IMPORT_SECRET",
         | 
| 3017 | 
            -
             | 
| 3020 | 
            +
                               INT2FIX(GPGME_IMPORT_SECRET));
         | 
| 3018 3021 |  | 
| 3019 3022 | 
             
              /* The available flags for gpgme_op_encrypt.  */
         | 
| 3020 3023 | 
             
              rb_define_const (mGPGME, "GPGME_ENCRYPT_ALWAYS_TRUST",
         | 
| 3021 | 
            -
             | 
| 3024 | 
            +
                               INT2FIX(GPGME_ENCRYPT_ALWAYS_TRUST));
         | 
| 3022 3025 | 
             
              /* This flag was added in 1.2.0. */
         | 
| 3023 3026 | 
             
            #ifdef GPGME_ENCRYPT_NO_ENCRYPT_TO
         | 
| 3024 3027 | 
             
              rb_define_const (mGPGME, "GPGME_ENCRYPT_NO_ENCRYPT_TO",
         | 
| 3025 | 
            -
             | 
| 3028 | 
            +
                               INT2FIX(GPGME_ENCRYPT_NO_ENCRYPT_TO));
         | 
| 3026 3029 | 
             
            #endif
         | 
| 3027 3030 |  | 
| 3028 3031 | 
             
              /* These flags were added in 1.4.0. */
         |