Rename SBinary to Binary_r
authorJulien Kerihuel <j.kerihuel@openchange.org>
Sun, 7 Sep 2008 21:01:36 +0000 (21:01 +0000)
committerJulien Kerihuel <j.kerihuel@openchange.org>
Sun, 7 Sep 2008 21:01:36 +0000 (21:01 +0000)
13 files changed:
exchange.idl
libmapi++/attachment.h
libmapi/emsmdb.c
libmapi/property.c
libmapi/utils.c
libocpf/ocpf_api.c
libocpf/ocpf_public.c
libocpf/ocpf_write.c
providers/emsabp.c
utils/exchange2ical/exchange2ical.c
utils/exchange2ical/exchange2ical.h
utils/openchangeclient.c
utils/openchangeclient.h

index 51312dc4c6293a03a3cf393a16ca1ee59f016f13..03cc149f09bf9533be0ce75f42d4d32664ff4a38 100644 (file)
@@ -275,9 +275,9 @@ System Attendant Private Interface
        } SPropTagArray;
 
        typedef struct {
-               uint32                          cb;
-               [size_is(cb)][unique] uint8     *lpb;
-       } SBinary;
+               [range(0,2097152)] uint32       cb;
+               [size_is(cb)] uint8             *lpb;
+       } Binary_r;
 
        typedef [public] struct {
                uint32 dwLowDateTime;
@@ -308,7 +308,7 @@ System Attendant Private Interface
 
        typedef struct {
                [range(0,100000)] uint32        cValues;
-               [size_is(cValues)] SBinary      *lpbin;
+               [size_is(cValues)] Binary_r     *lpbin;
        } BinaryArray_r;
 
        typedef [flag(NDR_NOALIGN)] struct {
@@ -328,7 +328,7 @@ System Attendant Private Interface
                [case(PT_BOOLEAN)]              uint8                   b;
                [case(PT_I8)]                   dlong                   d;
                [case(PT_STRING8)][unique][string,charset(DOS)] uint8   *lpszA;
-               [case(PT_BINARY)]               SBinary                 bin;
+               [case(PT_BINARY)]               Binary_r                bin;
                [case(PT_UNICODE)][string,charset(UTF16)] uint16        *lpszW;
                [case(PT_CLSID)]                FlatUID_r               *lpguid;
                [case(PT_SYSTIME)]              FILETIME                ft;
index 01c851af0136e5c1efb71fe805bce8d4cedf5dde..14122cdce2a2cb895bae2d88c1622089adc281cd 100644 (file)
@@ -60,7 +60,7 @@ class attachment : public object {
 
                        m_data_size = *(static_cast<const uint32_t*>(properties[PR_ATTACH_SIZE]));
 
-                       const SBinary* attachment_data = static_cast<const SBinary*>(properties[PR_ATTACH_DATA_BIN]);
+                       const Binary_r* attachment_data = static_cast<const Binary_r*>(properties[PR_ATTACH_DATA_BIN]);
 
                        // Don't load PR_ATTACH_DATA_BIN if it's embedded in message.
                        // NOTE: Use RopOpenEmbeddedMessage when it is implemented.
index 7013fdd5cd1908aa95937abb3a890f4a1716e1f8..b64a55c5cbbbf43d7316218ef56a913430de6a2f 100644 (file)
@@ -477,7 +477,7 @@ const void *pull_emsmdb_property(TALLOC_CTX *mem_ctx,
        struct FILETIME         *pt_filetime;
        struct GUID             *pt_clsid;
        struct SBinary_short    pt_binary;
-       struct SBinary          *sbin;
+       struct Binary_r         *sbin;
        struct mapi_SLPSTRArray pt_slpstr;
        struct StringArray_r    *slpstr;
        uint32_t                i;
@@ -535,7 +535,7 @@ const void *pull_emsmdb_property(TALLOC_CTX *mem_ctx,
        case PT_BINARY:
                ndr_pull_SBinary_short(ndr, NDR_SCALARS, &pt_binary);
                *offset = ndr->offset;
-               sbin = talloc_zero(mem_ctx, struct SBinary);
+               sbin = talloc_zero(mem_ctx, struct Binary_r);
                sbin->cb = pt_binary.cb;
                sbin->lpb = pt_binary.lpb;
                return (void *) sbin;
index bd175f3235931f02abbfc12d1f95db180431c3a1..c43da8249d2b46de876c61bcc748458e100ad3c6 100644 (file)
@@ -342,7 +342,7 @@ _PUBLIC_ bool set_SPropValue(struct SPropValue *lpProps, const void *data)
                lpProps->value.lpszA = (const char *) data;
                break;
        case PT_BINARY:
-               lpProps->value.bin = *((const struct SBinary *)data);
+               lpProps->value.bin = *((const struct Binary_r *)data);
                break;
        case PT_UNICODE:
                lpProps->value.lpszW = (const char *) data;
@@ -670,7 +670,7 @@ _PUBLIC_ bool set_SPropValue_proptag_date_timeval(struct SPropValue *lpProps, ui
    \details Retrieve a RecurrencePattern structure from a binary blob
 
    \param mem_ctx pointer to the memory context
-   \param bin pointer to the SBinary structure with non-mapped
+   \param bin pointer to the Binary_r structure with non-mapped
    reccurrence data
 
    \return Allocated RecurrencePattern structure on success,
@@ -680,7 +680,7 @@ _PUBLIC_ bool set_SPropValue_proptag_date_timeval(struct SPropValue *lpProps, ui
    finished.
  */
 _PUBLIC_ struct RecurrencePattern *get_RecurrencePattern(TALLOC_CTX *mem_ctx, 
-struct SBinary *bin)
+                                                        struct Binary_r *bin)
 {
         struct RecurrencePattern       *RecurrencePattern = NULL;
         struct ndr_pull                        *ndr;
@@ -716,8 +716,8 @@ struct SBinary *bin)
    \details Retrieve a TimeZoneStruct structure from a binary blob
 
    \param mem_ctx pointer to the memory context
-   \param bin pointer to the SBinary structure with raw TimeZoneStruct
-   data
+   \param bin pointer to the Binary_r structure with raw
+   TimeZoneStruct data
 
    \return Allocated TimeZoneStruct structure on success, otherwise
    NULL
@@ -726,7 +726,7 @@ struct SBinary *bin)
    finished.
  */
 _PUBLIC_ struct TimeZoneStruct *get_TimeZoneStruct(TALLOC_CTX *mem_ctx, 
-                                                  struct SBinary *bin)
+                                                  struct Binary_r *bin)
 {
        struct TimeZoneStruct   *TimeZoneStruct = NULL;
        struct ndr_pull         *ndr;
@@ -762,9 +762,8 @@ _PUBLIC_ struct TimeZoneStruct *get_TimeZoneStruct(TALLOC_CTX *mem_ctx,
    \details Retrieve a GlobalObjectId structure from a binary blob
 
    \param mem_ctx pointer to the memory context
-
-   \param bin pointer to the SBinary structure with raw GlobalObjectId
-   data
+   \param bin pointer to the Binary_r structure with raw
+   GlobalObjectId data
 
    \return Allocated GlobalObjectId structure on success, otherwise
    NULL
@@ -773,7 +772,7 @@ _PUBLIC_ struct TimeZoneStruct *get_TimeZoneStruct(TALLOC_CTX *mem_ctx,
    finished.
  */
 _PUBLIC_ struct GlobalObjectId *get_GlobalObjectId(TALLOC_CTX *mem_ctx,
-                                                  struct SBinary *bin)
+                                                  struct Binary_r *bin)
 {
        struct GlobalObjectId   *GlobalObjectId = NULL;
        struct ndr_pull         *ndr;
index 4db84a1219ee4fc6696cd00cedd038eff03a6f83..a1ee5fa176e2efb15261de747413869dc1ba6ccc 100644 (file)
@@ -63,13 +63,13 @@ _PUBLIC_ char *guid_delete_dash(TALLOC_CTX *mem_ctx, const char *recipient_id)
        return guid;
 }
 
-_PUBLIC_ struct SBinary *generate_recipient_entryid(TALLOC_CTX *mem_ctx, const char *recipient_id)
+_PUBLIC_ struct Binary_r *generate_recipient_entryid(TALLOC_CTX *mem_ctx, const char *recipient_id)
 {
-       struct SBinary *entryid;
+       struct Binary_r *entryid;
        uint32_t        off;
        char            *guid = (char *) NULL;
 
-       entryid = talloc(mem_ctx, struct SBinary);
+       entryid = talloc(mem_ctx, struct Binary_r);
        entryid->cb = sizeof (uint32_t) + sizeof (MAPI_LOCAL_UID) + sizeof (MAPI_LOCAL_UID_END) + 1;
 
        if (recipient_id) {
index 9366fe6eaa38465b87fc7d4580fe43447902610e..0f7126101925e34cccef3cbd1400b671baeb5ca4 100644 (file)
@@ -139,9 +139,9 @@ int ocpf_set_propvalue(TALLOC_CTX *mem_ctx, const void **value, uint16_t proptyp
                *value = talloc_memdup(mem_ctx, (const void *)&lpProp.ft, sizeof (struct FILETIME));
                return OCPF_SUCCESS;
        case PT_BINARY:
-               *value = (const void *)talloc_zero(mem_ctx, struct SBinary);
-               ((struct SBinary *)*value)->cb = lpProp.bin.cb;
-               ((struct SBinary *)*value)->lpb = talloc_memdup(mem_ctx, (const void *)lpProp.bin.lpb, lpProp.bin.cb);
+               *value = (const void *)talloc_zero(mem_ctx, struct Binary_r);
+               ((struct Binary_r *)*value)->cb = lpProp.bin.cb;
+               ((struct Binary_r *)*value)->lpb = talloc_memdup(mem_ctx, (const void *)lpProp.bin.lpb, lpProp.bin.cb);
                return OCPF_SUCCESS;
        case PT_MV_STRING8:
                *value = (const void *)talloc_zero(mem_ctx, struct StringArray_r);
@@ -543,7 +543,7 @@ int ocpf_variable_add(const char *name, union SPropValue_CTR lpProp, uint16_t pr
 }
 
 
-int ocpf_binary_add(const char *filename, struct SBinary *bin)
+int ocpf_binary_add(const char *filename, struct Binary_r *bin)
 {
        int             fd;
        struct stat     sb;
index 1e060f55b6fb3df917616295251b1530ad58ba7f..8416292bfd407d607e1701423a4ca3db85141c4b 100644 (file)
@@ -128,7 +128,7 @@ _PUBLIC_ int ocpf_parse(const char *filename)
 static enum MAPISTATUS ocpf_stream(TALLOC_CTX *mem_ctx,
                                   mapi_object_t *obj_parent,
                                   uint32_t aulPropTag,
-                                  struct SBinary *bin)
+                                  struct Binary_r *bin)
 {
        enum MAPISTATUS         retval;
        mapi_object_t           obj_stream;
@@ -241,9 +241,9 @@ _PUBLIC_ enum MAPISTATUS ocpf_set_SPropValue(TALLOC_CTX *mem_ctx,
                for (nel = ocpf->nprops, i = 0; SPropTagArray->aulPropTag[i] && nel->next; nel = nel->next, i++) {
                        if (SPropTagArray->aulPropTag[i]) {
                                if (((SPropTagArray->aulPropTag[i] & 0xFFFF) == PT_BINARY) && 
-                                   (((struct SBinary *)nel->value)->cb > MAX_READ_SIZE)) {
+                                   (((struct Binary_r *)nel->value)->cb > MAX_READ_SIZE)) {
                                        retval = ocpf_stream(mem_ctx, obj_message, SPropTagArray->aulPropTag[i], 
-                                                            (struct SBinary *)nel->value);
+                                                            (struct Binary_r *)nel->value);
                                        MAPI_RETVAL_IF(retval, retval, NULL);
                                } else {
                                        ocpf->lpProps = add_SPropValue(mem_ctx, ocpf->lpProps, &ocpf->cValues,
@@ -258,9 +258,9 @@ _PUBLIC_ enum MAPISTATUS ocpf_set_SPropValue(TALLOC_CTX *mem_ctx,
        if (ocpf->props && ocpf->props->next) {
                for (pel = ocpf->props; pel->next; pel = pel->next) {
                        if (((pel->aulPropTag & 0xFFFF) == PT_BINARY) && 
-                           (((struct SBinary *)pel->value)->cb > MAX_READ_SIZE)) {
+                           (((struct Binary_r *)pel->value)->cb > MAX_READ_SIZE)) {
                                retval = ocpf_stream(mem_ctx, obj_message, pel->aulPropTag, 
-                                                    (struct SBinary *)pel->value);
+                                                    (struct Binary_r *)pel->value);
                                MAPI_RETVAL_IF(retval, retval, NULL);
                        } else {
                                ocpf->lpProps = add_SPropValue(mem_ctx, ocpf->lpProps, &ocpf->cValues, 
index 46a5d7c37898c3a5b8577dff64f16c226048edc4..fc9ba7a0b84076c4067f6d014c6b6732082f59b7 100644 (file)
@@ -155,7 +155,7 @@ static char *ocpf_write_systime(const struct FILETIME *ft)
        return line;
 }
 
-static char *ocpf_write_binary(const struct SBinary *bin)
+static char *ocpf_write_binary(const struct Binary_r *bin)
 {
        uint32_t        i;
        char            *line;
@@ -310,7 +310,7 @@ static char *ocpf_write_property(bool *found, uint32_t ulPropTag, const void *va
                *found = true;
                break;
        case PT_BINARY:
-               line = ocpf_write_binary((const struct SBinary *)value);
+               line = ocpf_write_binary((const struct Binary_r *)value);
                *found = true;
                break;
        case PT_MV_STRING8:
index 68b473119d46bbae668bb51b749dfac70b305e5d..418d078d1f042533c9eeca088f89e427baa346c5 100644 (file)
@@ -181,7 +181,7 @@ bool emsabp_add_entry(struct emsabp_ctx *emsabp_ctx, uint32_t *instance_key,
   set an entry id
 */
 
-NTSTATUS emsabp_setEntryId(TALLOC_CTX *mem_ctx, struct entry_id *entry, struct SBinary *bin)
+NTSTATUS emsabp_setEntryId(TALLOC_CTX *mem_ctx, struct entry_id *entry, struct Binary_r *bin)
 {
        struct GUID     *guid;
        const char      *guid_str;
@@ -328,7 +328,7 @@ void *emsabp_query(TALLOC_CTX *mem_ctx, struct emsabp_ctx *emsabp_ctx, struct en
        struct ldb_message_element      *ldb_element;
        struct ldb_message              *ldb_res;
        struct StringArray_r            *mv_string;
-       struct SBinary                  *bin;
+       struct Binary_r                 *bin;
        const char                      *ldb_str;
        const char                      *x500 = NULL;
        NTSTATUS                        status;
@@ -344,7 +344,7 @@ void *emsabp_query(TALLOC_CTX *mem_ctx, struct emsabp_ctx *emsabp_ctx, struct en
                data = talloc_strdup(mem_ctx, EMSABP_ADDRTYPE);
                return (data);
        case PR_ENTRYID:
-               bin = talloc(mem_ctx, struct SBinary);
+               bin = talloc(mem_ctx, struct Binary_r);
                emsabp_setEntryId(mem_ctx, entry, bin);
                return (bin);
        case PR_OBJECT_TYPE:
@@ -356,7 +356,7 @@ void *emsabp_query(TALLOC_CTX *mem_ctx, struct emsabp_ctx *emsabp_ctx, struct en
                *((uint32_t *)data) = DT_MAILUSER;
                return (data);
        case PR_INSTANCE_KEY:
-               bin = talloc(mem_ctx, struct SBinary);
+               bin = talloc(mem_ctx, struct Binary_r);
                bin->cb = 4;
                bin->lpb = talloc_size(mem_ctx, sizeof(uint8_t) * bin->cb);
                memset(bin->lpb, 0, bin->cb);
@@ -482,13 +482,13 @@ NTSTATUS emsabp_fetch_attrs(TALLOC_CTX *mem_ctx, struct emsabp_ctx *emsabp_ctx,
 
 /*
  * emsabp_hierarchy_get_entryID:
- * Generate the PR_ENTRYID SBinary structure for the given recipient
+ * Generate the PR_ENTRYID Binary_r structure for the given recipient
  *
  */
 
-struct SBinary *emsabp_hierarchy_get_entryID(TALLOC_CTX *mem_ctx, struct GUID *guid, bool containerID)
+struct Binary_r *emsabp_hierarchy_get_entryID(TALLOC_CTX *mem_ctx, struct GUID *guid, bool containerID)
 {
-       struct SBinary  *entryID;
+       struct Binary_r *entryID;
        char            *guid_str = (char *) NULL;
        
        if (!containerID) {
index ee420d4ee20136d54a2863e6091314d9995120a9..b6d7db5506bdff237a28a9e7e7aa3b6c8e89cd7a 100644 (file)
@@ -92,22 +92,22 @@ static void exchange2ical_reset(struct exchange2ical *exchange2ical)
 
 static int exchange2ical_get_properties(TALLOC_CTX *mem_ctx, struct SRow *aRow, struct exchange2ical *exchange2ical)
 {
-       struct SBinary  *apptrecur;
-       struct SBinary  *TimeZoneStruct;
+       struct Binary_r *apptrecur;
+       struct Binary_r *TimeZoneStruct;
 
        exchange2ical->Keywords = (const struct StringArray_r *) octool_get_propval(aRow, PidNameKeywords);
        exchange2ical->method = get_ical_method((const char *) octool_get_propval(aRow, PR_MESSAGE_CLASS_UNICODE));
        if (!exchange2ical->method) return -1;
 
        exchange2ical->Recurring = (uint8_t *) octool_get_propval(aRow, PidLidRecurring);
-       apptrecur = (struct SBinary *) octool_get_propval(aRow, PidLidAppointmentRecur);
+       apptrecur = (struct Binary_r *) octool_get_propval(aRow, PidLidAppointmentRecur);
        exchange2ical->RecurrencePattern = get_RecurrencePattern(mem_ctx, apptrecur);
 
        exchange2ical->TimeZoneDesc = (const char *) octool_get_propval(aRow, PidLidTimeZoneDescription);
-       TimeZoneStruct = (struct SBinary *) octool_get_propval(aRow, PidLidTimeZoneStruct);
+       TimeZoneStruct = (struct Binary_r *) octool_get_propval(aRow, PidLidTimeZoneStruct);
        exchange2ical->TimeZoneStruct = get_TimeZoneStruct(mem_ctx, TimeZoneStruct);
 
-       exchange2ical->GlobalObjectId = (struct SBinary *) octool_get_propval(aRow, PidLidCleanGlobalObjectId);
+       exchange2ical->GlobalObjectId = (struct Binary_r *) octool_get_propval(aRow, PidLidCleanGlobalObjectId);
        exchange2ical->apptStateFlags = (uint32_t *) octool_get_propval(aRow, PidLidAppointmentStateFlags);
        exchange2ical->Contacts = (const struct StringArray_r *)octool_get_propval(aRow, PidLidContacts);
        exchange2ical->apptStartWhole = (const struct FILETIME *)octool_get_propval(aRow, PidLidAppointmentStartWhole);
index 627582dca55a51995b1a2301615fec496b233162..1ecd860bdc255be4de5625786fd2d5f688f82a44 100644 (file)
@@ -71,7 +71,7 @@ struct exchange2ical {
        const char                      *Subject;
        uint32_t                        *BusyStatus;
        uint32_t                        *IntendedBusyStatus;
-       struct SBinary                  *GlobalObjectId;
+       struct Binary_r                 *GlobalObjectId;
        const struct FILETIME           *AttendeeCriticalChange;
        uint32_t                        *OwnerApptId;
        const struct FILETIME           *apptReplyTime;
index 0815e7eb15279618dbbf7d55d8ed23917aba2d3e..c0e8b28d6175f10d21e2efda1420eb98305862ee 100644 (file)
@@ -682,7 +682,7 @@ static char **collapse_recipients(TALLOC_CTX *mem_ctx, struct oclient *oclient)
 
 static bool openchangeclient_stream(TALLOC_CTX *mem_ctx, mapi_object_t obj_parent, 
                                    mapi_object_t obj_stream, uint32_t mapitag, 
-                                   uint32_t access_flags, struct SBinary bin)
+                                   uint32_t access_flags, struct Binary_r bin)
 {
        enum MAPISTATUS retval;
        DATA_BLOB       stream;
@@ -816,7 +816,7 @@ static enum MAPISTATUS openchangeclient_sendmail(TALLOC_CTX *mem_ctx,
                set_SPropValue_proptag(&props[3], PR_MSG_EDITOR_FORMAT, (const void *)&editor);
 
                if (strlen(oclient->pr_body) > MAX_READ_SIZE) {
-                       struct SBinary  bin;
+                       struct Binary_r bin;
 
                        bin.lpb = (uint8_t *)oclient->pr_body;
                        bin.cb = strlen(oclient->pr_body);
@@ -831,7 +831,7 @@ static enum MAPISTATUS openchangeclient_sendmail(TALLOC_CTX *mem_ctx,
                set_SPropValue_proptag(&props[3], PR_MSG_EDITOR_FORMAT, (const void *)&editor);
 
                if (strlen(oclient->pr_html_inline) > MAX_READ_SIZE) {
-                       struct SBinary  bin;
+                       struct Binary_r bin;
                        
                        bin.lpb = (uint8_t *)oclient->pr_html_inline;
                        bin.cb = strlen(oclient->pr_html_inline);
index bd2265d01e80e4d5868f95f2c2dcdb7ea8b0923e..00a364eac4aa7d85f9a7de4294174f70c53b7294 100644 (file)
@@ -38,7 +38,7 @@ struct ocpf_file {
 
 struct attach {
        const char              *filename;
-       struct SBinary          bin;
+       struct Binary_r         bin;
        int                     fd;
 };
 
@@ -53,7 +53,7 @@ struct oclient {
        char                    **mapi_to;
        char                    **mapi_cc;
        char                    **mapi_bcc;
-       struct SBinary          pr_html;
+       struct Binary_r         pr_html;
        struct attach           *attach;
        uint32_t                attach_num;
        const char              *store_folder;