Application of LAPW and Green-function methods to calculation of electronic structure of crystal defects