Changeset adc0a4 in git
- Timestamp:
- Jun 19, 2013, 3:43:25 PM (11 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 10b169a45a513bb611a4166d85796ae81990344d
- Parents:
- 593701c3d9a3d7851247b1e1603c209005e89f8e
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.am
r593701 radc0a4 78 78 minpoly.cc\ 79 79 misc_ip.cc\ 80 mod_lib.cc\ 80 81 links/ndbm.cc\ 81 82 newstruct.cc\ … … 136 137 misc_ip.h \ 137 138 mmalloc.h \ 139 mod_lib.h \ 138 140 omSingularConfig.h \ 139 141 links/ndbm.h \ -
Singular/iparith.cc
r593701 radc0a4 31 31 #include <polys/coeffrings.h> 32 32 #include <polys/sparsmat.h> 33 #include < polys/mod_raw.h>33 #include <Singular/mod_lib.h> 34 34 #include <polys/weight.h> 35 35 -
Singular/iplib.cc
r593701 radc0a4 60 60 short nToktype, short nPos); 61 61 62 #include < polys/mod_raw.h>62 #include <Singular/mod_lib.h> 63 63 64 64 #ifdef HAVE_LIBPARSER -
libpolys/polys/mod_raw.cc
r593701 radc0a4 36 36 #endif 37 37 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 38 #define BYTES_TO_CHECK 739 40 #define SI_BUILTIN_LIBSTR(name) (char*) #name ".so",41 42 char* si_builtin_libs[]={ SI_FOREACH_BUILTIN(SI_BUILTIN_LIBSTR) NULL };43 44 #undef SI_BUILTIN_LIBSTR45 46 lib_types type_of_LIB(char *newlib, char *libnamebuf)47 {48 const unsigned char mach_o[]={0xfe,0xed,0xfa,0xce,0};49 const unsigned char mach_O[]={0xce,0xfa,0xed,0xfe,0};50 51 const unsigned char mach_o64[]={0xfe,0xed,0xfa,0xcf,0};52 const unsigned char mach_O64[]={0xcf,0xfa,0xed,0xfe,0};53 54 int i=0;55 while(si_builtin_libs[i]!=NULL)56 {57 if (strcmp(newlib,si_builtin_libs[i])==0)58 {59 if(libnamebuf!=NULL) strcpy(libnamebuf,newlib);60 return LT_BUILTIN;61 }62 i++;63 }64 char buf[BYTES_TO_CHECK+1]; /* one extra for terminating '\0' */65 struct stat sb;66 int nbytes = 0;67 int ret;68 lib_types LT=LT_NONE;69 70 FILE * fp = feFopen( newlib, "r", libnamebuf, FALSE );71 72 do73 {74 ret = stat(libnamebuf, &sb);75 } while((ret < 0) and (errno == EINTR));76 77 if (fp==NULL)78 {79 return LT_NOTFOUND;80 }81 if((sb.st_mode & S_IFMT) != S_IFREG)82 {83 goto lib_type_end;84 }85 if ((nbytes = fread((char *)buf, sizeof(char), BYTES_TO_CHECK, fp)) == -1)86 {87 goto lib_type_end;88 /*NOTREACHED*/89 }90 if (nbytes == 0)91 goto lib_type_end;92 else93 {94 buf[nbytes++] = '\0'; /* null-terminate it */95 }96 if( (strncmp(buf, "\177ELF", 4)==0)) /* generic ELF */97 {98 LT = LT_ELF;99 //omFree(newlib);100 //newlib = omStrDup(libnamebuf);101 goto lib_type_end;102 }103 104 if( (strncmp(buf, (const char *)mach_o, 4)==0) || (strncmp(buf, (const char *)mach_O, 4)==0)) /* generic Mach-O module */105 {106 LT = LT_MACH_O;107 //omFree(newlib);108 //newlib = omStrDup(libnamebuf);109 goto lib_type_end;110 }111 112 if( (strncmp(buf, (const char *)mach_o64, 4)==0) || (strncmp(buf, (const char *)mach_O64, 4)==0)) /* generic Mach-O 64-bit module */113 {114 LT = LT_MACH_O;115 //omFree(newlib);116 //newlib = omStrDup(libnamebuf);117 goto lib_type_end;118 }119 120 121 if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0))122 {123 LT = LT_HPUX;124 //omFree(newlib);125 //newlib = omStrDup(libnamebuf);126 goto lib_type_end;127 }128 if(isprint(buf[0]) || buf[0]=='\n')129 { LT = LT_SINGULAR; goto lib_type_end; }130 131 lib_type_end:132 fclose(fp);133 return LT;134 }135 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/136 38 #if defined(HAVE_DL) 137 39 -
libpolys/polys/mod_raw.h
r593701 radc0a4 1 2 1 #ifndef MOD_RAW_H 3 2 #define MOD_RAW_H … … 17 16 typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O, LT_BUILTIN} lib_types; 18 17 19 lib_types type_of_LIB(char *newlib, char *fullname);20 18 21 19 #if defined(HAVE_DL) … … 44 42 45 43 46 #ifdef EMBED_PYTHON47 #define SI_BUILTIN_PYOBJECT(add) add(pyobject)48 #else49 #define SI_BUILTIN_PYOBJECT(add)50 #endif51 52 /// Data for @c type_of_LIB to determine built-in modules,53 /// use @c add(name) to add built-in library to macro54 #define SI_FOREACH_BUILTIN(add)\55 add(staticdemo)\56 SI_BUILTIN_PYOBJECT(add)57 58 #define SI_MOD_INIT(name) name##_mod_init59 60 44 #endif /* MOD_RAW_H */
Note: See TracChangeset
for help on using the changeset viewer.