/* Shared memory block utility code V1.00 30/10/03
   Copyright 2008 Jeffrey Lee
   This file is part of WOUM.
   WOUM is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   WOUM is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   You should have received a copy of the GNU General Public License
   along with WOUM.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _SMALLOC_H
#define _SMALLOC_H

extern void *smalloc(size_t size);
/* Allocate new shared memory block (with 1 reference to it)
   Returns NULL on failure */

extern void smref(void *b);
/* Make a reference to the block */

extern int smfree(void *b);
/* Free the block
   The block is only actually freed if no more references are left; else the reference count is simply reduced
   Returns 1 if the block is actually deleted, 0 if it still exists
*/

#endif
