Date:2016-08-23 02:24:42 (7 years 3 months ago)
Author:Werner Almesberger
Commit:fe6d3a9e8504da158b00ed44ceeae54f6b96dfc4
Message:eeshow/misc/util.h (strbegins): !strncmp(s, prefix, strlen(prefix))

Files: eeshow/misc/util.h (2 diffs)

Change Details

eeshow/misc/util.h
1414#ifndef MISC_UTIL_H
1515#define MISC_UTIL_H
1616
17#include <stdio.h>
17#include <stdbool.h>
1818#include <stdlib.h>
19#include <stdio.h>
1920#include <string.h>
2021
2122
...... 
6364#define unsupported(s) \
6465    fprintf(stderr, __FILE__ ":%d: unsupported: " s "\n", __LINE__)
6566
67
68static inline bool strbegins(const char *s, const char *prefix)
69{
70    return !strncmp(s, prefix, strlen(prefix));
71}
72
6673#endif /* !MISC_UTIL_H */

Archive Download the corresponding diff file

Branches:
master



interactive