Skip to content

Commit 377264f

Browse files
committed
include: move proptag_t/proptype_t etc. into namespace gromox
1 parent 83110e5 commit 377264f

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

include/gromox/exmdb_idef.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ EXMIDL(vacuum, (const char *dir))
132132
EXMIDL(unload_store, (const char *dir))
133133
EXMIDL(notify_new_mail, (const char *dir, uint64_t folder_id, uint64_t message_id))
134134
EXMIDL(store_eid_to_user, (const char *dir, const STORE_ENTRYID *store_eid, IDLOUT char **maildir, unsigned int *user_id, unsigned int *domain_id))
135-
EXMIDL(purge_softdelete, (const char *dir, const char *username, uint64_t folder_id, uint32_t del_flags, mapitime_t cutoff))
135+
EXMIDL(purge_softdelete, (const char *dir, const char *username, uint64_t folder_id, uint32_t del_flags, gromox::mapitime_t cutoff))
136136
EXMIDL(purge_datafiles, (const char *dir))
137137
EXMIDL(autoreply_tsquery, (const char *dir, const char *peer, uint64_t window, IDLOUT uint64_t *tdiff))
138138
EXMIDL(autoreply_tsupdate, (const char *dir, const char *peer))

include/gromox/exmdb_rpc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ struct exreq_purge_softdelete final : public exreq {
836836
char *username;
837837
uint64_t folder_id = 0;
838838
uint32_t del_flags = 0;
839-
mapitime_t cutoff = 0;
839+
gromox::mapitime_t cutoff = 0;
840840
};
841841

842842
struct exreq_autoreply_tsquery final : public exreq {

include/gromox/mapidefs.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,27 @@
1010
#include <type_traits>
1111
#include <gromox/defs.h>
1212

13-
#define PROP_ID(x) static_cast<uint16_t>((x) >> 16)
14-
#define PROP_TYPE(x) static_cast<uint16_t>((x) & 0xFFFF)
15-
#define CHANGE_PROP_TYPE(tag, newtype) static_cast<uint32_t>(((tag) & ~0xFFFF) | (newtype))
13+
namespace gromox {
14+
15+
using propid_t = uint16_t;
16+
using proptype_t = uint16_t;
17+
using proptag_t = uint32_t;
18+
/* N.B.: PidLids are not propids (they are also 32-bit wide) */
19+
using mapitime_t = uint64_t;
20+
21+
}
22+
23+
#define PROP_ID(x) static_cast<gromox::propid_t>((x) >> 16)
24+
#define PROP_TYPE(x) static_cast<gromox::proptype_t>((x) & 0xFFFF)
25+
#define CHANGE_PROP_TYPE(tag, newtype) static_cast<gromox::proptag_t>(((tag) & ~0xFFFF) | (newtype))
1626

1727
/*
1828
* x|y yields an unsigned result if either x or y are unsigned.
1929
* x<<y yields unsigned only if x is unsigned.
2030
* All the while | and << only make *sense* in an unsigned _context_ anyway
2131
* (i.e. the operator should have returned unsigned all the time)
2232
*/
23-
#define PROP_TAG(type, tag) static_cast<uint32_t>((static_cast<uint32_t>(tag) << 16) | (type))
33+
#define PROP_TAG(type, tag) static_cast<gromox::proptag_t>((static_cast<uint32_t>(tag) << 16) | (type))
2434
namespace {
2535
enum {
2636
/*
@@ -76,11 +86,8 @@ enum {
7686
PT_MV_CLSID = 0x1048, /* PtypMultipleGuid */
7787
PT_MV_BINARY = 0x1102, /* PtypMultipleBinary */
7888
};
79-
using proptype_t = decltype(PT_NULL);
8089
}
8190

82-
using mapitime_t = uint64_t;
83-
8491
#include "mapitags.hpp"
8592

8693
enum {
@@ -1053,7 +1060,7 @@ struct GX_EXPORT PROPERTY_XNAME {
10531060
std::string name;
10541061
};
10551062

1056-
using PROPID_ARRAY = std::vector<uint16_t>;
1063+
using PROPID_ARRAY = std::vector<gromox::propid_t>;
10571064

10581065
struct PROPNAME_ARRAY {
10591066
uint16_t count;

include/gromox/mapitags.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,6 @@ enum {
11131113
PR_EMS_AB_PARENT_ENTRYID = PROP_TAG(PT_BINARY, 0xFFFC), /* PidTagAddressBookParentEntryId */
11141114
PR_EMS_AB_CONTAINERID = PROP_TAG(PT_LONG, 0xFFFD), /* PidTagAddressBookContainerId */
11151115
};
1116-
using proptag_t = decltype(PR_NULL);
11171116
}
11181117

11191118
enum {

0 commit comments

Comments
 (0)