amiga-tz/utility/tzversion.c

46 lines
965 B
C

#include "tzversion.h"
#include <stdlib.h>
const char *vers = AMIGA_VERSION_STRING;
char ** environ = NULL;
struct Library *DOSBase = NULL;
struct Library *TimezoneBase = NULL;
void amiga_open_lib_error(char *name, int version)
{
FPrintf(Output(), (STRPTR)OPEN_VER_ERROR, name, version);
}
void amiga_close_libs()
{
if (TimezoneBase != NULL) {
CloseLibrary(TimezoneBase);
TimezoneBase = NULL;
}
if (DOSBase != NULL) {
CloseLibrary(DOSBase);
DOSBase = NULL;
}
}
int amiga_open_libs()
{
atexit(amiga_close_libs);
DOSBase = OpenLibrary((STRPTR)DOSLIB_NAME, DOSLIB_REV);
if(!DOSBase) {
amiga_open_lib_error(DOSLIB_NAME, DOSLIB_REV);
return 5;
}
TimezoneBase = OpenLibrary((CONST_STRPTR)TIMEZONELIB_NAME, TIMEZONELIB_REV);
if(!TimezoneBase) {
amiga_open_lib_error(TIMEZONELIB_NAME, TIMEZONELIB_REV);
return 5;
}
return 0;
}