Changeset a46430d in rtems


Ignore:
Timestamp:
Dec 10, 2009, 6:09:59 PM (10 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
4439616
Parents:
77f7498
Message:

Whitespace removal.

Location:
doc/tools/bmenu
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • doc/tools/bmenu/address.h

    r77f7498 ra46430d  
    2626 */
    2727
    28 STATIC INLINE void *_Addresses_Add_offset ( 
    29   void       *base, 
     28STATIC INLINE void *_Addresses_Add_offset (
     29  void       *base,
    3030  size_t      offset
    3131);
  • doc/tools/bmenu/base.h

    r77f7498 ra46430d  
    2424#define NUMBER_ELEMENTS( _x ) (sizeof(_x) / sizeof _x[0])
    2525
    26 void exit_application( 
     26void exit_application(
    2727  int status
    2828);
     
    5555void GenerateLists( void );
    5656
    57 void GenerateAList( 
     57void GenerateAList(
    5858  char          *section,
    5959  Chain_Control *the_list
     
    6262void LookForInternalInconsistencies( void );
    6363
    64 int Match_Argument( 
     64int Match_Argument(
    6565  char  **array,
    6666  int     entries,
     
    9090);
    9191
    92 void DumpList( 
     92void DumpList(
    9393  Chain_Control  *the_list
    9494);
  • doc/tools/bmenu/bmenu2.c

    r77f7498 ra46430d  
    11/*
    22 *  main.c
    3  * 
     3 *
    44 *  This program takes a texinfo file without node and menu commands,
    55 *  build those commands and inserts them.
     
    77 *  It works by reading the input file into a linked list of lines
    88 *  and then performing sweeps on that list until all formatting is
    9  *  complete.  After the program is run, there is still a little 
    10  *  clean up to be performed by hand.  The following have to be fixed 
     9 *  complete.  After the program is run, there is still a little
     10 *  clean up to be performed by hand.  The following have to be fixed
    1111 *  by hand:
    1212 *    + previous of the first node
     
    5151FILE           *OutFile;
    5252
    53 static void ProcessFile2( 
     53static void ProcessFile2(
    5454  FILE *infile,
    5555  FILE *outfile );
    5656static void PrintFile2(
    5757  FILE *outfile );
    58 static void ReadFileIntoChain2( 
     58static void ReadFileIntoChain2(
    5959  FILE *InFile );
    60  
     60
    6161/*************************************************************************
    6262 *************************************************************************
     
    7070char *Usage_Strings[] = {
    7171  "\n",
    72   "usage: cmd [-cv] [-p prev] [-n next] [-u up] \n", 
     72  "usage: cmd [-cv] [-p prev] [-n next] [-u up] \n",
    7373  "\n",
    7474  "EOF"
     
    8282#define PAGE_SEPARATOR                            "#PAGE"
    8383
    84 /* 
     84/*
    8585 *  Section Delimiter Keywords
    8686 */
     
    9191 *  Level indicates where in the format the delimiter is allowed to occur.
    9292 *    1 indicates a major section divider (e.g. "ATTRIBUTE DESCRIPTIONS:").
    93  *    2 indicates a subsection (e.g. "ATTRIBUTE:"). 
     93 *    2 indicates a subsection (e.g. "ATTRIBUTE:").
    9494 *    3 indicates a heading (e.g. "DESCRIPTION:").
    9595 */
     
    100100#define SUBSUBSECTION   3
    101101#define HEADING         4
    102  
     102
    103103typedef enum {
    104104  UNUSED,                            /* dummy 0 slot */
     
    114114  KEYWORD_OTHER,
    115115  KEYWORD_END
    116  
     116
    117117}  Keyword_indices_t;
    118118
     
    188188 */
    189189
    190 void exit_application( 
     190void exit_application(
    191191  int status
    192192)
     
    196196  fprintf( stderr, "*** Error encountered on line %d ***\n", CurrentLine );
    197197*/
    198   fclose( OutFile ); 
     198  fclose( OutFile );
    199199  exit( status );
    200200}
     
    224224  fprintf( stderr, "%s\n", line->Contents );
    225225#else
    226   /* 
     226  /*
    227227   *  Include some debugging information
    228228   */
    229229  fprintf(
    230230    stderr,
    231     "<%d,%d,%d>:%s\n", 
     231    "<%d,%d,%d>:%s\n",
    232232    line->keyword,
    233233    line->format,
     
    275275    assert( new_line );
    276276  }
    277  
     277
    278278/*
    279279 *  This is commented out because although it is helpful during debug,
    280280 *  it consumes a significant percentage of the program's execution time.
    281  
     281
    282282  memset( new_line->Contents, '\0', sizeof( new_line->Contents ) );
    283283*/
     
    315315{
    316316  Line_Control *next;
    317  
    318   next = (Line_Control *)line->Node.next; 
     317
     318  next = (Line_Control *)line->Node.next;
    319319  _Chain_Extract( &line->Node );
    320320  FreeLine( line );
     
    322322}
    323323
    324 /* 
     324/*
    325325 *  PrintSurroundingLines
    326326 */
     
    336336  Line_Control *local;
    337337
    338   for ( local=line, real_backward=0, i=1 ; 
    339         i<=backward ; 
     338  for ( local=line, real_backward=0, i=1 ;
     339        i<=backward ;
    340340        i++, real_backward++ ) {
    341341    if ( &local->Node == Lines.first )
     
    348348    local = (Line_Control *) local->Node.next;
    349349  }
    350  
     350
    351351  PrintLine( local );
    352352
     
    357357    PrintLine( local );
    358358  }
    359  
     359
    360360}
    361361
     
    389389  char *p;
    390390
    391   for ( p=line->Contents ; *p != ' ' ; p++ ) 
     391  for ( p=line->Contents ; *p != ' ' ; p++ )
    392392    ;
    393393  p++;  /* skip the ' ' */
     
    419419  }
    420420
    421   for ( ; *p ; ) 
     421  for ( ; *p ; )
    422422    *d++ = *p++;
    423423
     
    459459        break;
    460460      case 'p':
    461         DocsPreviousNode = strdup(optarg); 
     461        DocsPreviousNode = strdup(optarg);
    462462        break;
    463463      case 'n':
    464         DocsNextNode = strdup(optarg); 
     464        DocsNextNode = strdup(optarg);
    465465        break;
    466466      case 'u':
    467         DocsUpNode = strdup(optarg); 
     467        DocsUpNode = strdup(optarg);
    468468        break;
    469469
     
    479479     return 0 ;
    480480  }
    481  
     481
    482482  if ( Verbose )
    483483    fprintf( stderr, "Arguments successfully parsed\n" );
     
    485485  FillLinePool();
    486486
    487   ProcessFile2( stdin, stdout ); 
    488    
     487  ProcessFile2( stdin, stdout );
     488
    489489  if ( Verbose )
    490490    fprintf( stderr, "Exitting\n" );
     
    529529   FormatToTexinfo();
    530530
    531    if ( Verbose ) 
     531   if ( Verbose )
    532532     fprintf( stderr, "-------->FILE FORMATTED TO TEXINFO\n" );
    533533
    534534   /*
    535     *  Print the file 
     535    *  Print the file
    536536    */
    537537
    538538   PrintFile2( outfile );
    539539
    540    if ( Verbose ) 
     540   if ( Verbose )
    541541     fprintf( stderr, "-------->FILE PRINTED\n" );
    542542
    543543   /*
    544     *  Clean Up 
     544    *  Clean Up
    545545    */
    546546
     
    567567 */
    568568
    569 void ReadFileIntoChain2( 
     569void ReadFileIntoChain2(
    570570  FILE *InFile
    571571)
     
    590590   for ( ;; ) {
    591591      line = fgets( Buffer, BUFFER_SIZE, InFile );
    592       if ( !line ) 
     592      if ( !line )
    593593        break;
    594594
     
    596596
    597597      new_line = AllocateLine();
    598  
     598
    599599      strcpy( new_line->Contents, Buffer );
    600600
    601601      new_line->number = ++line_count;
    602  
     602
    603603      _Chain_Append( &Lines, &new_line->Node );
    604    } 
    605 
    606    fclose( InFile ); 
     604   }
     605
     606   fclose( InFile );
    607607}
    608608
     
    617617  int                indentation;
    618618  int                length;
    619  
     619
    620620  for ( line = (Line_Control *) Lines.first ;
    621621        !_Chain_Is_last( &line->Node ) ;
     
    624624
    625625    /*
    626      *  Strip white space from the end of each line 
     626     *  Strip white space from the end of each line
    627627     */
    628628
    629629    length = strlen( line->Contents );
    630630
    631     while ( isspace( line->Contents[ --length ] ) ) 
     631    while ( isspace( line->Contents[ --length ] ) )
    632632      line->Contents[ length ] = '\0';
    633633
     
    652652    else
    653653      line->keyword = KEYWORD_OTHER;
    654    
     654
    655655  }
    656656  line = AllocateLine();
     
    680680 */
    681681
    682 void BuildTexinfoNodes( void ) 
     682void BuildTexinfoNodes( void )
    683683{
    684684  char               Buffer[ BUFFER_SIZE ];
     
    718718         line->keyword == KEYWORD_PREFACE ||
    719719         line->keyword == KEYWORD_CHAPHEADING ) {
    720    
     720
    721721      strcpy( ChapterName, NodeName );
    722722
     
    829829        if ( (up_node->level == -1) )
    830830          continue;
    831          
    832         if ( up_node->level == (line->level - 1) ) { 
     831
     832        if ( up_node->level == (line->level - 1) ) {
    833833          LineCopySectionName( up_node, Buffer );
    834834          if (NodeNameIncludesChapter) {
     
    900900
    901901  for ( line = (Line_Control *) Lines.first ;
    902         !_Chain_Is_last( &line->Node ) ; 
     902        !_Chain_Is_last( &line->Node ) ;
    903903        line = (Line_Control *) line->Node.next ) {
    904904
     
    960960
    961961  for ( line = (Line_Control *) Lines.first ;
    962         !_Chain_Is_last( &line->Node ) ; 
     962        !_Chain_Is_last( &line->Node ) ;
    963963        line = (Line_Control *) line->Node.next ) {
    964964    fprintf( OutFile, "%s\n", line->Contents );
     
    979979 */
    980980
    981 void DumpList( 
     981void DumpList(
    982982  Chain_Control  *the_list
    983983)
     
    988988
    989989  for ( line = (Line_Control *) the_list->first ;
    990       !_Chain_Is_last( &line->Node ) ; 
     990      !_Chain_Is_last( &line->Node ) ;
    991991      line = (Line_Control *) line->Node.next ) {
    992992    /* if (line->level != -1) */
     
    10061006
    10071007   for ( line = (Line_Control *) Lines.first ;
    1008          !_Chain_Is_last( &line->Node ) ; 
     1008         !_Chain_Is_last( &line->Node ) ;
    10091009       ) {
    10101010     next = (Line_Control *) line->Node.next;
     
    10391039    for ( ; *source && !isspace( *source ) ; source++ )
    10401040      *destination++ = tolower( *source );
    1041      
     1041
    10421042    if ( !*source )
    10431043      break;
  • doc/tools/bmenu/chain.c

    r77f7498 ra46430d  
    1717 *  _Chain_Initialize
    1818 *
    19  *  This kernel routine initializes a doubly linked chain. 
     19 *  This kernel routine initializes a doubly linked chain.
    2020 *
    2121 *  Input parameters:
     
    2828 */
    2929
    30 void _Chain_Initialize( 
     30void _Chain_Initialize(
    3131  Chain_Control *the_chain,
    3232  void           *starting_address,
     
    3535)
    3636{
    37   size_t  count; 
     37  size_t  count;
    3838  Chain_Node *current;
    3939  Chain_Node *next;
     
    6363 *  Input parameters:
    6464 *    the_chain - pointer to chain header
    65  * 
    66  *  Output parameters: 
     65 *
     66 *  Output parameters:
    6767 *    return_node - pointer to node in chain allocated
    6868 *    CHAIN_END   - if no nodes available
    69  * 
     69 *
    7070 *  INTERRUPT LATENCY:
    7171 *    only case
     
    7979
    8080  return_node = NULL;
    81     if ( !_Chain_Is_empty( the_chain ) ) 
     81    if ( !_Chain_Is_empty( the_chain ) )
    8282      return_node = _Chain_Get_first_unprotected( the_chain );
    8383  return return_node;
     
    9393 *    the_chain - pointer to chain header
    9494 *    node      - address of node to put at rear of chain
    95  * 
     95 *
    9696 *  Output parameters:  NONE
    97  * 
     97 *
    9898 *  INTERRUPT LATENCY:
    9999 *    only case
    100100 */
    101101
    102 void _Chain_Append( 
     102void _Chain_Append(
    103103  Chain_Control *the_chain,
    104104  Chain_Node    *node
     
    116116 *  Input parameters:
    117117 *    node - pointer to node in chain to be deleted
    118  * 
     118 *
    119119 *  Output parameters:  NONE
    120  * 
     120 *
    121121 *  INTERRUPT LATENCY:
    122122 *    only case
    123123 */
    124124
    125 void _Chain_Extract( 
     125void _Chain_Extract(
    126126  Chain_Node *node
    127127)
    128 { 
     128{
    129129    _Chain_Extract_unprotected( node );
    130130}
     
    140140 *    after_node - pointer to node in chain to be inserted after
    141141 *    node       - pointer to node to be inserted
    142  * 
     142 *
    143143 *  Output parameters:  NONE
    144  * 
     144 *
    145145 *  INTERRUPT LATENCY:
    146146 *    only case
    147147 */
    148148
    149 void _Chain_Insert( 
     149void _Chain_Insert(
    150150  Chain_Node *after_node,
    151151  Chain_Node *node
     
    157157/*PAGE
    158158 *
    159  *  _Chain_Insert_chain 
     159 *  _Chain_Insert_chain
    160160 *
    161161 *  This routine inserts a chain after the specified node in another
    162  *  chain. It is assumed that the insert after node is not on the 
    163  *  second chain. 
     162 *  chain. It is assumed that the insert after node is not on the
     163 *  second chain.
    164164 *
    165165 *  Input parameters:
    166166 *    insert_after - insert the chain after this node
    167167 *    to_insert    - the chain to insert
    168  */ 
    169  
     168 */
     169
    170170void _Chain_Insert_chain(
    171171  Chain_Node    *insert_after,
  • doc/tools/bmenu/chain.h

    r77f7498 ra46430d  
    11/*  chain.h
    2  * 
     2 *
    33 *  This include file contains all the constants and structures associated
    44 *  with the Doubly Linked Chain Handler.
     
    4444 *  NOTE:  This implementation does not require special checks for
    4545 *         manipulating the first and last elements on the chain.
    46  *         To accomplish this the chain control structure is 
     46 *         To accomplish this the chain control structure is
    4747 *         treated as two overlapping chain nodes.  The permanent
    4848 *         head of the chain overlays a node structure on the
    4949 *         first and permanent_null fields.  The permanent tail
    50  *         of the chain overlays a node structure on the 
     50 *         of the chain overlays a node structure on the
    5151 *         permanent_null and last elements of the structure.
    5252 */
     
    5858} Chain_Control;
    5959
    60 /* 
     60/*
    6161 *  _Chain_Initialize
    6262 *
     
    6666 */
    6767
    68 void _Chain_Initialize( 
     68void _Chain_Initialize(
    6969  Chain_Control *the_chain,
    7070  void          *starting_address,
     
    7373);
    7474
    75 /* 
     75/*
    7676 *  _Chain_Initialize_empty
    7777 *
     
    8383);
    8484
    85 /* 
     85/*
    8686 *  _Chain_Extract_unprotected
    8787 *
     
    9595);
    9696
    97 /* 
     97/*
    9898 *  _Chain_Extract
    9999 *
     
    103103 */
    104104
    105 void _Chain_Extract( 
    106   Chain_Node *the_node
    107 );
    108 
    109 /* 
     105void _Chain_Extract(
     106  Chain_Node *the_node
     107);
     108
     109/*
    110110 *  _Chain_Get_unprotected
    111111 *
     
    116116 */
    117117
    118 STATIC INLINE Chain_Node *_Chain_Get_unprotected( 
    119   Chain_Control *the_chain
    120 );
    121 
    122 /* 
     118STATIC INLINE Chain_Node *_Chain_Get_unprotected(
     119  Chain_Control *the_chain
     120);
     121
     122/*
    123123 *  _Chain_Get
    124124 *
     
    129129 */
    130130
    131 Chain_Node *_Chain_Get( 
    132   Chain_Control *the_chain
    133 );
    134 
    135 /* 
     131Chain_Node *_Chain_Get(
     132  Chain_Control *the_chain
     133);
     134
     135/*
    136136 *  _Chain_Get_first_unprotected
    137137 *
     
    141141 */
    142142
    143 STATIC INLINE Chain_Node *_Chain_Get_first_unprotected( 
    144   Chain_Control *the_chain
    145 );
    146 
    147 /* 
     143STATIC INLINE Chain_Node *_Chain_Get_first_unprotected(
     144  Chain_Control *the_chain
     145);
     146
     147/*
    148148 *  _Chain_Insert_unprotected
    149149 *
     
    158158);
    159159
    160 /* 
     160/*
    161161 *  _Chain_Insert
    162162 *
     
    166166 */
    167167
    168 void _Chain_Insert( 
     168void _Chain_Insert(
    169169  Chain_Node *after_node,
    170170  Chain_Node *the_node
    171171);
    172172
    173 /* 
     173/*
    174174 *  _Chain_Append_unprotected
    175175 *
     
    184184);
    185185
    186 /* 
     186/*
    187187 *  _Chain_Append
    188188 *
     
    192192 */
    193193
    194 void _Chain_Append( 
    195   Chain_Control *the_chain,
    196   Chain_Node    *the_node
    197 );
    198 
    199 /* 
     194void _Chain_Append(
     195  Chain_Control *the_chain,
     196  Chain_Node    *the_node
     197);
     198
     199/*
    200200 *  _Chain_Prepend_unprotected
    201201 *
     
    210210);
    211211
    212 /* 
     212/*
    213213 *  _Chain_Prepend
    214214 *
     
    236236);
    237237
    238 /* 
     238/*
    239239 *  _Chain_Head
    240240 *
     
    246246);
    247247
    248 /* 
     248/*
    249249 *  _Chain_Tail
    250250 *
     
    256256);
    257257
    258 /* 
     258/*
    259259 *  _Chain_Is_head
    260260 *
     
    268268);
    269269
    270 /* 
     270/*
    271271 *  _Chain_Is_tail
    272272 *
     
    280280);
    281281
    282 /* 
     282/*
    283283 *  _Chain_Is_first
    284284 *
     
    291291);
    292292
    293 /* 
     293/*
    294294 *  _Chain_Is_last
    295295 *
     
    302302);
    303303
    304 /* 
     304/*
    305305 *  _Chain_Is_empty
    306306 *
     
    313313);
    314314
    315 /* 
     315/*
    316316 *  _Chain_Has_only_one_node
    317317 *
     
    324324);
    325325
    326 /* 
     326/*
    327327 *  _Chain_Is_null
    328328 *
     
    334334);
    335335
    336 /* 
     336/*
    337337 *  _Chain_Is_null_node
    338338 *
Note: See TracChangeset for help on using the changeset viewer.