/*=================================================================== Copyright (c) 2002,2003 Unigraphics Solutions Corporation Unpublished - All rights reserved ===================================================================*/ /****************************************************************************** * * * DESCRIPTION - * * This program shows how to use the following Open API routines: * * * * UF_DIEENG_create_dol_report_file * * * * PROGRAM DESCRIPTION - * * The following example requires an open part containing a DIE_LINEUP * * feature. * * * * This function will make a call to UF_DIEENG_create_dol_report_file. * * The result of this call will be the output of DOL information to a * * file called dol_report_file in the directory pointed to by the TMP * * system environment variable. * * * * * ******************************************************************************/ #include #include #include #include #include #define UF_CALL(X) (report( __FILE__, __LINE__, #X, (X))) static int report( const char *file, int line, const char *call, int irc) { if (irc) { char messg[133]; printf("%s, line %d: %s\n", file, line, call); (UF_get_fail_message(irc, messg)) ? printf(" returned a %d\n", irc) : printf(" returned error %d: %s\n", irc, messg); } return(irc); } static void do_ugopen_api(void) { UF_CALL(UF_DIEENG_create_dol_report_file("dol_report_file")); } /*ARGSUSED*/ void ufusr(char *param, int *retcode, int paramLen) { if (!UF_CALL(UF_initialize())) { do_ugopen_api(); UF_CALL(UF_terminate()); } } int ufusr_ask_unload(void) { return (UF_UNLOAD_IMMEDIATELY); }