Changeset 425 for WizardsToolkit/trunk

Show
Ignore:
Timestamp:
10/21/09 10:57:50 (5 weeks ago)
Author:
cristy
Message:
 
Location:
WizardsToolkit/trunk/wizard
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • WizardsToolkit/trunk/wizard/configure.c

    r1 r425  
    6161 
    6262/* 
     63  Typedef declarations. 
     64*/ 
     65typedef struct _ConfigureMapInfo 
     66{ 
     67  const char 
     68    *name, 
     69    *value; 
     70} ConfigureMapInfo; 
     71 
     72/* 
    6373  Static declarations. 
    6474*/ 
    65 static const char 
    66   *ConfigureMap = (char *) 
    67     "<?xml version=\"1.0\"?>" 
    68     "<configuremap>" 
    69     "  <configure stealth=\"True\" />" 
    70     "</configuremap>"; 
     75static const ConfigureMapInfo 
     76  ConfigureMap[] = 
     77  { 
     78  }; 
    7179 
    7280static LinkedListInfo 
     
    112120 
    113121  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    } 
    120131  p=(ConfigureInfo *) RelinquishWizardMemory(p); 
    121132  return((void *) NULL); 
     
    9891000    (void) ResetWizardMemory(configure_info,0,sizeof(*configure_info)); 
    9901001    configure_info->path=ConstantString(filename); 
     1002    configure_info->exempt=WizardFalse; 
    9911003    configure_info->signature=WizardSignature; 
    9921004    attribute=GetXMLTreeAttribute(configure,"name"); 
     
    10381050  ExceptionInfo *exception) 
    10391051{ 
    1040 #if defined(WIZARDSTOOLKIT_EMBEDDABLE_SUPPORT) 
    1041   return(LoadConfigureList(ConfigureMap,"built-in",0,exception)); 
    1042 #else 
    10431052  char 
    10441053    path[MaxTextExtent]; 
     
    10501059    *options; 
    10511060 
     1061  register long 
     1062    i; 
     1063 
    10521064  WizardStatusType 
    10531065    status; 
    10541066 
     1067  /* 
     1068    Load built-in configure map. 
     1069  */ 
    10551070  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  */ 
    10561111  *path='\0'; 
    10571112  options=GetConfigureOptions(filename,exception); 
     
    10651120  } 
    10661121  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     } 
    10741122  return(status != 0 ? WizardTrue : WizardFalse); 
    1075 #endif 
    1076 } 
     1123} 
  • WizardsToolkit/trunk/wizard/configure.h

    r1 r425  
    3333                                                                                 
    3434  WizardBooleanType 
     35    exempt, 
    3536    stealth; 
    3637