| 1 |
/* @(#)osm.c 19.1 (ES0-DMD) 02/25/03 13:56:13 */ |
| 2 |
/*=========================================================================== |
| 3 |
Copyright (C) 1995 European Southern Observatory (ESO) |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or |
| 6 |
modify it under the terms of the GNU General Public License as |
| 7 |
published by the Free Software Foundation; either version 2 of |
| 8 |
the License, or (at your option) any later version. |
| 9 |
|
| 10 |
This program is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public |
| 16 |
License along with this program; if not, write to the Free |
| 17 |
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, |
| 18 |
MA 02139, USA. |
| 19 |
|
| 20 |
Corresponding concerning ESO-MIDAS should be addressed as follows: |
| 21 |
Internet e-mail: [email protected] |
| 22 |
Postal address: European Southern Observatory |
| 23 |
Data Management Division |
| 24 |
Karl-Schwarzschild-Strasse 2 |
| 25 |
D 85748 Garching bei Muenchen |
| 26 |
GERMANY |
| 27 |
===========================================================================*/ |
| 28 |
|
| 29 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 30 |
.COPYRIGHT (c) 1988 European Southern Observatory |
| 31 |
.LANGUAGE C |
| 32 |
.IDENT osm.c |
| 33 |
.AUTHOR P.Grosbol ESO/IPG |
| 34 |
.KEYWORDS dynamic memory allocation |
| 35 |
.PURPOSE obtain or free memory |
| 36 |
.COMMENT just use other routines of F.Ochsenbein |
| 37 |
.VERSION 1.0 1988-Nov-29 : Creation, PJG |
| 38 |
----------------------------------------------------------------------*/ |
| 39 |
int osmalloc(buf,size) |
| 40 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 41 |
.PURPUSE allocate dynamic memory |
| 42 |
.RETURN Number of bytes allocated, otherwise -1 |
| 43 |
----------------------------------------------------------------------*/ |
| 44 |
char **buf; /* OUT: address of allocated memory */ |
| 45 |
int size; /* IN: no. of bytes to allocate */ |
| 46 |
{ |
| 47 |
char *osmmget(); |
| 48 |
|
| 49 |
*buf = osmmget(size); |
| 50 |
return (*buf) ? size : -1; |
| 51 |
} |
| 52 |
int osmfree(buf) |
| 53 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 54 |
.PURPUSE free dynamic memory |
| 55 |
.RETURN status 0:OK, else error |
| 56 |
----------------------------------------------------------------------*/ |
| 57 |
char *buf; /* IN: address of memory to free */ |
| 58 |
{ |
| 59 |
osmmfree(buf); |
| 60 |
return 0; |
| 61 |
} |