|
|
fwmaker embedded image maker
#include "global.h" #include "image.h" int imageOpen(int flags) { ETRACE(); imgfd = open(image, O_RDWR | flags, 0644); if (imgfd == -1) { ESYSERR(0); return -1; } else imgsiz = lseek(imgfd, 0, SEEK_END); EVERBOSE(1, "Image open #%d", imgfd); return imgfd; } void imageClose() { ETRACE(); if (imgfd > 2) { EVERBOSE(1, "Image close #%d", imgfd); close(imgfd); imgfd ^= imgfd; imgsiz ^= imgsiz; } }