Files
kvmtool/util/strbuf.c
T
Prasad Joshi 98ee79f433 kvm tools: Use code from perf for argument processing
- parse-options.[ch] has argument processing code.

- types.h: Additional types for argument processing.

- strbuf.[ch]: Added a function prefixcmp to compare string prefix

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:42 +01:00

14 lines
253 B
C

/* user defined headers */
#include <kvm/strbuf.h>
int prefixcmp(const char *str, const char *prefix)
{
for (; ; str++, prefix++) {
if (!*prefix)
return 0;
else if (*str != *prefix)
return (unsigned char)*prefix - (unsigned char)*str;
}
}