1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-22 13:17:35 +00:00
Files
amiga-tz/library/time_tzalloc.c
2015-07-29 20:14:38 +02:00

31 lines
828 B
C

//--------------------------------------------------------------------------//
// This file is in the public domain, so clarified as of //
// 2009-05-17 by Arthur David Olson. //
//--------------------------------------------------------------------------//
#include "time_header.h"
timezone_t ASM tzalloc(REG(a0, char const *name))
{
struct state *sp;
unsigned long memsize;
if (name == NULL || name[0] == '\0') {
return NULL;
}
memsize = sizeof(struct state);
sp = (struct state*)AllocMem(memsize, MEMF_PUBLIC | MEMF_CLEAR);
if (sp) {
int err = zoneinit(sp, name);
if (err != 0) {
FreeMem(sp, memsize);
errno = err;
return NULL;
}
}
return (timezone_t)sp;
}