f77_aloc.c
Go to the documentation of this file.
00001 #include "f2c.h"
00002 #undef abs
00003 #undef min
00004 #undef max
00005 #include "stdio.h"
00006 
00007 static integer memfailure = 3;
00008 
00009 #ifdef KR_headers
00010 extern char *malloc();
00011 extern void exit_();
00012 
00013  char *
00014 F77_aloc(Len, whence) integer Len; char *whence;
00015 #else
00016 #include "stdlib.h"
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 extern void exit_(integer*);
00024 #ifdef __cplusplus
00025         }
00026 #endif
00027 
00028  char *
00029 F77_aloc(integer Len, const char *whence)
00030 #endif
00031 {
00032         char *rv;
00033         unsigned int uLen = (unsigned int) Len; /* for K&R C */
00034 
00035         if (!(rv = (char*)malloc(uLen))) {
00036                 fprintf(stderr, "malloc(%u) failure in %s\n",
00037                         uLen, whence);
00038                 exit_(&memfailure);
00039                 }
00040         return rv;
00041         }
00042 #ifdef __cplusplus
00043 }
00044 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:50