Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
F77_aloc.c
Go to the documentation of this file.00001 #include "stdio.h"
00002 #include "stdlib.h"
00003 #include "f2c.h"
00004 #undef abs
00005 #undef min
00006 #undef max
00007
00008 static integer memfailure = 3;
00009
00010 #ifdef KR_headers
00011 extern char *malloc();
00012 extern void exit_();
00013
00014 char *
00015 F77_aloc(Len, whence) integer Len; char *whence;
00016 #else
00017 #include "stdlib.h"
00018 extern void exit_(integer*);
00019
00020 char *
00021 F77_aloc(integer Len, char *whence)
00022 #endif
00023 {
00024 char *rv;
00025 unsigned int uLen = (unsigned int) Len;
00026
00027 if (!(rv = (char*)malloc(uLen))) {
00028 fprintf(stderr, "malloc(%u) failure in %s\n",
00029 uLen, whence);
00030 exit(memfailure);
00031 }
00032 return rv;
00033 }