#include
/* for SIOUX */
SIOUXSettings.standalone = FALSE;
SIOUXSettings.setupmenus = FALSE;
SIOUXSettings.initializeTB = FALSE;
SIOUXSettings.autocloseonquit = FALSE;
SIOUXSettings.asktosaveonclose = TRUE;
SIOUXSettings.showstatusline = TRUE;
SIOUXSettings.toppixel = 40;
SIOUXSettings.leftpixel = 5;
#ifdef __POWERPC__
#Include "mac_specific.h"
#endif
#ifdef __POWERPC__
showcaution(CtoPstr(str), "\p", "\p", "\p");
#else
fprintf ( stderr, "%s\n", str );
#endif
#ifdef __POWERPC__
showstop(CtoPstr(str), "\p", "\p", "\p");
#else
fprintf ( stderr, "%s\n", str );
#endif
#ifdef __POWERPC__
sprintf(message,"cannot open %s at open_w_env in fileutil.c \n", f_name);
fatal_error(message);
#else
#ifdef __POWERPC
sprintf(wstr,"unable to open file %s as output\n",file_name);
fatal_error(wstr);
#else
printf("unable to open file %s as output\n",file_name);
#endif
#ifdef __POWERPC__
sprintf(wstr,"ERROR: Unknown atom number --> %d\n", atnum);
show_warning(wstr);
#else
fprintf(stderr, "ERROR: Unknown atom number --> %d\n", atnum);
#endif
#ifdef __POWERPC__
sprintf(wstr, "Could not open element file element.lis \n Please put into the application folder\n");
show_warning(wstr);
return(0);
#else /* __POWERPC__ */.....
print_torsions(,print_angles(ums_type *mol,FILE *file1)
#ifdef __POWERPC__
sprintf(wstr, "Memory Allocation Error\n");
fatal_error(wstr);
#else
printf("Memory Allocation Error\n");
#endif
#ifdef __POWERPC__
sprintf(wstr, "Unable to allocate memory for temporary ums\n");
fatal_error(wstr);
#else
fprintf(stderr,"Unable to allocate memory for temporary ums\n");
#endif
#ifdef __POWERPC__
sprintf(wstr, "Unable to allocate memory for temporary ums\n");
fatal_error(wstr);
#else
fprintf(stderr,"Unable to allocate memory for temporary ums\n");
#endif
#ifdef __POWERPC __
sprintf(wstr, "No memory to convert SMILES string\n");
show_warning(wstr);
#else
printf("No memory to convert SMILES string\n");
#endif
#ifdef __POWERPC__
sprintf(wstr, "UNABLE TO ALLOCATE MEMORY");
fatal_error(wstr);
#else
printf("UNABLE TO ALLOCATE MEMORY");
#endif
#ifdef __POWERPC__
sprintf(wstr, "Unable to create smiles string\n");
show_warning(wstr);
#else
printf("Unable to create smiles string\n");
#endif
#ifdef __POWERPC__
sprintf(wstr, "OUT OF MEMORY AT %s %s \n",__FILE__,__LINE__);
fatal_error(wstr);
#else
printf("OUT OF MEMORY AT %s %s \n",__FILE__,__LINE__);
#endif
print_torsion_list()
#ifdef __POWERPC__
sprintf(wstr,"Memory Allocation Error at %s %s \n",__FILE__,__LINE__);
fatal_error(wstr);
#else
printf("Memory Allocation Error at %s %s \n",__FILE__,__LINE__);
#endif
utils.c中のメモリ関係のエラーは、同様の書き換えを行った。コンパイルすると、wstrが無いといわれたので、static char wstr[BUFF_SIZE];を各ファイルの先頭に追加した。
これで、エラーが出ても、表示が乱れたりせずにちゃんとユーザに通知することができるようになった。