COM-31: Rename opt_field to StringPair keysync
authorMarkus Schaber <markus@pep-security.net>
Mon, 03 Oct 2016 19:15:35 +0200
branchkeysync
changeset 17144bfd5428aa9
parent 170 fcee0c1b316e
child 172 112b0fac353d
COM-31: Rename opt_field to StringPair
pEpCOMServerAdapter.idl
pEp_utility.cpp
     1.1 --- a/pEpCOMServerAdapter.idl	Mon Oct 03 18:53:52 2016 +0200
     1.2 +++ b/pEpCOMServerAdapter.idl	Mon Oct 03 19:15:35 2016 +0200
     1.3 @@ -206,7 +206,7 @@
     1.4      HRESULT blacklist_retrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
     1.5  
     1.6  	// PGP compatibility functions
     1.7 -	HRESULT OpenPGP_list_keyinfo([in] BSTR search_pattern, [out, retval] SAFEARRAY(struct opt_field)* keyinfo_list);
     1.8 +	HRESULT OpenPGP_list_keyinfo([in] BSTR search_pattern, [out, retval] SAFEARRAY(struct StringPair)* keyinfo_list);
     1.9  
    1.10      // Message API
    1.11  
    1.12 @@ -257,7 +257,7 @@
    1.13          pEp_enc_pEp                             // pEp encryption format
    1.14      } pEp_enc_format;
    1.15  
    1.16 -    [uuid(3A8A4F13-3402-4C4C-94AB-598D87869380)] struct opt_field {
    1.17 +    [uuid(3A8A4F13-3402-4C4C-94AB-598D87869380)] struct StringPair {
    1.18          BSTR name;
    1.19          BSTR value;
    1.20      };
    1.21 @@ -286,10 +286,10 @@
    1.22          SAFEARRAY(BSTR) references;
    1.23          SAFEARRAY(BSTR) keywords;
    1.24          BSTR comments;
    1.25 -        SAFEARRAY(struct opt_field) opt_fields;
    1.26 +        SAFEARRAY(struct StringPair) opt_fields;
    1.27      };
    1.28  
    1.29 -    HRESULT encrypt_message([in] struct text_message *src, [out] struct text_message * dst, [in] SAFEARRAY(BSTR) extra, [in, optional, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
    1.30 +    HRESULT encrypt_message([in] struct text_message *src, [out] struct text_message * dst, [in] SAFEARRAY(BSTR) extra, [in, defaultvalue(pEpEncryptFlagsNone)] pEpEncryptFlags flags);
    1.31      HRESULT decrypt_message([in] struct text_message *src, [out] struct text_message * dst, [out] SAFEARRAY(BSTR) *keylist, [out] pEpDecryptFlags* flags, [out, retval] pEp_rating *rating);
    1.32      HRESULT outgoing_message_rating([in] struct text_message *msg, [out, retval] pEp_rating * pVal);
    1.33      HRESULT identity_rating([in] struct pEp_identity_s * ident, [out, retval] pEp_rating * pVal);
     2.1 --- a/pEp_utility.cpp	Mon Oct 03 18:53:52 2016 +0200
     2.2 +++ b/pEp_utility.cpp	Mon Oct 03 19:15:35 2016 +0200
     2.3 @@ -240,9 +240,9 @@
     2.4              return ident;
     2.5          }
     2.6  
     2.7 -        template<> opt_field *from_C< opt_field *, stringpair_list_t >(stringpair_list_t * sp)
     2.8 +        template<> StringPair *from_C< StringPair *, stringpair_list_t >(stringpair_list_t * sp)
     2.9          {
    2.10 -            opt_field *fld = new opt_field();
    2.11 +            StringPair *fld = new StringPair();
    2.12              if (sp) {
    2.13                  fld->name = bstr(sp->value->key);
    2.14                  fld->value = bstr(sp->value->value);
    2.15 @@ -312,7 +312,7 @@
    2.16              msg2->references = string_array(msg->references);
    2.17              msg2->keywords = string_array(msg->keywords);
    2.18              msg2->comments = bstr(msg->comments);
    2.19 -            msg2->opt_fields = array_from_C<opt_field, stringpair_list_t>(msg->opt_fields);
    2.20 +            msg2->opt_fields = array_from_C<StringPair, stringpair_list_t>(msg->opt_fields);
    2.21          }
    2.22  
    2.23          char * str(BSTR s)
    2.24 @@ -435,7 +435,7 @@
    2.25              return il;
    2.26          }
    2.27  
    2.28 -        stringpair_t *new_stringpair(opt_field *fld)
    2.29 +        stringpair_t *new_stringpair(StringPair *fld)
    2.30          {
    2.31              stringpair_t *pair = ::new_stringpair(str(fld->name), str(fld->value));
    2.32              if (pair == NULL)
    2.33 @@ -444,11 +444,11 @@
    2.34              return pair;
    2.35          }
    2.36  
    2.37 -        void clear_opt_field(opt_field& f)
    2.38 +        void clear_opt_field(StringPair& f)
    2.39          {
    2.40              SysFreeString(f.name);
    2.41              SysFreeString(f.value);
    2.42 -            memset(&f, 0, sizeof(opt_field));
    2.43 +            memset(&f, 0, sizeof(StringPair));
    2.44          }
    2.45  
    2.46          stringpair_list_t *stringpair_list(SAFEARRAY * sa)
    2.47 @@ -468,8 +468,8 @@
    2.48  
    2.49              stringpair_list_t *_il = il;
    2.50              for (LONG i = lbound; i <= ubound; i++) {
    2.51 -                opt_field s;
    2.52 -                memset(&s, 0, sizeof(opt_field));
    2.53 +                StringPair s;
    2.54 +                memset(&s, 0, sizeof(StringPair));
    2.55                  SafeArrayGetElement(sa, &i, &s);
    2.56  
    2.57                  stringpair_t *pair;
    2.58 @@ -528,7 +528,7 @@
    2.59  			if (!spair_list)
    2.60  				return;
    2.61  
    2.62 -			*pair_list_out = array_from_C<opt_field, stringpair_list_t>(spair_list);
    2.63 +			*pair_list_out = array_from_C<StringPair, stringpair_list_t>(spair_list);
    2.64  		}
    2.65  		void clear_opt_field_array(LPSAFEARRAY* opt_field_array) {
    2.66  			SafeArrayDestroy(*opt_field_array);