Changeset 361


Ignore:
Timestamp:
Jun 19, 2009, 9:08:41 PM (16 years ago)
Author:
RBRi
Message:

formating

Location:
trunk/hlpmgr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hlpmgr/utility.c

    r360 r361  
    8484}
    8585
    86 void StoreString( char** dest,
    87                   char* source )
     86void StoreString( char** dest, char* source )
    8887{
    8988  if ( *dest != NULL )
  • trunk/hlpmgr/viewer.c

    r26 r361  
    1212char* OWN_HELP_MARKER = "[NVHELP]";
    1313
    14 BOOL StartViewer( char* pszParameters,
    15                   HWND hTerminateNotify,
    16                   HWND hAppWindow,
    17                   HAB hab )
     14BOOL StartViewer(   char* pszParameters,
     15                    HWND hTerminateNotify,
     16                    HWND hAppWindow,
     17                    HAB hab )
    1818{
    1919  PROGDETAILS Details;
     
    4242
    4343
    44   LogEvent( "Launching: %s %s",
    45             Details.pszExecutable,
    46             pszParameters );
    47              
    48   hApplication =
     44  LogEvent( "Launching: %s %s", Details.pszExecutable, pszParameters );
     45
     46  hApplication =
    4947    WinStartApp( hTerminateNotify,    // window to be notified of termination
    5048                 & Details,           // details
     
    5553  if ( hApplication == NULL )
    5654  {
    57     LogEvent( "  Failed to launch viewer, rc=%8X",
    58               WinGetLastError( hab ) ); 
    59     sprintf( pszMessageCaption,
    60              "Unable to start help viewer %s",
    61              pszViewerFilename );
     55    LogEvent( "  Failed to launch viewer, rc=%8X", WinGetLastError( hab ) );
     56    sprintf( pszMessageCaption, "Unable to start help viewer %s", pszViewerFilename );
    6257    WinMessageBox( HWND_DESKTOP, // parent
    6358                   hAppWindow,   // owner
     
    6964  }
    7065  else
    71   { 
     66  {
    7267    result = TRUE;
    7368  }
     
    7772}
    7873
     74
    7975// appends the given filenames to the output string,
    8076// replace spaces between filenames with a +
    8177// and stripping redundant spaces.
    82 void ModifyFilenames( char* Filenames,
    83                       char* Output )
     78void ModifyFilenames( char* Filenames, char* Output )
    8479{
    8580  BOOL First;
     
    9287  {
    9388    // skip spaces
    94     while (    *Filenames != 0 
     89    while (    *Filenames != 0
    9590            && *Filenames == ' ' )
    9691      Filenames ++;
     
    105100
    106101    First = FALSE;
    107     // copy non-space characters   
     102    // copy non-space characters
    108103    // or all characters if in quotes
    109     while (    *Filenames != 0 
     104    while (    *Filenames != 0
    110105            && ( *Filenames != ' ' || InQuote ) )
    111106    {
     
    113108      if ( ! InQuote )
    114109      {
    115         if (    *Filenames == '\'' 
     110        if (    *Filenames == '\''
    116111             || *Filenames == '\"' )
    117112        {
     
    121116        }
    122117      }
    123       else 
     118      else
    124119      {
    125120        if ( *Filenames == QuoteChar )
     
    128123          * Output = '\"'; // change singles to doubles
    129124        }
    130       }       
    131      
     125      }
     126
    132127      Output ++;
    133128      Filenames ++;
     
    138133  *Output = 0;
    139134}
     135
    140136
    141137BOOL ViewHelpFile( char* pszHelpFileName,
     
    148144
    149145  // set up viewer parameters:
    150   // <helpfilename> /hm:<helpwindow> 
     146  // <helpfilename> /hm:<helpwindow>
    151147  // currently not used: /owner:<ownerwindow>
    152148
    153   pszParameters = (char*) malloc(   strlen( pszHelpFileName ) 
     149  pszParameters = (char*) malloc(   strlen( pszHelpFileName )
    154150                                  + strlen( pszWindowTitle )
    155151                                  + 512 );
    156152
    157   sprintf( pszParameters,
    158            "/hm:%u ",
    159            hHelpWindow );
     153  sprintf( pszParameters, "/hm:%u ", hHelpWindow );
    160154
    161155  if ( pszHelpFileName != NULL )
     
    166160  }
    167161
    168   if ( pszWindowTitle != NULL ) 
     162  if ( pszWindowTitle != NULL )
    169163  {
    170164    // add window title parameter
     
    174168  }
    175169
    176   return StartViewer( pszParameters,
    177                       hHelpWindow,
    178                       hAppWindow,
    179                       hab );
     170  return StartViewer(   pszParameters,
     171                        hHelpWindow,
     172                        hAppWindow,
     173                        hab );
    180174}
     175
    181176
    182177void ViewHelpOnHelp( HAB hab )
    183178{
    184   StartViewer( OWN_HELP_MARKER,
    185                NULL,
    186                NULL,
    187                hab );
     179  StartViewer(  OWN_HELP_MARKER,
     180                NULL,
     181                NULL,
     182                hab );
    188183}
    189184
Note: See TracChangeset for help on using the changeset viewer.