/*
** memory.h
**
** Header file for memory.c
**
** CVS: $Id: memory.h,v 1.1.1.1 2004-05-19 22:55:27 price Exp $
**
*/

#ifndef _MEMORY_H
#define _MEMORY_H


void *papalloc (size_t size);
/*
  Function to return a pointer to a generic object, such as a struct.
*/

double *darray (size_t size);
/*
  Subroutine to allocate memory for an array of doubles of the
  indicated size.  Array is zero-offset (pass size+1 for unit-offset
  array).
*/

float *farray (size_t size);
/*
  Subroutine to allocate memory for an array of floats of the
  indicated size.  Array is zero-offset (pass size+1 for unit-offset
  array).
*/

int *iarray (size_t size);
/*
  Subroutine to allocate memory for an array of integers of the
  indicated size.  Array is zero-offset (pass size+1 for unit-offset
  array).
*/

short int *sarray (size_t size);
/*
  Subroutine to allocate memory for an array of short ints of the
  indicated size.  Array is zero-offset (pass size+1 for unit-offset
  array).
*/

char *carray (size_t size);
/*
  Subroutine to allocate memory for an array of chars of the indicated
  size.  Array is zero-offset (pass size+1 for unit-offset array).
*/

float **fmatrix (size_t m, size_t n);
/*
  Subroutine to allocate memory for an m x n rectangular matrix of
  floats.  Matrix is zero-offset (pass size+1 for unit-offset matrix).
*/

double **squarematrix (size_t size);
/*
  Subroutine to allocate memory for a square matrix of doubles of the
  indicated size.  Matrix is zero-offset (pass size+1 for unit-offset
  matrix).
*/

double **rectmatrix (size_t m, size_t n);
/*
  Subroutine to allocate memory for an m x n rectangular matrix of
  doubles.  Matrix is zero-offset (pass size+1 for unit-offset matrix).
*/

double **padrectmatrix(size_t m, size_t n);
/*
  Subroutine to allocate memory for an m x n rectangular matrix.
  Matrix is zero-offset (pass size+1 for unit-offset matrix).  This
  function adds a buffer of 1 pixel around the edge (i.e. it runs from
  -1 to m instead of 0 to m-1) --- provided by Nick Kaiser.
*/




#endif
