sogo/OpenChange/MAPIStoreTypes.h
Wolfgang Sourdeau ed2c4777aa Monotone-Parent: 482fb2f36da6ff311c3c19eb3752da985fdae5cd
Monotone-Revision: 8fcaef79630a50f01c6aba0e5fdc0744c274cba6

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-03-07T19:15:16
Monotone-Branch: ca.inverse.sogo
2011-03-07 19:15:16 +00:00

58 lines
1.8 KiB
Objective-C

/* MAPIStoreTypes.h - this file is part of SOGo
*
* Copyright (C) 2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef MAPISTORETYPES_H
#define MAPISTORETYPES_H
#import <Foundation/NSValue.h>
#include <stdbool.h>
#include <gen_ndr/exchange.h>
@class NSData;
@class NSDictionary;
uint8_t *MAPIBoolValue (void *memCtx, BOOL value);
uint32_t *MAPILongValue (void *memCtx, uint32_t value);
uint64_t *MAPILongLongValue (void *memCtx, uint64_t value);
double *MAPIDoubleValue (void *memCtx, double value);
id NSObjectFromSPropValue (const struct SPropValue *);
id NSObjectFromMAPISPropValue (const struct mapi_SPropValue *);
id NSObjectFromStreamData (enum MAPITAGS property, NSData *streamData);
static inline NSNumber *
MAPIPropertyKey (enum MAPITAGS propTag)
{
#if (GS_SIZEOF_LONG == 4)
return [NSNumber numberWithUnsignedLong: propTag];
#elif (GS_SIZEOF_INT == 4)
return [NSNumber numberWithUnsignedInt: propTag];
#else
#error No suitable type for 4 bytes integers
#endif
}
void MAPIStoreDumpMessageProperties (NSDictionary *properties);
#endif /* MAPISTORETYPES_H */