diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-02 12:32:44 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-02 12:32:55 +0300 |
commit | 931a7dc1ac0dbc7e6c1083583ced915e572f5b47 (patch) | |
tree | 9fe9a6448d44030e26aa7107ce16044ed413e0d0 /protocols/LotusNotify/src/cnotesapi/include/pool.h | |
parent | dd7d9954042254e66e3bbbec7195c6be8b1a0663 (diff) |
all protocols (even virtual ones) moved to the Protocols folder
Diffstat (limited to 'protocols/LotusNotify/src/cnotesapi/include/pool.h')
-rw-r--r-- | protocols/LotusNotify/src/cnotesapi/include/pool.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/protocols/LotusNotify/src/cnotesapi/include/pool.h b/protocols/LotusNotify/src/cnotesapi/include/pool.h new file mode 100644 index 0000000000..91b415c039 --- /dev/null +++ b/protocols/LotusNotify/src/cnotesapi/include/pool.h @@ -0,0 +1,88 @@ + +#if defined(OS400) && (__OS400_TGTVRM__ >= 510) +#pragma datamodel(P128) +#endif + +/*********************************************************************/ +/* */ +/* Licensed Materials - Property of IBM */ +/* */ +/* L-GHUS-5VMPGW, L-GHUS-5S3PEE */ +/* (C) Copyright IBM Corp. 1989, 2005 All Rights Reserved */ +/* */ +/* US Government Users Restricted Rights - Use, duplication or */ +/* disclosure restricted by GSA ADP Schedule Contract with */ +/* IBM Corp. */ +/* */ +/*********************************************************************/ + + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef POOL_DEFS +#define POOL_DEFS + + +/* A datatype which identifies a block within a segment */ + +typedef DWORD DBLOCK; /* dpool block handle */ + +#define NULLBLOCK (BLOCK) 0 +#define NULLDBLOCK (DBLOCK) 0 + + +/* A structure containing a pool handle and block offset */ + +typedef struct /* Pointer to any block in any pool */ + { + HANDLE pool; /* pool handle */ + BLOCK block; /* block handle */ + } BLOCKID; + +typedef struct /* Pointer to any block in any pool */ + { + HANDLE pool; /* pool handle */ + DBLOCK block; /* block handle */ + } DBLOCKID; + +#define ISNULLBLOCKID(x) (((x).pool==NULLHANDLE)&&((x).block==NULLBLOCK)) + +/* Macro functions */ + + +#define OSLockBlock(type,blockid) \ + ((type far *)(OSLock(char,(blockid).pool) + (blockid).block)) + +#define OSUnlockBlock(blockid) \ + OSUnlockObject((blockid).pool) + +#define OSSwitchBlock(ptr,thisid,nextid) \ + { \ + if ((thisid).pool != (nextid).pool) \ + { \ + if ((thisid).pool != NULLHANDLE) \ + OSUnlockBlock((thisid)); \ + ptr = OSLockBlock(void,(nextid)); \ + } \ + else \ + { \ + register char **pptr = (char **) &(ptr); \ + *pptr = *pptr + (LONG)((nextid).block - (thisid).block); \ + } \ + (thisid) = (nextid); \ + } + + +#endif + +#ifdef __cplusplus +} +#endif + + +#if defined(OS400) && (__OS400_TGTVRM__ >= 510) +#pragma datamodel(pop) +#endif + |