static int compile(blueprint *bp,char const *filename) { struct stat s; if (!createparts(bp)) return 0; if (!setnames(bp, ET_EXEC, filename)) return 0; if (!populateparts(bp, ET_EXEC, filename)) return 0; if (!outputelf(bp, outfilename)) { remove(outfilename); return 0; } if (!stat(outfilename, &s)) { if (bp->filetype == ET_EXEC) s.st_mode |= S_IXUSR | S_IXGRP | S_IXOTH; chmod(outfilename, s.st_mode); } return 1; }
/* main(). */ int main(int argc, char *argv[]) { readcmdline(argc, argv); measureobjects(); initpieces(); measurepieces(); pickfilenames(); outputelf(); outputheader(); return 0; }