Changeset 445 for WizardsToolkit/trunk

Show
Ignore:
Timestamp:
10/24/09 14:26:18 (4 weeks ago)
Author:
cristy
Message:
 
Location:
WizardsToolkit/trunk/wizard
Files:
12 modified

Legend:

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

    r428 r445  
    235235    } 
    236236  RelinquishSemaphoreInfo(log_semaphore); 
    237 } 
    238  
    239 /* 
    240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    241 %                                                                             % 
    242 %                                                                             % 
    243 %                                                                             % 
    244 +   D e s t r o y L o g C o m p o n e n t                                     % 
    245 %                                                                             % 
    246 %                                                                             % 
    247 %                                                                             % 
    248 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    249 % 
    250 %  DestroyLogComponent() destroys the log component. 
    251 % 
    252 %  The format of the DestroyLogComponent method is: 
    253 % 
    254 %      DestroyLogComponent(void) 
    255 % 
    256 */ 
    257  
    258 static void *DestroyLogElement(void *log_info) 
    259 { 
    260   register LogInfo 
    261     *p; 
    262  
    263   p=(LogInfo *) log_info; 
    264   if (p->file != (FILE *) NULL) 
    265     { 
    266       if (p->append == WizardFalse) 
    267         (void) fprintf(p->file,"</log>\n"); 
    268       (void) fclose(p->file); 
    269       p->file=(FILE *) NULL; 
    270     } 
    271   if (p->exempt == WizardFalse) 
    272     { 
    273       if (p->format != (char *) NULL) 
    274         p->format=DestroyString(p->format); 
    275       if (p->filename != (char *) NULL) 
    276         p->filename=DestroyString(p->filename); 
    277       if (p->path != (char *) NULL) 
    278         p->path=DestroyString(p->path); 
    279     } 
    280   if (p->timer != (TimerInfo *) NULL) 
    281     p->timer=DestroyTimerInfo(p->timer); 
    282   p=(LogInfo *) RelinquishWizardMemory(p); 
    283   return((void *) NULL); 
    284 } 
    285  
    286 WizardExport void DestroyLogComponent(void) 
    287 { 
    288   AcquireSemaphoreInfo(&log_semaphore); 
    289   if (log_list != (LinkedListInfo *) NULL) 
    290     log_list=DestroyLinkedList(log_list,DestroyLogElement); 
    291   instantiate_log=WizardFalse; 
    292   RelinquishSemaphoreInfo(log_semaphore); 
    293   DestroySemaphoreInfo(&log_semaphore); 
    294237} 
    295238 
     
    609552%                                                                             % 
    610553%                                                                             % 
    611 +   I n s t a n t i a t e L o g C o m p o n e n t                             % 
    612 %                                                                             % 
    613 %                                                                             % 
    614 %                                                                             % 
    615 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    616 % 
    617 %  InstantiateLogComponent() instantiates the log component. 
    618 % 
    619 %  The format of the InstantiateLogComponent method is: 
    620 % 
    621 %      WizardBooleanType InstantiateLogComponent(void) 
    622 % 
    623 */ 
    624 WizardExport WizardBooleanType InstantiateLogComponent(void) 
    625 { 
    626   AcquireSemaphoreInfo(&log_semaphore); 
    627   RelinquishSemaphoreInfo(log_semaphore); 
    628   return(WizardFalse); 
    629 } 
    630  
    631 /* 
    632 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    633 %                                                                             % 
    634 %                                                                             % 
    635 %                                                                             % 
    636554%  I s E v e n t L o g g i n g                                                % 
    637555%                                                                             % 
     
    747665  log_info=(const LogInfo **) RelinquishWizardMemory((void *) log_info); 
    748666  return(WizardTrue); 
     667} 
     668 
     669/* 
     670%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     671%                                                                             % 
     672%                                                                             % 
     673%                                                                             % 
     674+   L o g C o m p o n e n t G e n e s i s                                     % 
     675%                                                                             % 
     676%                                                                             % 
     677%                                                                             % 
     678%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     679% 
     680%  LogComponentGenesis() instantiates the log component. 
     681% 
     682%  The format of the LogComponentGenesis method is: 
     683% 
     684%      WizardBooleanType LogComponentGenesis(void) 
     685% 
     686*/ 
     687WizardExport WizardBooleanType LogComponentGenesis(void) 
     688{ 
     689  AcquireSemaphoreInfo(&log_semaphore); 
     690  RelinquishSemaphoreInfo(log_semaphore); 
     691  return(WizardTrue); 
     692} 
     693 
     694/* 
     695%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     696%                                                                             % 
     697%                                                                             % 
     698%                                                                             % 
     699+   L o g C o m p o n e n t T e r m i n u s                                   % 
     700%                                                                             % 
     701%                                                                             % 
     702%                                                                             % 
     703%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     704% 
     705%  LogComponentTerminus() destroys the log component. 
     706% 
     707%  The format of the LogComponentTerminus method is: 
     708% 
     709%      LogComponentTerminus(void) 
     710% 
     711*/ 
     712 
     713static void *DestroyLogElement(void *log_info) 
     714{ 
     715  register LogInfo 
     716    *p; 
     717 
     718  p=(LogInfo *) log_info; 
     719  if (p->file != (FILE *) NULL) 
     720    { 
     721      if (p->append == WizardFalse) 
     722        (void) fprintf(p->file,"</log>\n"); 
     723      (void) fclose(p->file); 
     724      p->file=(FILE *) NULL; 
     725    } 
     726  if (p->exempt == WizardFalse) 
     727    { 
     728      if (p->format != (char *) NULL) 
     729        p->format=DestroyString(p->format); 
     730      if (p->filename != (char *) NULL) 
     731        p->filename=DestroyString(p->filename); 
     732      if (p->path != (char *) NULL) 
     733        p->path=DestroyString(p->path); 
     734    } 
     735  if (p->timer != (TimerInfo *) NULL) 
     736    p->timer=DestroyTimerInfo(p->timer); 
     737  p=(LogInfo *) RelinquishWizardMemory(p); 
     738  return((void *) NULL); 
     739} 
     740 
     741WizardExport void LogComponentTerminus(void) 
     742{ 
     743  AcquireSemaphoreInfo(&log_semaphore); 
     744  if (log_list != (LinkedListInfo *) NULL) 
     745    log_list=DestroyLinkedList(log_list,DestroyLogElement); 
     746  instantiate_log=WizardFalse; 
     747  RelinquishSemaphoreInfo(log_semaphore); 
     748  DestroySemaphoreInfo(&log_semaphore); 
    749749} 
    750750 
  • WizardsToolkit/trunk/wizard/log.h

    r415 r445  
    6868 
    6969extern WizardExport WizardBooleanType 
    70   InstantiateLogComponent(void), 
    7170  IsEventLogging(void), 
    7271  ListLogInfo(FILE *,ExceptionInfo *), 
     72  LogComponentGenesis(void), 
    7373  LogWizardEvent(const LogEventType,const char *,const char *, 
    7474    const unsigned long,const char *,...)  
     
    8080extern WizardExport void 
    8181  CloseWizardLog(void), 
    82   DestroyLogComponent(void), 
     82  LogComponentTerminus(void), 
    8383  SetLogFormat(const char *), 
    8484  SetLogPreamble(const char *); 
  • WizardsToolkit/trunk/wizard/mime.c

    r415 r445  
    126126static WizardBooleanType 
    127127  InitializeMimeList(ExceptionInfo *); 
    128  
    129 /* 
    130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    131 %                                                                             % 
    132 %                                                                             % 
    133 %                                                                             % 
    134 +   D e s t r o y M i m e C o m p o n e n t                                   % 
    135 %                                                                             % 
    136 %                                                                             % 
    137 %                                                                             % 
    138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    139 % 
    140 %  DestroyMimeComponent() destroys the mime component. 
    141 % 
    142 %  The format of the DestroyMimeComponent method is: 
    143 % 
    144 %      DestroyMimeComponent(void) 
    145 % 
    146 */ 
    147  
    148 static void *DestroyMimeElement(void *mime_info) 
    149 { 
    150   register MimeInfo 
    151     *p; 
    152  
    153   p=(MimeInfo *) mime_info; 
    154   if (p->magic != (unsigned char *) NULL) 
    155     p->magic=(unsigned char *) RelinquishWizardMemory(p->magic); 
    156   if (p->pattern != (char *) NULL) 
    157     p->pattern=DestroyString(p->pattern); 
    158   if (p->description != (char *) NULL) 
    159     p->description=DestroyString(p->description); 
    160   if (p->type != (char *) NULL) 
    161     p->type=DestroyString(p->type); 
    162   if (p->path != (char *) NULL) 
    163     p->path=DestroyString(p->path); 
    164   p=(MimeInfo *) RelinquishWizardMemory(p); 
    165   return((void *) NULL); 
    166 } 
    167  
    168 WizardExport void DestroyMimeComponent(void) 
    169 { 
    170   AcquireSemaphoreInfo(&mime_semaphore); 
    171   if (mime_list != (LinkedListInfo *) NULL) 
    172     mime_list=DestroyLinkedList(mime_list,DestroyMimeElement); 
    173   instantiate_mime=WizardFalse; 
    174   RelinquishSemaphoreInfo(mime_semaphore); 
    175   DestroySemaphoreInfo(&mime_semaphore); 
    176 } 
    177128 
    178129/* 
     
    671622%                                                                             % 
    672623%                                                                             % 
    673 +   I n s t a n t i a t e M i m e C o m p o n e n t                           % 
    674 %                                                                             % 
    675 %                                                                             % 
    676 %                                                                             % 
    677 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    678 % 
    679 %  InstantiateMimeComponent() instantiates the mime component. 
    680 % 
    681 %  The format of the InstantiateMimeComponent method is: 
    682 % 
    683 %      WizardBooleanType InstantiateMimeComponent(void) 
    684 % 
    685 */ 
    686 WizardExport WizardBooleanType InstantiateMimeComponent(void) 
    687 { 
    688   AcquireSemaphoreInfo(&mime_semaphore); 
    689   RelinquishSemaphoreInfo(mime_semaphore); 
    690   return(WizardTrue); 
    691 } 
    692  
    693 /* 
    694 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    695 %                                                                             % 
    696 %                                                                             % 
    697 %                                                                             % 
    698624%  L i s t M i m e I n f o                                                    % 
    699625%                                                                             % 
     
    1057983%                                                                             % 
    1058984%                                                                             % 
     985+   M i m e C o m p o n e n t G e n e s i s                                   % 
     986%                                                                             % 
     987%                                                                             % 
     988%                                                                             % 
     989%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     990% 
     991%  MimeComponentGenesis() instantiates the mime component. 
     992% 
     993%  The format of the MimeComponentGenesis method is: 
     994% 
     995%      WizardBooleanType MimeComponentGenesis(void) 
     996% 
     997*/ 
     998WizardExport WizardBooleanType MimeComponentGenesis(void) 
     999{ 
     1000  AcquireSemaphoreInfo(&mime_semaphore); 
     1001  RelinquishSemaphoreInfo(mime_semaphore); 
     1002  return(WizardTrue); 
     1003} 
     1004 
     1005/* 
     1006%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     1007%                                                                             % 
     1008%                                                                             % 
     1009%                                                                             % 
     1010+   M i m e C o m p o n e n t T e r m i n u s                                 % 
     1011%                                                                             % 
     1012%                                                                             % 
     1013%                                                                             % 
     1014%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     1015% 
     1016%  MimeComponentTerminus() destroys the mime component. 
     1017% 
     1018%  The format of the MimeComponentTerminus method is: 
     1019% 
     1020%      MimeComponentTerminus(void) 
     1021% 
     1022*/ 
     1023 
     1024static void *DestroyMimeElement(void *mime_info) 
     1025{ 
     1026  register MimeInfo 
     1027    *p; 
     1028 
     1029  p=(MimeInfo *) mime_info; 
     1030  if (p->magic != (unsigned char *) NULL) 
     1031    p->magic=(unsigned char *) RelinquishWizardMemory(p->magic); 
     1032  if (p->pattern != (char *) NULL) 
     1033    p->pattern=DestroyString(p->pattern); 
     1034  if (p->description != (char *) NULL) 
     1035    p->description=DestroyString(p->description); 
     1036  if (p->type != (char *) NULL) 
     1037    p->type=DestroyString(p->type); 
     1038  if (p->path != (char *) NULL) 
     1039    p->path=DestroyString(p->path); 
     1040  p=(MimeInfo *) RelinquishWizardMemory(p); 
     1041  return((void *) NULL); 
     1042} 
     1043 
     1044WizardExport void MimeComponentTerminus(void) 
     1045{ 
     1046  AcquireSemaphoreInfo(&mime_semaphore); 
     1047  if (mime_list != (LinkedListInfo *) NULL) 
     1048    mime_list=DestroyLinkedList(mime_list,DestroyMimeElement); 
     1049  instantiate_mime=WizardFalse; 
     1050  RelinquishSemaphoreInfo(mime_semaphore); 
     1051  DestroySemaphoreInfo(&mime_semaphore); 
     1052} 
     1053 
     1054/* 
     1055%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     1056%                                                                             % 
     1057%                                                                             % 
     1058%                                                                             % 
    10591059+  W i z a r d T o M i m e                                                    % 
    10601060%                                                                             % 
  • WizardsToolkit/trunk/wizard/mime.h

    r415 r445  
    3535 
    3636extern WizardExport WizardBooleanType 
    37   InstantiateMimeComponent(void), 
    3837  ListMimeInfo(FILE *,ExceptionInfo *), 
    39   LoadMimeLists(const char *,ExceptionInfo *); 
     38  LoadMimeLists(const char *,ExceptionInfo *), 
     39  MimeComponentGenesis(void); 
    4040 
    4141extern WizardExport const MimeInfo 
     
    4444 
    4545extern WizardExport void 
    46   DestroyMimeComponent(void); 
     46  MimeComponentTerminus(void); 
    4747 
    4848#if defined(__cplusplus) || defined(c_plusplus) 
  • WizardsToolkit/trunk/wizard/nt-base.c

    r415 r445  
    330330static BOOL ControlHandler(DWORD type) 
    331331{ 
    332   AsynchronousDestroyResourceComponent(); 
     332  AsynchronousResourceComponentTerminus(); 
    333333  return(FALSE); 
    334334} 
  • WizardsToolkit/trunk/wizard/random.c

    r415 r445  
    299299  random_info=(RandomInfo *) RelinquishWizardMemory(random_info); 
    300300  return(random_info); 
    301 } 
    302  
    303 /* 
    304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    305 %                                                                             % 
    306 %                                                                             % 
    307 %                                                                             % 
    308 +   D e s t r o y R a n d o m C o m p o n e n t                               % 
    309 %                                                                             % 
    310 %                                                                             % 
    311 %                                                                             % 
    312 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    313 % 
    314 %  DestroyRandomComponent() destroys the random component. 
    315 % 
    316 %  The format of the DestroyRandomComponent method is: 
    317 % 
    318 %      DestroyRandomComponent(void) 
    319 % 
    320 */ 
    321 WizardExport void DestroyRandomComponent(void) 
    322 { 
    323   AcquireSemaphoreInfo(&random_semaphore); 
    324   RelinquishSemaphoreInfo(random_semaphore); 
    325   DestroySemaphoreInfo(&random_semaphore); 
    326301} 
    327302 
     
    775750%                                                                             % 
    776751%                                                                             % 
    777 +   I n s t a n t i a t e R a n d o m C o m p o n e n t                       % 
    778 %                                                                             % 
    779 %                                                                             % 
    780 %                                                                             % 
    781 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    782 % 
    783 %  InstantiateRandomComponent() instantiates the random component. 
    784 % 
    785 %  The format of the InstantiateRandomComponent method is: 
    786 % 
    787 %      InstantiateRandomComponent(void) 
    788 % 
    789 */ 
    790 WizardExport WizardBooleanType InstantiateRandomComponent(void) 
    791 { 
    792   AcquireSemaphoreInfo(&random_semaphore); 
    793   RelinquishSemaphoreInfo(random_semaphore); 
    794   return(WizardTrue); 
    795 } 
    796  
    797 /* 
    798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    799 %                                                                             % 
    800 %                                                                             % 
    801 %                                                                             % 
    802752%   G e t P s e u d o R a n d o m V a l u e                                   % 
    803753%                                                                             % 
     
    906856  } while (key == range); 
    907857  return((double) key/range); 
     858} 
     859 
     860/* 
     861%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     862%                                                                             % 
     863%                                                                             % 
     864%                                                                             % 
     865+   R a n d o m C o m p o n e n t G e n e s i s                               % 
     866%                                                                             % 
     867%                                                                             % 
     868%                                                                             % 
     869%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     870% 
     871%  RandomComponentGenesis() instantiates the random component. 
     872% 
     873%  The format of the RandomComponentGenesis method is: 
     874% 
     875%      RandomComponentGenesis(void) 
     876% 
     877*/ 
     878WizardExport WizardBooleanType RandomComponentGenesis(void) 
     879{ 
     880  AcquireSemaphoreInfo(&random_semaphore); 
     881  RelinquishSemaphoreInfo(random_semaphore); 
     882  return(WizardTrue); 
     883} 
     884 
     885/* 
     886%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     887%                                                                             % 
     888%                                                                             % 
     889%                                                                             % 
     890+   R a n d o m C o m p o n e n t T e r m i n u s                             % 
     891%                                                                             % 
     892%                                                                             % 
     893%                                                                             % 
     894%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     895% 
     896%  RandomComponentTerminus() destroys the random component. 
     897% 
     898%  The format of the RandomComponentTerminus method is: 
     899% 
     900%      RandomComponentTerminus(void) 
     901% 
     902*/ 
     903WizardExport void RandomComponentTerminus(void) 
     904{ 
     905  AcquireSemaphoreInfo(&random_semaphore); 
     906  RelinquishSemaphoreInfo(random_semaphore); 
     907  DestroySemaphoreInfo(&random_semaphore); 
    908908} 
    909909 
  • WizardsToolkit/trunk/wizard/random_.h

    r415 r445  
    4646 
    4747extern WizardExport void 
    48   DestroyRandomComponent(void), 
     48  RandomComponentTerminus(void), 
    4949  SeedPseudoRandomGenerator(const unsigned long), 
    5050  SetRandomKey(RandomInfo *,const size_t,unsigned char *), 
     
    5252 
    5353extern WizardExport WizardBooleanType 
    54   InstantiateRandomComponent(void); 
     54  RandomComponentGenesis(void); 
    5555 
    5656#if defined(__cplusplus) || defined(c_plusplus) 
  • WizardsToolkit/trunk/wizard/resource.c

    r419 r445  
    449449%                                                                             % 
    450450%                                                                             % 
    451 +   A s y n c h r o n o u s D e s t r o y R e s o u r c e C o m p o n e n t  % 
    452 %                                                                             % 
    453 %                                                                             % 
    454 %                                                                             % 
    455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    456 % 
    457 %  AsynchronousDestroyResourceComponent() destroys the resource environment. 
    458 %  It differs from DestroyResourceComponent() in that it can be called from a 
     451+   A s y n c h r o n o u s R e s o u r c e C o m p o n e n t T e r m i n u s % 
     452%                                                                             % 
     453%                                                                             % 
     454%                                                                             % 
     455%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     456% 
     457%  AsynchronousResourceComponentTerminus() destroys the resource environment. 
     458%  It differs from ResourceComponentTerminus() in that it can be called from a 
    459459%  asynchronous signal handler. 
    460460% 
    461 %  The format of the DestroyResourceComponent() method is: 
    462 % 
    463 %      DestroyResourceComponent(void) 
    464 % 
    465 */ 
    466 WizardExport void AsynchronousDestroyResourceComponent(void) 
     461%  The format of the ResourceComponentTerminus() method is: 
     462% 
     463%      ResourceComponentTerminus(void) 
     464% 
     465*/ 
     466WizardExport void AsynchronousResourceComponentTerminus(void) 
    467467{ 
    468468  const char 
     
    490490%                                                                             % 
    491491%                                                                             % 
    492 +   D e s t r o y R e s o u r c e C o m p o n e n t                           % 
    493 %                                                                             % 
    494 %                                                                             % 
    495 %                                                                             % 
    496 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    497 % 
    498 %  DestroyResourceComponent() destroys the resource component. 
    499 % 
    500 %  The format of the DestroyResourceComponent() method is: 
    501 % 
    502 %      DestroyResourceComponent(void) 
    503 % 
    504 */ 
    505 WizardExport void DestroyResourceComponent(void) 
    506 { 
    507   AcquireSemaphoreInfo(&resource_semaphore); 
    508   if (temporary_resources != (SplayTreeInfo *) NULL) 
    509     temporary_resources=DestroySplayTree(temporary_resources); 
    510   RelinquishSemaphoreInfo(resource_semaphore); 
    511   DestroySemaphoreInfo(&resource_semaphore); 
    512 } 
    513  
    514 /* 
    515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    516 %                                                                             % 
    517 %                                                                             % 
    518 %                                                                             % 
    519492%   G e t W i z a r d R e s o u r c e                                         % 
    520493%                                                                             % 
     
    643616%                                                                             % 
    644617%                                                                             % 
    645 +   I n s t a n t i a t e R e s o u r c e C o m p o n e n t                   % 
    646 %                                                                             % 
    647 %                                                                             % 
    648 %                                                                             % 
    649 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    650 % 
    651 %  InstantiateResourceComponent() instantiates the resource component. 
    652 % 
    653 %  The format of the InstantiateResourceComponent method is: 
    654 % 
    655 %      WizardBooleanType InstantiateResourceComponent(void) 
     618%  L i s t W i z a r d R e s o u r c e I n f o                                % 
     619%                                                                             % 
     620%                                                                             % 
     621%                                                                             % 
     622%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     623% 
     624%  ListWizardResourceInfo() lists the resource info to a file. 
     625% 
     626%  The format of the ListWizardResourceInfo method is: 
     627% 
     628%      WizardBooleanType ListWizardResourceInfo(FILE *file, 
     629%        ExceptionInfo *exception) 
     630% 
     631%  A description of each parameter follows. 
     632% 
     633%    o file:  An pointer to a FILE. 
     634% 
     635%    o exception: Return any errors or warnings in this structure. 
     636% 
     637*/ 
     638WizardExport WizardBooleanType ListWizardResourceInfo(FILE *file, 
     639  ExceptionInfo *wizard_unused(exception)) 
     640{ 
     641  char 
     642    area_limit[MaxTextExtent], 
     643    disk_limit[MaxTextExtent], 
     644    map_limit[MaxTextExtent], 
     645    memory_limit[MaxTextExtent]; 
     646 
     647  if (file == (const FILE *) NULL) 
     648    file=stdout; 
     649  AcquireSemaphoreInfo(&resource_semaphore); 
     650  (void) FormatWizardSize(resource_info.area_limit,area_limit); 
     651  (void) FormatWizardSize(resource_info.disk_limit,disk_limit); 
     652  (void) FormatWizardSize(resource_info.map_limit,map_limit); 
     653  (void) FormatWizardSize(resource_info.memory_limit,memory_limit); 
     654  (void) fprintf(file,"File        Area      Memory         Map        Disk\n"); 
     655  (void) fprintf(file,"----------------------------------------------------\n"); 
     656  (void) fprintf(file,"%4lu  %10s  %10s  %10s  %10s\n",(unsigned long) 
     657    resource_info.file_limit,area_limit,memory_limit,map_limit,disk_limit); 
     658  (void) fflush(file); 
     659  RelinquishSemaphoreInfo(resource_semaphore); 
     660  return(WizardTrue); 
     661} 
     662 
     663/* 
     664%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     665%                                                                             % 
     666%                                                                             % 
     667%                                                                             % 
     668%   R e l i n q u i s h W i z a r d R e s o u r c e                           % 
     669%                                                                             % 
     670%                                                                             % 
     671%                                                                             % 
     672%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     673% 
     674%  RelinquishWizardResource() relinquishes resources of the specified type. 
     675% 
     676%  The format of the RelinquishWizardResource() method is: 
     677% 
     678%      void RelinquishWizardResource(const ResourceType type, 
     679%        const WizardSizeType size) 
     680% 
     681%  A description of each parameter follows: 
     682% 
     683%    o type: The type of resource. 
     684% 
     685%    o size: The size of the resource. 
     686% 
     687*/ 
     688WizardExport void RelinquishWizardResource(const ResourceType type, 
     689  const WizardSizeType size) 
     690{ 
     691  char 
     692    resource_current[MaxTextExtent], 
     693    resource_limit[MaxTextExtent], 
     694    resource_request[MaxTextExtent]; 
     695 
     696  (void) FormatWizardSize(size,resource_request); 
     697  AcquireSemaphoreInfo(&resource_semaphore); 
     698  switch (type) 
     699  { 
     700    case AreaResource: 
     701    { 
     702      resource_info.area=(WizardOffsetType) size; 
     703      (void) FormatWizardSize((WizardSizeType) resource_info.area, 
     704        resource_current); 
     705      (void) FormatWizardSize(resource_info.area_limit,resource_limit); 
     706      break; 
     707    } 
     708    case MemoryResource: 
     709    { 
     710      resource_info.memory-=size; 
     711      (void) FormatWizardSize((WizardSizeType) resource_info.memory, 
     712        resource_current); 
     713      (void) FormatWizardSize(resource_info.memory_limit,resource_limit); 
     714      break; 
     715    } 
     716    case MapResource: 
     717    { 
     718      resource_info.map-=size; 
     719      (void) FormatWizardSize((WizardSizeType) resource_info.map, 
     720        resource_current); 
     721      (void) FormatWizardSize(resource_info.map_limit,resource_limit); 
     722      break; 
     723    } 
     724    case DiskResource: 
     725    { 
     726      resource_info.disk-=size; 
     727      (void) FormatWizardSize((WizardSizeType) resource_info.disk, 
     728        resource_current); 
     729      (void) FormatWizardSize(resource_info.disk_limit,resource_limit); 
     730      break; 
     731    } 
     732    case FileResource: 
     733    { 
     734      resource_info.file-=size; 
     735      (void) FormatWizardSize((WizardSizeType) resource_info.file, 
     736        resource_current); 
     737      (void) FormatWizardSize((WizardSizeType) resource_info.file_limit, 
     738        resource_limit); 
     739      break; 
     740    } 
     741    default: 
     742      break; 
     743  } 
     744  RelinquishSemaphoreInfo(resource_semaphore); 
     745  (void) LogWizardEvent(ResourceEvent,GetWizardModule(),"%s: %s/%s/%s", 
     746    WizardOptionToMnemonic(WizardResourceOptions,(long) type),resource_request, 
     747    resource_current,resource_limit); 
     748} 
     749 
     750/* 
     751%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     752%                                                                             % 
     753%                                                                             % 
     754%                                                                             % 
     755%    R e l i n q u i s h U n i q u e F i l e R e s o u r c e                  % 
     756%                                                                             % 
     757%                                                                             % 
     758%                                                                             % 
     759%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     760% 
     761%  RelinquishUniqueFileResource() relinquishes a unique file resource. 
     762% 
     763%  The format of the RelinquishUniqueFileResource() method is: 
     764% 
     765%      WizardBooleanType RelinquishUniqueFileResource(const char *path, 
     766%        const WizardBooleanType trash)) 
     767% 
     768%  A description of each parameter follows: 
     769% 
     770%    o name: the name of the temporary resource. 
     771% 
     772%    o trash: a value other than 0 trashs the file at the specified path. 
     773% 
     774*/ 
     775WizardExport WizardBooleanType RelinquishUniqueFileResource(const char *path, 
     776  const WizardBooleanType trash) 
     777{ 
     778  WizardAssert(ResourceDomain,path != (const char *) NULL); 
     779  (void) LogWizardEvent(ResourceEvent,GetWizardModule(),"%s",path); 
     780  if (temporary_resources != (SplayTreeInfo *) NULL) 
     781    { 
     782      register char 
     783        *p; 
     784 
     785      ResetSplayTreeIterator(temporary_resources); 
     786      p=(char *) GetNextKeyInSplayTree(temporary_resources); 
     787      while (p != (char *) NULL) 
     788      { 
     789        if (LocaleCompare(p,path) == 0) 
     790          break; 
     791        p=(char *) GetNextKeyInSplayTree(temporary_resources); 
     792      } 
     793      if (p != (char *) NULL) 
     794        (void) DeleteNodeFromSplayTree(temporary_resources,p); 
     795    } 
     796  if (trash == WizardFalse) 
     797    return(WizardTrue); 
     798  return(remove(path) == 0 ? WizardTrue : WizardFalse); 
     799} 
     800 
     801/* 
     802%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     803%                                                                             % 
     804%                                                                             % 
     805%                                                                             % 
     806+   R e s o u r c e C o m p o n e n t G e n e s i s                           % 
     807%                                                                             % 
     808%                                                                             % 
     809%                                                                             % 
     810%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     811% 
     812%  ResourceComponentGenesis() instantiates the resource component. 
     813% 
     814%  The format of the ResourceComponentGenesis method is: 
     815% 
     816%      WizardBooleanType ResourceComponentGenesis(void) 
    656817% 
    657818*/ 
     
    664825} 
    665826 
    666 WizardExport WizardBooleanType InstantiateResourceComponent(void) 
     827WizardExport WizardBooleanType ResourceComponentGenesis(void) 
    667828{ 
    668829  char 
     
    747908%                                                                             % 
    748909%                                                                             % 
    749 %  L i s t W i z a r d R e s o u r c e I n f o                                % 
    750 %                                                                             % 
    751 %                                                                             % 
    752 %                                                                             % 
    753 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    754 % 
    755 %  ListWizardResourceInfo() lists the resource info to a file. 
    756 % 
    757 %  The format of the ListWizardResourceInfo method is: 
    758 % 
    759 %      WizardBooleanType ListWizardResourceInfo(FILE *file, 
    760 %        ExceptionInfo *exception) 
    761 % 
    762 %  A description of each parameter follows. 
    763 % 
    764 %    o file:  An pointer to a FILE. 
    765 % 
    766 %    o exception: Return any errors or warnings in this structure. 
    767 % 
    768 */ 
    769 WizardExport WizardBooleanType ListWizardResourceInfo(FILE *file, 
    770   ExceptionInfo *wizard_unused(exception)) 
    771 { 
    772   char 
    773     area_limit[MaxTextExtent], 
    774     disk_limit[MaxTextExtent], 
    775     map_limit[MaxTextExtent], 
    776     memory_limit[MaxTextExtent]; 
    777  
    778   if (file == (const FILE *) NULL) 
    779     file=stdout; 
     910+   R e s o u r c e C o m p o n e n t G e n e s i s                           % 
     911%                                                                             % 
     912%                                                                             % 
     913%                                                                             % 
     914%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     915% 
     916%  ResourceComponentTerminus() destroys the resource component. 
     917% 
     918%  The format of the ResourceComponentTerminus() method is: 
     919% 
     920%      ResourceComponentTerminus(void) 
     921% 
     922*/ 
     923WizardExport void ResourceComponentTerminus(void) 
     924{ 
    780925  AcquireSemaphoreInfo(&resource_semaphore); 
    781   (void) FormatWizardSize(resource_info.area_limit,area_limit); 
    782   (void) FormatWizardSize(resource_info.disk_limit,disk_limit); 
    783   (void) FormatWizardSize(resource_info.map_limit,map_limit); 
    784   (void) FormatWizardSize(resource_info.memory_limit,memory_limit); 
    785   (void) fprintf(file,"File        Area      Memory         Map        Disk\n"); 
    786   (void) fprintf(file,"----------------------------------------------------\n"); 
    787   (void) fprintf(file,"%4lu  %10s  %10s  %10s  %10s\n",(unsigned long) 
    788     resource_info.file_limit,area_limit,memory_limit,map_limit,disk_limit); 
    789   (void) fflush(file); 
     926  if (temporary_resources != (SplayTreeInfo *) NULL) 
     927    temporary_resources=DestroySplayTree(temporary_resources); 
    790928  RelinquishSemaphoreInfo(resource_semaphore); 
    791   return(WizardTrue); 
    792 } 
    793  
    794 /* 
    795 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    796 %                                                                             % 
    797 %                                                                             % 
    798 %                                                                             % 
    799 %   R e l i n q u i s h W i z a r d R e s o u r c e                           % 
    800 %                                                                             % 
    801 %                                                                             % 
    802 %                                                                             % 
    803 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    804 % 
    805 RelinquishWizardResource() relinquishes resources of the specified type. 
    806 % 
    807 %  The format of the RelinquishWizardResource() method is: 
    808 % 
    809 %      void RelinquishWizardResource(const ResourceType type, 
    810 %        const WizardSizeType size) 
     929  DestroySemaphoreInfo(&resource_semaphore); 
     930} 
     931 
     932/* 
     933%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     934%                                                                             % 
     935%                                                                             % 
     936%                                                                             % 
     937%   S e t W i z a r d R e s o u r c e L i m i t                               % 
     938%                                                                             % 
     939%                                                                             % 
     940%                                                                             % 
     941%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     942% 
     943SetWizardResourceLimit() sets the limit for a particular resource in bytes. 
     944% 
     945%  The format of the SetWizardResourceLimit() method is: 
     946% 
     947%      WizardBooleanType SetWizardResourceLimit(const ResourceType type, 
     948%        const WizardResourceType limit) 
    811949% 
    812950%  A description of each parameter follows: 
     
    814952%    o type: The type of resource. 
    815953% 
    816 %    o size: The size of the resource. 
    817 % 
    818 */ 
    819 WizardExport void RelinquishWizardResource(const ResourceType type, 
    820   const WizardSizeType size) 
    821 { 
    822   char 
    823     resource_current[MaxTextExtent], 
    824     resource_limit[MaxTextExtent], 
    825     resource_request[MaxTextExtent]; 
    826  
    827   (void) FormatWizardSize(size,resource_request); 
     954%    o limit: The maximum limit for the resource. 
     955% 
     956*/ 
     957WizardExport WizardBooleanType SetWizardResourceLimit(const ResourceType type, 
     958  const WizardSizeType limit) 
     959{ 
    828960  AcquireSemaphoreInfo(&resource_semaphore); 
    829961  switch (type) 
     
    831963    case AreaResource: 
    832964    { 
    833       resource_info.area=(WizardOffsetType) size; 
    834       (void) FormatWizardSize((WizardSizeType) resource_info.area, 
    835         resource_current); 
    836       (void) FormatWizardSize(resource_info.area_limit,resource_limit); 
    837       break; 
    838     } 
    839     case MemoryResource: 
    840     { 
    841       resource_info.memory-=size; 
    842       (void) FormatWizardSize((WizardSizeType) resource_info.memory, 
    843         resource_current); 
    844       (void) FormatWizardSize(resource_info.memory_limit,resource_limit); 
    845       break; 
    846     } 
    847     case MapResource: 
    848     { 
    849       resource_info.map-=size; 
    850       (void) FormatWizardSize((WizardSizeType) resource_info.map, 
    851         resource_current); 
    852       (void) FormatWizardSize(resource_info.map_limit,resource_limit); 
    853       break; 
    854     } 
    855     case DiskResource: 
    856     { 
    857       resource_info.disk-=size; 
    858       (void) FormatWizardSize((WizardSizeType) resource_info.disk, 
    859         resource_current); 
    860       (void) FormatWizardSize(resource_info.disk_limit,resource_limit); 
    861       break; 
    862     } 
    863     case FileResource: 
    864     { 
    865       resource_info.file-=size; 
    866       (void) FormatWizardSize((WizardSizeType) resource_info.file, 
    867         resource_current); 
    868       (void) FormatWizardSize((WizardSizeType) resource_info.file_limit, 
    869         resource_limit); 
    870       break; 
    871     } 
    872     default: 
    873       break; 
    874   } 
    875   RelinquishSemaphoreInfo(resource_semaphore); 
    876   (void) LogWizardEvent(ResourceEvent,GetWizardModule(),"%s: %s/%s/%s", 
    877     WizardOptionToMnemonic(WizardResourceOptions,(long) type),resource_request, 
    878     resource_current,resource_limit); 
    879 } 
    880  
    881 /* 
    882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    883 %                                                                             % 
    884 %                                                                             % 
    885 %                                                                             % 
    886 %    R e l i n q u i s h U n i q u e F i l e R e s o u r c e                  % 
    887 %                                                                             % 
    888 %                                                                             % 
    889 %                                                                             % 
    890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    891 % 
    892 %  RelinquishUniqueFileResource() relinquishes a unique file resource. 
    893 % 
    894 %  The format of the RelinquishUniqueFileResource() method is: 
    895 % 
    896 %      WizardBooleanType RelinquishUniqueFileResource(const char *path, 
    897 %        const WizardBooleanType trash)) 
    898 % 
    899 %  A description of each parameter follows: 
    900 % 
    901 %    o name: the name of the temporary resource. 
    902 % 
    903 %    o trash: a value other than 0 trashs the file at the specified path. 
    904 % 
    905 */ 
    906 WizardExport WizardBooleanType RelinquishUniqueFileResource(const char *path, 
    907   const WizardBooleanType trash) 
    908 { 
    909   WizardAssert(ResourceDomain,path != (const char *) NULL); 
    910   (void) LogWizardEvent(ResourceEvent,GetWizardModule(),"%s",path); 
    911   if (temporary_resources != (SplayTreeInfo *) NULL) 
    912     { 
    913       register char 
    914         *p; 
    915  
    916       ResetSplayTreeIterator(temporary_resources); 
    917       p=(char *) GetNextKeyInSplayTree(temporary_resources); 
    918       while (p != (char *) NULL) 
    919       { 
    920         if (LocaleCompare(p,path) == 0) 
    921           break; 
    922         p=(char *) GetNextKeyInSplayTree(temporary_resources); 
    923       } 
    924       if (p != (char *) NULL) 
    925         (void) DeleteNodeFromSplayTree(temporary_resources,p); 
    926     } 
    927   if (trash == WizardFalse) 
    928     return(WizardTrue); 
    929   return(remove(path) == 0 ? WizardTrue : WizardFalse); 
    930 } 
    931  
    932 /* 
    933 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    934 %                                                                             % 
    935 %                                                                             % 
    936 %                                                                             % 
    937 %   S e t W i z a r d R e s o u r c e L i m i t                               % 
    938 %                                                                             % 
    939 %                                                                             % 
    940 %                                                                             % 
    941 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    942 % 
    943 %  SetWizardResourceLimit() sets the limit for a particular resource in bytes. 
    944 % 
    945 %  The format of the SetWizardResourceLimit() method is: 
    946 % 
    947 %      WizardBooleanType SetWizardResourceLimit(const ResourceType type, 
    948 %        const WizardResourceType limit) 
    949 % 
    950 %  A description of each parameter follows: 
    951 % 
    952 %    o type: The type of resource. 
    953 % 
    954 %    o limit: The maximum limit for the resource. 
    955 % 
    956 */ 
    957 WizardExport WizardBooleanType SetWizardResourceLimit(const ResourceType type, 
    958   const WizardSizeType limit) 
    959 { 
    960   AcquireSemaphoreInfo(&resource_semaphore); 
    961   switch (type) 
    962   { 
    963     case AreaResource: 
    964     { 
    965965      resource_info.area_limit=limit; 
    966966      break; 
  • WizardsToolkit/trunk/wizard/resource_.h

    r415 r445  
    4545  AcquireWizardResource(const ResourceType,const WizardSizeType), 
    4646  AcquireUniqueFilename(char *,ExceptionInfo *), 
    47   InstantiateResourceComponent(void), 
    4847  ListWizardResourceInfo(FILE *,ExceptionInfo *), 
    4948  RelinquishUniqueFileResource(const char *,const WizardBooleanType), 
     49  ResourceComponentGenesis(void), 
    5050  SetWizardResourceLimit(const ResourceType,const WizardSizeType); 
    5151 
     
    5454 
    5555extern WizardExport void 
    56   AsynchronousDestroyResourceComponent(void), 
    57   DestroyResourceComponent(void), 
    58   RelinquishWizardResource(const ResourceType,const WizardSizeType); 
     56  AsynchronousResourceComponentTerminus(void), 
     57  RelinquishWizardResource(const ResourceType,const WizardSizeType), 
     58  ResourceComponentTerminus(void); 
    5959 
    6060#if defined(__cplusplus) || defined(c_plusplus) 
  • WizardsToolkit/trunk/wizard/semaphore.c

    r436 r445  
    196196%                                                                             % 
    197197%                                                                             % 
    198 %   D e s t r o y S e m a p h o r e C o m p o n e n t                         % 
    199 %                                                                             % 
    200 %                                                                             % 
    201 %                                                                             % 
    202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    203 % 
    204 %  DestroySemaphoreComponent() destroys the semaphore environment. 
    205 % 
    206 %  The format of the DestroySemaphoreComponent method is: 
    207 % 
    208 %      DestroySemaphoreComponent(void) 
    209 % 
    210 */ 
    211 WizardExport void DestroySemaphoreComponent(void) 
    212 { 
    213 #if defined(WIZARDSTOOLKIT_HAVE_PTHREAD) 
    214   if (pthread_mutex_destroy(&semaphore_mutex) != 0) 
    215     (void) fprintf(stderr,"pthread_mutex_destroy failed %s\n", 
    216       GetExceptionMessage(errno)); 
    217 #endif 
    218 } 
    219  
    220 /* 
    221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    222 %                                                                             % 
    223 %                                                                             % 
    224 %                                                                             % 
    225198%   D e s t r o y S e m a p h o r e I n f o                                   % 
    226199%                                                                             % 
     
    254227  *semaphore_info=(SemaphoreInfo *) RelinquishAlignedMemory(*semaphore_info); 
    255228  UnlockWizardMutex(); 
    256 } 
    257  
    258 /* 
    259 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    260 %                                                                             % 
    261 %                                                                             % 
    262 %                                                                             % 
    263 %   I n s t a n t i a t e S e m a p h o r e C o m p o n e n t                 % 
    264 %                                                                             % 
    265 %                                                                             % 
    266 %                                                                             % 
    267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    268 % 
    269 %  InstantiateSemaphoreComponent() instantiates the semaphore component. 
    270 % 
    271 %  The format of the InstantiateSemaphoreComponent method is: 
    272 % 
    273 %      WizardBooleanType InstantiateSemaphore(void) 
    274 % 
    275 */ 
    276 WizardExport WizardBooleanType InstantiateSemaphoreComponent(void) 
    277 { 
    278   LockWizardMutex(); 
    279   UnlockWizardMutex(); 
    280   return(WizardTrue); 
    281229} 
    282230 
     
    411359%                                                                             % 
    412360%                                                                             % 
     361%   S e m a p h o r e C o m p o n e n t G e n e s i s                         % 
     362%                                                                             % 
     363%                                                                             % 
     364%                                                                             % 
     365%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     366% 
     367%  SemaphoreComponentGenesis() instantiates the semaphore component. 
     368% 
     369%  The format of the SemaphoreComponentGenesis method is: 
     370% 
     371%      WizardBooleanType SemaphoreComponentGenesis(void) 
     372% 
     373*/ 
     374WizardExport WizardBooleanType SemaphoreComponentGenesis(void) 
     375{ 
     376  LockWizardMutex(); 
     377  UnlockWizardMutex(); 
     378  return(WizardTrue); 
     379} 
     380 
     381/* 
     382%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     383%                                                                             % 
     384%                                                                             % 
     385%                                                                             % 
     386%   S e m a p h o r e C o m p o n e n t T e r m i n u s                       % 
     387%                                                                             % 
     388%                                                                             % 
     389%                                                                             % 
     390%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     391% 
     392%  SemaphoreComponentTerminus() destroys the semaphore environment. 
     393% 
     394%  The format of the SemaphoreComponentTerminus method is: 
     395% 
     396%      SemaphoreComponentTerminus(void) 
     397% 
     398*/ 
     399WizardExport void SemaphoreComponentTerminus(void) 
     400{ 
     401#if defined(WIZARDSTOOLKIT_HAVE_PTHREAD) 
     402  if (pthread_mutex_destroy(&semaphore_mutex) != 0) 
     403    (void) fprintf(stderr,"pthread_mutex_destroy failed %s\n", 
     404      GetExceptionMessage(errno)); 
     405#endif 
     406} 
     407 
     408/* 
     409%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
     410%                                                                             % 
     411%                                                                             % 
     412%                                                                             % 
    413413+   U n l o c k W i z a r d M u t e x                                         % 
    414414%                                                                             % 
  • WizardsToolkit/trunk/wizard/semaphore.h

    r436 r445  
    3131extern WizardExport void 
    3232  AcquireSemaphoreInfo(SemaphoreInfo **), 
    33   DestroySemaphoreComponent(void), 
    3433  DestroySemaphoreInfo(SemaphoreInfo **), 
    35   RelinquishSemaphoreInfo(SemaphoreInfo *); 
     34  RelinquishSemaphoreInfo(SemaphoreInfo *), 
     35  SemaphoreComponentTerminus(void); 
    3636 
    3737extern WizardExport WizardBooleanType 
    38   InstantiateSemaphoreComponent(void), 
    3938  LockSemaphoreInfo(SemaphoreInfo *), 
     39  SemaphoreComponentGenesis(void), 
    4040  UnlockSemaphoreInfo(SemaphoreInfo *); 
    4141 
  • WizardsToolkit/trunk/wizard/wizard.c

    r436 r445  
    153153  (void) signal(signal_number,SIG_IGN); 
    154154#endif 
    155   AsynchronousDestroyResourceComponent(); 
     155  AsynchronousResourceComponentTerminus(); 
    156156  instantiate_wizard=WizardFalse; 
    157157  (void) SetWizardSignalHandler(signal_number,signal_handlers[signal_number]); 
     
    215215  (void) setlocale(LC_NUMERIC,"C"); 
    216216  seconds=time((time_t *) NULL); 
    217   (void) InstantiateSemaphore(); 
    218   (void) InstantiateLogComponent(); 
    219   (void) InstantiateRandomComponent(); 
     217  (void) SemaphoreComponentGenesis(); 
     218  (void) LogComponentGenesis(); 
     219  (void) RandomComponentGenesis(); 
    220220  events=GetEnvironmentValue("WIZARD_DEBUG"); 
    221221  if (events != (char *) NULL) 
     
    294294    Initialize wizard resources. 
    295295  */ 
    296   (void) InstantiateResourceComponent(); 
    297   (void) InstantiateMimeComponent(); 
     296  (void) ResourceComponentGenesis(); 
     297  (void) MimeComponentGenesis(); 
    298298} 
    299299 
     
    318318WizardExport void WizardsToolkitTerminus(void) 
    319319{ 
    320   DestroyMimeComponent(); 
    321   DestroyResourceComponent(); 
    322   DestroyRandomComponent(); 
    323   DestroyLogComponent(); 
    324   DestroySemaphoreComponent(); 
    325 } 
     320  MimeComponentTerminus(); 
     321  ResourceComponentTerminus(); 
     322  RandomComponentTerminus(); 
     323  LogComponentTerminus(); 
     324  SemaphoreComponentTerminus(); 
     325}