#include <stdio.h>
#include <fcntl.h>
#include <dlg/misc.h>

#include <link/io.h>

#include <proto/dos.h>
#include <proto/dlg.h>

extern char **SA;

BYTE CheckEditor(int number,int level)

{FILE         *fp;
 struct Editor editor;

 if (!number)  return(FALSE);

 if (!(fp=fopen("DLGCONFIG:Misc/Editors.bbs", "r")))
    {AFPrintf(NULL, Output(), SA[3409]);
     return(-1);
    }

 while(fread(&editor, sizeof(editor), 1, fp))
      {if (editor.number==number)
          {fclose(fp);
           if (editor.level > level)
               return(FALSE);
             else
               return(TRUE);
          }
      }

 fclose(fp);
 return(FALSE);
}
