Changeset aed3e6a in mainline


Ignore:
Timestamp:
2016-12-11T15:48:12Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df01d303
Parents:
e53794c
Message:

Allow # comments in match files

Location:
uspace/srv/devman
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/match.c

    re53794c raed3e6a  
    4141#include "devman.h"
    4242#include "match.h"
     43
     44#define COMMENT '#'
    4345
    4446/** Compute compound score of driver and device.
     
    145147                if (!skip_spaces(&buf))
    146148                        break;
     149
     150                if (*buf == COMMENT) {
     151                        skip_line(&buf);
     152                        continue;
     153                }
    147154               
    148155                /* read score */
  • uspace/srv/devman/util.c

    re53794c raed3e6a  
    7373}
    7474
     75void skip_line(char **buf)
     76{
     77        while (**buf && **buf != '\n')
     78                (*buf)++;
     79}
     80
    7581size_t get_nonspace_len(const char *str)
    7682{
  • uspace/srv/devman/util.h

    re53794c raed3e6a  
    4242
    4343extern bool skip_spaces(char **);
     44extern void skip_line(char **);
    4445extern size_t get_nonspace_len(const char *);
    4546extern void replace_char(char *, char, char);
Note: See TracChangeset for help on using the changeset viewer.