/* 
 * $Id: shmpool.h,v 1.6 1998/03/19 23:43:37 abakun Exp $
 * header file for multiple process shared memory pool
 */

#ifndef SHMPOOL_H
#define SHMPOOL_H

#include <sys/ipc.h>
#include <sys/shm.h>

#include "func_private.h"
#include "message.h"


struct shmpoolent {
    int                 refs;
    int                 poolblknum;
    char                magic[4];
    struct shmpoolent  *next;
    int                 nextnum;
    long                requestnum;
    struct blockid      block;
    char                data[1];
};


func_public int                shm_create(key_t shmkey, int numblocks, size_t theblocksize);
func_public void               shm_start();
func_public void               shm_unlink_chain(struct shmpoolent *head);
func_public struct shmpoolent *shm_link_chain(int len);
func_public int                shm_addr_to_offset(struct shmpoolent *addr);
func_public struct shmpoolent *shm_offset_to_addr(int p);


#endif				/* SHMPOOL_H */

/*
 * $Log: shmpool.h,v $
 * Revision 1.6  1998/03/19 23:43:37  abakun
 * added declarations for shm_addr_to_offset and shm_offset_to_addr
 * removed the shm_alloc_poolent and shm_release_poolent, since they weren't intented to be
 * public functions (at least I don't think they were, is there a case that pool entries
 * would need to allocated and released outside of a chain?)
 *
 * Revision 1.5  1998/03/19 23:09:04  abakun
 * removed declartion of struct blockid, moved to message.h
 *
 * Revision 1.4  1998/03/17 22:54:20  abakun
 * added magic and blocknum to the shmpoolent structure
 *
 * Revision 1.3  1998/03/16 18:22:53  abakun
 * added system header files to the include list
 *
 * Revision 1.2  1998/03/10 21:59:38  abakun
 * updated for a rework of the shared memory pool
 *
 * Revision 1.1  1998/03/02 17:25:13  abakun
 * Initial revision
 *
 */
