#include <stdlib.h>
#include <string.h>
#include "extern.h"

/* rename & rewrite ｶｸﾆﾝ */
chgchk()
   {   int numd;
       char fcall[9];
       
       numd = atoi(cmdnum);
         if ( numd != 0 )
            { *(pfna) = NULL;
              if ( numd < 1000 &&  *(rtbl + numd) != NULL 
                   && *(rtbl + numd) != -1   ) 
              {    
		   makfname("MSG",*(rtbl + numd),pfna);
              }
            }
         
         if ( ! strlen(pfna))
            { sprintf(ssent,": ファイルＮｏ．を正しく指定して下さい\n");
              rsout();
              return(1);
            }
         
         fpw = fopen(pfna,"r");
         if ( fpw == NULL ) return(0);
         if ( fgets(fbuff,255,fpw) == NULL ) return(0);
         fclose(fpw);
         
         substr(fbuff,48,8,fcall);
         if ( strcmp(sigop,hiscall) )
            { if ( strcmp(fcall,hiscall) )
                 { sprintf(ssent,": %s が書きこんだファイルです。変更できません。\n\n",fcall);
                   rsout();
                   return(1);
                 }
            }
         
         strcpy(ssent,fbuff);
         rsout();
         
         strcpy(ynsent,": 変更 ");
         if ( y_or_n() )   return(1);
         return(0);
      }
