Changeset 2887:bbfcd79d3c2b in roaraudio


Ignore:
Timestamp:
10/10/09 02:07:06 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

parse config more flexibale: comments, spaces, new lions...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/config.c

    r2886 r2887  
    8686    next++; 
    8787  } 
     88 
     89  // strip leading spaces: 
     90  while ( *k == ' ' ) k++; 
     91 
     92  // strip tailing new lions: 
     93  v = strtok(k, "\r\n"); 
     94  if ( v != NULL ) { 
     95   if ( *v == '\r' || *v == '\n' ) 
     96    *v = 0; 
     97  } 
     98 
     99  // comments 
     100  if ( *k == '#' ) 
     101   continue; 
     102 
     103  // empty options: 
     104  if ( *k == 0 ) 
     105   continue; 
    88106 
    89107  if ( (v = strstr(k, ":")) != NULL ) { 
Note: See TracChangeset for help on using the changeset viewer.