diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:35 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:35 -0800 |
commit | dfb3f050a7cebd2030ea23dc6fa8964530e4ddcc (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /libutil/op_string.c | |
parent | b9958da7adae1c7d4482e958b371401eef387a39 (diff) | |
download | oprofile-dfb3f050a7cebd2030ea23dc6fa8964530e4ddcc.tar.gz |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'libutil/op_string.c')
-rw-r--r-- | libutil/op_string.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/libutil/op_string.c b/libutil/op_string.c deleted file mode 100644 index d440299..0000000 --- a/libutil/op_string.c +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file op_string.c - * general purpose C string handling implementation. - * - * @remark Copyright 2003 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - * @author Philippe Elie - */ - -#include <string.h> -#include "op_libiberty.h" - - -char * op_xstrndup(char const * s, size_t len) -{ - return xmemdup(s, len, len + 1); -} - - -size_t op_hash_string(char const * str) -{ - size_t hash = 0; - for (; *str; ++str) - hash ^= (hash << 16) ^ (hash >> 8) ^ *str; - return hash; -} - - -int strisprefix(char const * str, char const * prefix) -{ - return strstr(str, prefix) == str; -} - - -char const * skip_ws(char const * c) -{ - while (*c == ' ' || *c == '\t' || *c == '\n') - ++c; - return c; -} - - -char const * skip_nonws(char const * c) -{ - while (*c && *c != ' ' && *c != '\t' && *c != '\n') - ++c; - return c; -} - - -int empty_line(char const * c) -{ - return !*skip_ws(c); -} - - -int comment_line(char const * c) -{ - return *skip_ws(c) == '#'; -} |