version 1.3, 1997/02/25 00:04:38 |
version 1.4, 1998/04/26 22:49:03 |
|
|
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
#include <stdlib.h> |
#include "ww.h" |
#include "ww.h" |
|
|
char ** |
char ** |
wwalloc(row, col, nrow, ncol, size) |
wwalloc(row, col, nrow, ncol, size) |
|
int row, col, nrow, ncol; |
|
size_t size; |
{ |
{ |
register char *p, **pp; |
register char *p, **pp; |
register int i; |
register int i; |
|
|
/* fast, call malloc only once */ |
/* fast, call malloc only once */ |
pp = (char **) |
pp = (char **) |
malloc((unsigned) sizeof (char **) * nrow + size * nrow * ncol); |
malloc(sizeof (char **) * nrow + size * nrow * ncol); |
if (pp == 0) { |
if (pp == 0) { |
wwerrno = WWE_NOMEM; |
wwerrno = WWE_NOMEM; |
return 0; |
return 0; |