summaryrefslogtreecommitdiff
path: root/src/include/storage/shmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/storage/shmem.h')
-rw-r--r--src/include/storage/shmem.h86
1 files changed, 45 insertions, 41 deletions
diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h
index fb52742d362..5812a718717 100644
--- a/src/include/storage/shmem.h
+++ b/src/include/storage/shmem.h
@@ -1,16 +1,16 @@
/*-------------------------------------------------------------------------
*
* shmem.h--
- * shared memory management structures
+ * shared memory management structures
*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: shmem.h,v 1.5 1997/08/19 21:40:01 momjian Exp $
+ * $Id: shmem.h,v 1.6 1997/09/07 05:01:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-#ifndef SHMEM_H
+#ifndef SHMEM_H
#define SHMEM_H
#include <utils/hsearch.h>
@@ -22,11 +22,12 @@
* offsets relative to the start of the shared memory region(s).
*/
typedef unsigned long SHMEM_OFFSET;
+
#define INVALID_OFFSET (-1)
#define BAD_LOCATION (-1)
/* start of the lowest shared memory region. For now, assume that
- * there is only one shared memory region
+ * there is only one shared memory region
*/
extern SHMEM_OFFSET ShmemBase;
@@ -51,54 +52,57 @@ extern SPINLOCK ShmemLock;
extern SPINLOCK BindingLock;
/* shmemqueue.c */
-typedef struct SHM_QUEUE {
- SHMEM_OFFSET prev;
- SHMEM_OFFSET next;
-} SHM_QUEUE;
+typedef struct SHM_QUEUE
+{
+ SHMEM_OFFSET prev;
+ SHMEM_OFFSET next;
+} SHM_QUEUE;
/* shmem.c */
-extern void ShmemBindingTabReset(void);
-extern void ShmemCreate(unsigned int key, unsigned int size);
-extern int InitShmem(unsigned int key, unsigned int size);
-extern long *ShmemAlloc(unsigned long size);
-extern int ShmemIsValid(unsigned long addr);
-extern HTAB *ShmemInitHash(char *name, long init_size, long max_size,
- HASHCTL *infoP, int hash_flags);
-extern bool ShmemPIDLookup(int pid, SHMEM_OFFSET* locationPtr);
+extern void ShmemBindingTabReset(void);
+extern void ShmemCreate(unsigned int key, unsigned int size);
+extern int InitShmem(unsigned int key, unsigned int size);
+extern long *ShmemAlloc(unsigned long size);
+extern int ShmemIsValid(unsigned long addr);
+extern HTAB *
+ShmemInitHash(char *name, long init_size, long max_size,
+ HASHCTL * infoP, int hash_flags);
+extern bool ShmemPIDLookup(int pid, SHMEM_OFFSET * locationPtr);
extern SHMEM_OFFSET ShmemPIDDestroy(int pid);
-extern long *ShmemInitStruct(char *name, unsigned long size,
- bool *foundPtr);
-extern bool TransactionIdIsInProgress (TransactionId xid);
+extern long *
+ShmemInitStruct(char *name, unsigned long size,
+ bool * foundPtr);
+extern bool TransactionIdIsInProgress(TransactionId xid);
-typedef int TableID;
+typedef int TableID;
/* size constants for the binding table */
- /* max size of data structure string name */
-#define BTABLE_KEYSIZE (50)
- /* data in binding table hash bucket */
+ /* max size of data structure string name */
+#define BTABLE_KEYSIZE (50)
+ /* data in binding table hash bucket */
#define BTABLE_DATASIZE (sizeof(BindingEnt) - BTABLE_KEYSIZE)
- /* maximum size of the binding table */
-#define BTABLE_SIZE (100)
+ /* maximum size of the binding table */
+#define BTABLE_SIZE (100)
/* this is a hash bucket in the binding table */
-typedef struct {
- char key[BTABLE_KEYSIZE]; /* string name */
- unsigned long location; /* location in shared mem */
- unsigned long size; /* numbytes allocated for the
- * structure
- */
-} BindingEnt;
+typedef struct
+{
+ char key[BTABLE_KEYSIZE]; /* string name */
+ unsigned long location; /* location in shared mem */
+ unsigned long size; /* numbytes allocated for the structure */
+} BindingEnt;
/*
* prototypes for functions in shmqueue.c
*/
-extern void SHMQueueInit(SHM_QUEUE *queue);
-extern void SHMQueueElemInit(SHM_QUEUE *queue);
-extern void SHMQueueDelete(SHM_QUEUE *queue);
-extern void SHMQueueInsertTL(SHM_QUEUE *queue, SHM_QUEUE *elem);
-extern void SHMQueueFirst(SHM_QUEUE *queue, Pointer *nextPtrPtr,
- SHM_QUEUE *nextQueue);
-extern bool SHMQueueEmpty(SHM_QUEUE *queue);
-
-#endif /* SHMEM_H */
+extern void SHMQueueInit(SHM_QUEUE * queue);
+extern void SHMQueueElemInit(SHM_QUEUE * queue);
+extern void SHMQueueDelete(SHM_QUEUE * queue);
+extern void SHMQueueInsertTL(SHM_QUEUE * queue, SHM_QUEUE * elem);
+extern void
+SHMQueueFirst(SHM_QUEUE * queue, Pointer * nextPtrPtr,
+ SHM_QUEUE * nextQueue);
+extern bool SHMQueueEmpty(SHM_QUEUE * queue);
+
+#endif /* SHMEM_H */