version 1.2.2.2, 2011/08/21 14:00:43
|
version 1.2.2.3, 2011/08/21 14:18:52
|
Line 47 SUCH DAMAGE.
|
Line 47 SUCH DAMAGE.
|
#define __AITSESS_H |
#define __AITSESS_H |
|
|
|
|
|
#include <assert.h> |
#include <semaphore.h> |
#include <semaphore.h> |
#include <sys/types.h> |
#include <sys/types.h> |
|
|
Line 226 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 227 inline int ipc_decSemaphore(tagSess * __restrict s);
|
// Lazy macros for lazy programmers :-) by Michael Pounov; Optimizing work with sessions! |
// Lazy macros for lazy programmers :-) by Michael Pounov; Optimizing work with sessions! |
// |
// |
|
|
#define DESTROY_SESSION(fname, s) do { \ | #define DESTROY_SESSION(fname, s) do { assert((s)); assert((*s)); \ |
switch (((*s))->type) { \ |
switch (((*s))->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
ipc_destroySession((fname), (s)); \ |
ipc_destroySession((fname), (s)); \ |
Line 237 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 238 inline int ipc_decSemaphore(tagSess * __restrict s);
|
} \ |
} \ |
} while(0) |
} while(0) |
|
|
#define ATTACH_MEMORY(s) do { \ | #define ATTACH_MEMORY(s) do { assert((s)); \ |
switch ((s)->type) { \ |
switch ((s)->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
ipc_attachSession((s), 0); \ |
ipc_attachSession((s), 0); \ |
Line 248 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 249 inline int ipc_decSemaphore(tagSess * __restrict s);
|
} \ |
} \ |
} while(0) |
} while(0) |
|
|
#define DETACH_MEMORY(s) do { \ | #define DETACH_MEMORY(s) do { assert((s)); \ |
switch ((s)->type) { \ |
switch ((s)->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
ipc_detachSession((s)); \ |
ipc_detachSession((s)); \ |
Line 259 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 260 inline int ipc_decSemaphore(tagSess * __restrict s);
|
} \ |
} \ |
} while(0) |
} while(0) |
|
|
#define NOT_SEMAPHORE(s) do { \ | #define NOT_SEMAPHORE(s) do { assert((s)); \ |
switch ((s)->type) { \ |
switch ((s)->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
ipc_notSemaphore((s)); \ |
ipc_notSemaphore((s)); \ |
Line 270 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 271 inline int ipc_decSemaphore(tagSess * __restrict s);
|
} \ |
} \ |
} while(0) |
} while(0) |
|
|
#define IS_SEMAPHORED(s, ret) do { \ | #define IS_SEMAPHORED(s, ret) do { assert((s)); \ |
switch ((s)->type) { \ |
switch ((s)->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
(ret) = ipc_isSemaphored((s)); \ |
(ret) = ipc_isSemaphored((s)); \ |
Line 283 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 284 inline int ipc_decSemaphore(tagSess * __restrict s);
|
} \ |
} \ |
} while(0) |
} while(0) |
|
|
#define ADD_SEMAPHORE(s, ret) do { \ | #define ADD_SEMAPHORE(s, ret) do { assert((s)); \ |
switch ((s)->type) { \ |
switch ((s)->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
(ret) = ipc_addSemaphore((s)); \ |
(ret) = ipc_addSemaphore((s)); \ |
Line 296 inline int ipc_decSemaphore(tagSess * __restrict s);
|
Line 297 inline int ipc_decSemaphore(tagSess * __restrict s);
|
} \ |
} \ |
} while(0) |
} while(0) |
|
|
#define DEC_SEMAPHORE(s, ret) do { \ | #define DEC_SEMAPHORE(s, ret) do { assert((s)); \ |
switch ((s)->type) { \ |
switch ((s)->type) { \ |
case SHARED_IPC: \ |
case SHARED_IPC: \ |
(ret) = ipc_decSemaphore((s)); \ |
(ret) = ipc_decSemaphore((s)); \ |