summaryrefslogtreecommitdiff
path: root/src/utils/utils.h
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2009-02-14 22:55:32 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2009-02-14 22:55:32 +0000
commitf1f3155ef6f28fb8595920e5423336b39bba4ed0 (patch)
treef7016ea23c888285ac255d06a42a7205ecca48fe /src/utils/utils.h
parentd0d70a21234ce34ab606c403cdb205897ace0cbb (diff)
downloadlibcss-f1f3155ef6f28fb8595920e5423336b39bba4ed0.tar.gz
libcss-f1f3155ef6f28fb8595920e5423336b39bba4ed0.tar.bz2
Port libcss to libwapcaplet.
It passes the tests, perhaps we need more of them. Lifetimes of lwc_string objects really need attention before we can consider this finished. svn path=/trunk/libcss/; revision=6517
Diffstat (limited to 'src/utils/utils.h')
-rw-r--r--src/utils/utils.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/utils/utils.h b/src/utils/utils.h
index 6a3ddad..4661442 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -8,7 +8,10 @@
#ifndef css_utils_h_
#define css_utils_h_
+#include <libwapcaplet/libwapcaplet.h>
+
#include <libcss/types.h>
+#include <libcss/errors.h>
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
@@ -27,7 +30,7 @@
#define UNUSED(x) ((x)=(x))
#endif
-css_fixed number_from_css_string(const css_string *string, bool int_only,
+css_fixed number_from_lwc_string(lwc_string *string, bool int_only,
size_t *consumed);
static inline bool isDigit(uint8_t c)
@@ -80,4 +83,18 @@ static inline uint32_t charToHex(uint8_t c)
return 0;
}
+static inline css_error
+css_error_from_lwc_error(lwc_error err)
+{
+ switch (err) {
+ case lwc_error_ok:
+ return CSS_OK;
+ case lwc_error_oom:
+ return CSS_NOMEM;
+ case lwc_error_range:
+ return CSS_BADPARM;
+ }
+ return CSS_INVALID;
+}
+
#endif