/*
 * TextField autoinit and autoterminate functions
 * for SAS/C 6.50 and up.
 *
 * If you just compile and link this into your application
 * then TextFieldBase and TextFieldClass will be
 * automatically initialized before main() is called.
 *
 * Your application will only need to use TextFieldClass
 * when calling NewObject() and include <proto/textfield.h>.
 *
 * This file now uses the new TEXTFIELD_NAME and TEXTFIELD_VER
 * defines from textfield.h.
 */

#include <exec/types.h>
#include <intuition/classes.h>
#include <gadgets/textfield.h>

#include <proto/exec.h>
#include <proto/textfield.h>

struct Library *TextFieldBase;
Class *TextFieldClass;

int _STI_200_TextFieldInit(void)
{
	TextFieldBase = OpenLibrary(TEXTFIELD_NAME, TEXTFIELD_VER);
	if (TextFieldBase) {
		TextFieldClass = TEXTFIELD_GetClass();
		return 0;
	} else {
		return 1;
	}
}

void _STD_200_TextFieldTerm(void)
{
	CloseLibrary(TextFieldBase);
	TextFieldClass = NULL;
	TextFieldBase = NULL;
}
