diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-20 23:30:21 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-20 23:30:21 +0000 |
commit | 249d8fcee6079aeef5bce1d2cfdc25c6454d1f0a (patch) | |
tree | 926aa2d0ede06e8f4edfc789bae8e4b237cb7613 /src/utils/utils.h | |
parent | dd27ee6e83d9490112356f55ec69a29fe48b4aa4 (diff) | |
download | libcss-249d8fcee6079aeef5bce1d2cfdc25c6454d1f0a.tar.gz libcss-249d8fcee6079aeef5bce1d2cfdc25c6454d1f0a.tar.bz2 |
Make integer_from_css_string return the number of input bytes processed.
svn path=/trunk/libcss/; revision=5758
Diffstat (limited to 'src/utils/utils.h')
-rw-r--r-- | src/utils/utils.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/utils/utils.h b/src/utils/utils.h index d31278d..b165059 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -27,14 +27,15 @@ #define UNUSED(x) ((x)=(x)) #endif -static inline int32_t integer_from_css_string(const css_string *string) +static inline int32_t integer_from_css_string(const css_string *string, + size_t *consumed) { size_t len; const uint8_t *ptr; int sign = 1; int32_t val = 0; - if (string == NULL || string->len == 0) + if (string == NULL || string->len == 0 || consumed == NULL) return 0; len = string->len; @@ -64,6 +65,8 @@ static inline int32_t integer_from_css_string(const css_string *string) len--; } + *consumed = ptr - string->ptr; + return val * sign; } |