Changeset 425 for WizardsToolkit/trunk
- Timestamp:
- 10/21/09 10:57:50 (5 weeks ago)
- Location:
- WizardsToolkit/trunk/wizard
- Files:
-
- 2 modified
-
configure.c (modified) (6 diffs)
-
configure.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
WizardsToolkit/trunk/wizard/configure.c
r1 r425 61 61 62 62 /* 63 Typedef declarations. 64 */ 65 typedef struct _ConfigureMapInfo 66 { 67 const char 68 *name, 69 *value; 70 } ConfigureMapInfo; 71 72 /* 63 73 Static declarations. 64 74 */ 65 static const char 66 *ConfigureMap = (char *) 67 "<?xml version=\"1.0\"?>" 68 "<configuremap>" 69 " <configure stealth=\"True\" />" 70 "</configuremap>"; 75 static const ConfigureMapInfo 76 ConfigureMap[] = 77 { 78 }; 71 79 72 80 static LinkedListInfo … … 112 120 113 121 p=(ConfigureInfo *) configure_info; 114 if (p->path != (char *) NULL) 115 p->path=(char *) RelinquishWizardMemory(p->path); 116 if (p->name != (char *) NULL) 117 p->name=(char *) RelinquishWizardMemory(p->name); 118 if (p->value != (char *) NULL) 119 p->value=(char *) RelinquishWizardMemory(p->value); 122 if (p->exempt == WizardFalse) 123 { 124 if (p->value != (char *) NULL) 125 p->value=(char *) RelinquishWizardMemory(p->value); 126 if (p->name != (char *) NULL) 127 p->name=(char *) RelinquishWizardMemory(p->name); 128 if (p->path != (char *) NULL) 129 p->path=(char *) RelinquishWizardMemory(p->path); 130 } 120 131 p=(ConfigureInfo *) RelinquishWizardMemory(p); 121 132 return((void *) NULL); … … 989 1000 (void) ResetWizardMemory(configure_info,0,sizeof(*configure_info)); 990 1001 configure_info->path=ConstantString(filename); 1002 configure_info->exempt=WizardFalse; 991 1003 configure_info->signature=WizardSignature; 992 1004 attribute=GetXMLTreeAttribute(configure,"name"); … … 1038 1050 ExceptionInfo *exception) 1039 1051 { 1040 #if defined(WIZARDSTOOLKIT_EMBEDDABLE_SUPPORT)1041 return(LoadConfigureList(ConfigureMap,"built-in",0,exception));1042 #else1043 1052 char 1044 1053 path[MaxTextExtent]; … … 1050 1059 *options; 1051 1060 1061 register long 1062 i; 1063 1052 1064 WizardStatusType 1053 1065 status; 1054 1066 1067 /* 1068 Load built-in configure map. 1069 */ 1055 1070 status=WizardFalse; 1071 if (configure_list == (LinkedListInfo *) NULL) 1072 { 1073 configure_list=NewLinkedList(0); 1074 if (configure_list == (LinkedListInfo *) NULL) 1075 { 1076 ThrowFileException(exception,FileError,filename); 1077 return(WizardFalse); 1078 } 1079 } 1080 for (i=0; i < (long) (sizeof(ConfigureMap)/sizeof(*ConfigureMap)); i++) 1081 { 1082 ConfigureInfo 1083 *configure_info; 1084 1085 register const ConfigureMapInfo 1086 *p; 1087 1088 p=ConfigureMap+i; 1089 configure_info=(ConfigureInfo *) AcquireWizardMemory( 1090 sizeof(*configure_info)); 1091 if (configure_info == (ConfigureInfo *) NULL) 1092 { 1093 (void) ThrowWizardException(exception,GetWizardModule(),ResourceError, 1094 "memory allocation failed `%s'",strerror(errno)); 1095 continue; 1096 } 1097 (void) ResetWizardMemory(configure_info,0,sizeof(*configure_info)); 1098 configure_info->path=(char *) "[built-in]"; 1099 configure_info->name=(char *) p->name; 1100 configure_info->value=(char *) p->value; 1101 configure_info->exempt=WizardTrue; 1102 configure_info->signature=WizardSignature; 1103 status=AppendValueToLinkedList(configure_list,configure_info); 1104 if (status == WizardFalse) 1105 (void) ThrowWizardException(exception,GetWizardModule(),ResourceError, 1106 "memory allocation failed `%s'",strerror(errno)); 1107 } 1108 /* 1109 Load external configure map. 1110 */ 1056 1111 *path='\0'; 1057 1112 options=GetConfigureOptions(filename,exception); … … 1065 1120 } 1066 1121 options=DestroyConfigureOptions(options); 1067 if ((configure_list == (LinkedListInfo *) NULL) ||1068 (IsLinkedListEmpty(configure_list) != WizardFalse))1069 {1070 (void) ThrowWizardException(exception,GetWizardModule(),ConfigureWarning,1071 "unable to open configure file `%s'",path);1072 status|=LoadConfigureList(ConfigureMap,"built-in",0,exception);1073 }1074 1122 return(status != 0 ? WizardTrue : WizardFalse); 1075 #endif 1076 } 1123 } -
WizardsToolkit/trunk/wizard/configure.h
r1 r425 33 33 34 34 WizardBooleanType 35 exempt, 35 36 stealth; 36 37
