#include "complex.h" #include "screen.h" //extern word_s fl_err_d; /*--------------- обpаботка кодов завеpшения ----------------------*/ void o_kz_f(word_s kz,char *ifl) /* обpаботка кода pаботы с файлом */ { if(kz==-1) { eprintf(RED_,"ОШ. файла %s, КЗ=%d",ifl,errno); } } void o_kz_al(char *kz) /* об аботка кода захвата памяти */ { eprintf(RED_," %s - Мало памяти",kz); } void r_write(word_s hn,char *buf,word_s dl,long ots,word_s orig, char *ifl,resourceptr res) { word_s kz; request_resource(res,0*HZ); lseek(hn,ots,orig); kz=write(hn,buf,dl); release_resource(res); o_kz_f(kz,ifl); } void r_lseek(word_s hn,long dl,word_s orig,resourceptr res) { request_resource(res,0*HZ); lseek(hn,dl,orig); release_resource(res); } void r_read (word_s hn,char *buf,word dl, long ots,word_s orig,resourceptr res) { request_resource(res,0*HZ); lseek(hn,ots,orig); read(hn,buf,dl); release_resource(res); } void r_close (word_s hn,resourceptr res) { request_resource(res,0*HZ); close(hn); release_resource(res); }