3 #include "checkIsModifiedFlag.h"
22 std::ofstream f(name.c_str(), std::ios_base::out|std::ios_base::binary|std::ios_base::trunc);
23 ROSE_ASSERT(f.is_open());
24 f.exceptions(std::ios::badbit | std::ios::failbit);
46 std::vector<DataConverter*> converters;
47 converters.push_back(NULL);
48 converters.push_back(
new Rot13);
51 for (
size_t ci=0; !ef && ci<converters.size(); ci++) {
54 converters[ci] = NULL;
61 dos_hdr->
parse(
false);
96 for (
size_t ci=0; ci<converters.size(); ci++)
97 delete converters[ci];
111 #pragma message ("WARNING: Commented out use of functions from sys/wait.h")
112 printf (
"ERROR: Commented out use of functions from sys/wait.h \n");
119 dup2(child_stdout[1], 1);
120 close(child_stdout[0]);
121 close(child_stdout[1]);
122 execlp(
"file",
"file",
"-b", name, NULL);
126 memset(buf, 0,
sizeof buf);
127 read(child_stdout[0], buf,
sizeof buf);
128 buf[
sizeof(buf)-1] =
'\0';
129 if (
char *nl = strchr(buf,
'\n')) *nl =
'\0';
130 waitpid(pid, NULL, 0);
131 char mesg[64+
sizeof buf];
132 sprintf(mesg,
"unrecognized file format: %s", buf);
152 void visit(
SgNode *node) {
188 return "Other Family";
194 snprintf(buf,
sizeof(buf),
"unknown isa family (%zu)",
size_t(isa & ISA_FAMILY_MASK)) ;
381 snprintf(buf,
sizeof(buf),
"unknown isa (%zu)",
size_t(isa)) ;
390 case FAMILY_ELF:
return "Executable and Linking Format (ELF)";
391 case FAMILY_LE:
return "Microsoft Linear Executable (LE)";
392 case FAMILY_LX:
return "OS/2 Extended Linear Executable (LX)";
393 case FAMILY_NE:
return "Microsoft New Executable (NE)";
394 case FAMILY_PE:
return "Microsoft Portable Executable (PE)";
397 snprintf(buf,
sizeof(buf),
"unknown exec family (%zu)",
size_t(family)) ;
408 case ABI_ARM:
return "ARM architecture";
417 case ABI_NT:
return "Windows NT";
422 case ABI_TRU64:
return "Compaq TRU64 UNIX";
426 snprintf(buf,
sizeof(buf),
"unknown abi (%zu)",
size_t(abi)) ;
442 snprintf(buf,
sizeof(buf),
"unknown exec purpose (%zu)",
size_t(purpose)) ;