Changeset 6b32990 in git for Singular/silink.cc
- Timestamp:
- Dec 12, 2000, 9:44:55 AM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- de7793b9aaa39c2f00b6e30ee4ad5c82915497aa
- Parents:
- 52ea3f939ec0aa2915d2d6a747bab3976eb9bfb7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/silink.cc
r52ea3f r6b32990 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: silink.cc,v 1.3 7 2000-12-06 11:03:29 SingularExp $ */4 /* $Id: silink.cc,v 1.38 2000-12-12 08:44:52 obachman Exp $ */ 5 5 6 6 /* … … 35 35 static BOOLEAN DumpQring(FILE *fd, idhdl h, char *type_str); 36 36 static BOOLEAN DumpAsciiMaps(FILE *fd, idhdl h, idhdl rhdl); 37 static si_link_extension slTypeInit(si_link_extension s, const char* type); 37 38 38 39 /* ====================================================================== */ … … 83 84 { 84 85 si_link_extension s = si_link_root; 85 86 while (s != NULL && (strcmp(s->type, type) != 0)) s = s->next; 86 si_link_extension prev = s; 87 88 while (strcmp(s->type, type) != 0) 89 { 90 if (s->next == NULL) 91 { 92 prev = s; 93 s = NULL; 94 break; 95 } 96 else 97 { 98 s = s->next; 99 } 100 } 87 101 88 102 if (s != NULL) … … 90 104 else 91 105 { 92 Warn("Found unknown link type: %s", type); 93 Warn("Use default link type: %s", si_link_root->type); 94 l->m = si_link_root; 106 l->m = slTypeInit(prev, type); 95 107 } 96 108 omFree(type); … … 99 111 l->m = si_link_root; 100 112 113 if (l->m == NULL) return TRUE; 114 101 115 l->name = (name != NULL ? name : omStrDup("")); 102 116 l->mode = (mode != NULL ? mode : omStrDup("")); … … 809 823 /*------------Initialization at Start-up time------------------------*/ 810 824 825 #include "slInit.h" 826 827 static si_link_extension slTypeInit(si_link_extension s, const char* type) 828 { 829 assume(s != NULL); 830 s->next = NULL; 831 si_link_extension ns = (si_link_extension)omAlloc0Bin(s_si_link_extension_bin); 832 833 #ifdef HAVE_MPSR 834 if (strcmp(type, "MPfile") == 0) 835 s->next = slInitMPFileExtension(ns); 836 else if (strcmp(type, "MPtcp") == 0) 837 s->next = slInitMPTcpExtension(ns); 811 838 #ifdef HAVE_DBM 812 #include "sing_dbm.h" 813 #endif 814 815 #ifdef HAVE_MPSR 816 #include "sing_mp.h" 817 #endif 839 else 840 #endif 841 #endif 842 #ifdef HAVE_DBM 843 if (strcmp(type, "DBM") == 0) 844 s->next = slInitDBMExtension(ns); 845 #endif 846 #if defined(HAVE_DBM) || defined(HAVE_MPSR) 847 else 848 #endif 849 { 850 Warn("Found unknown link type: %s", type); 851 Warn("Use default link type: %s", si_link_root->type); 852 omFreeBin(ns, s_si_link_extension_bin); 853 return si_link_root; 854 } 855 856 if (s->next == NULL) 857 { 858 Werror("Can not initialize link type %s", type); 859 omFreeBin(ns, s_si_link_extension_bin); 860 return NULL; 861 } 862 return s->next; 863 } 818 864 819 865 void slStandardInit() … … 832 878 si_link_root->type="ASCII"; 833 879 s = si_link_root; 834 #ifdef HAVE_DBM 835 #ifndef HAVE_MODULE_DBM 836 s->next = (si_link_extension)omAlloc0Bin(s_si_link_extension_bin); 837 s = s->next; 838 slInitDBMExtension(s); 839 #endif 840 #endif 841 #ifdef HAVE_MPSR 842 s->next = (si_link_extension)omAlloc0Bin(s_si_link_extension_bin); 843 s = s->next; 844 slInitMPFileExtension(s); 845 s->next = (si_link_extension)omAlloc0Bin(s_si_link_extension_bin); 846 s = s->next; 847 slInitMPTcpExtension(s); 848 #endif 849 } 880 s->next = NULL; 881 }
Note: See TracChangeset
for help on using the changeset viewer.