/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#ifndef _PTFUN_H_
#define _PTFUN_H_

typedef void(*funcHandle)();
void ptfun_setHandle(funcHandle funptr);
funcHandle ptfun_getHandle();

/* below is added only for Ch */
#include <dlfcn.h>
void *_Chptfun_handle = dlopen("libptfun.dl", RTLD_LAZY);
if(_Chptfun_handle== NULL) {
   printf("Error: %s(): dlopen(): %s\n", __func__, dlerror());
   exit(-1);
} 

/* user-defined function which is called to close DLL 
   when the program exits */
void _dlclose_ptfun(void) {
   dlclose(_Chptfun_handle);
}
atexit(_dlclose_ptfun);

#pragma importf <ptfun.chf>
#endif /* _PTFUN_H_ */
