14#define SI_BUILTIN_LIBSTR(name) (char*) #name ".so",
23#undef SI_BUILTIN_LIBSTR
25#define BYTES_TO_CHECK 7
29 const unsigned char mach_o[]={0xfe,0xed,0xfa,0xce,0};
30 const unsigned char mach_O[]={0xce,0xfa,0xed,0xfe,0};
32 const unsigned char mach_o64[]={0xfe,0xed,0xfa,0xcf,0};
33 const unsigned char mach_O64[]={0xcf,0xfa,0xed,0xfe,0};
35 const unsigned char mach_FAT[]={0xca,0xfe,0xba,0xbe,0};
36 const unsigned char mach_fat[]={0xbe,0xba,0xfe,0xca,0};
38 const unsigned char utf16be[]={0xfe,0xff,0};
39 const unsigned char utf16le[]={0xff,0xfe,0};
40 const unsigned char utf8ms[]={0xEF,0xBB,0xBF,0};
42 const unsigned char dll[]={
'M',
'Z',0};
64 }
while((ret < 0) and (errno == EINTR));
70 if((sb.st_mode & S_IFMT) != S_IFREG)
85 if( (strncmp(
buf,
"\177ELF", 4)==0))
93 if( (strncmp(
buf, (
const char *)mach_o, 4)==0) || (strncmp(
buf, (
const char *)mach_O, 4)==0))
101 if( (strncmp(
buf, (
const char *)mach_o64, 4)==0) || (strncmp(
buf, (
const char *)mach_O64, 4)==0))
109 if( (strncmp(
buf, (
const char *)mach_FAT, 4)==0) || (strncmp(
buf, (
const char *)mach_fat, 4)==0))
117 if( (strncmp(
buf,
"\02\020\01\016\05\022@", 7)==0))
124 if ((strncmp(
buf,(
const char *)utf16be,2)==0)
125 ||(strncmp(
buf,(
const char *)utf16le,2)==0))
127 WerrorS(
"UTF-16 not supported");
131 if (strncmp(
buf,(
const char *)utf8ms,3)==0)
133 WarnS(
"UTF-8 detected - may not work");
137 if (strncmp(
buf,(
const char *)dll,2)==0)
142 if(isprint(
buf[0]) ||
buf[0]==
'\n')
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
void WerrorS(const char *s)
VAR char libnamebuf[1024]
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
const char *const si_builtin_libs[]
#define SI_BUILTIN_LIBSTR(name)
#define SI_FOREACH_BUILTIN(add)
Data for type_of_LIB to determine built-in modules, use add(name) to add built-in library to macro.
int status int void * buf