summaryrefslogtreecommitdiff
path: root/src/utils/resource_mgr.h
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2009-08-11 11:17:23 +0000
committerBo Yang <struggleyb.nku@gmail.com>2009-08-11 11:17:23 +0000
commit399da01ae4eb5c5e3e9349bacc2063c946c3d4a1 (patch)
tree433c8bcde94fc7a6e6f2e5cbf23842a84db98146 /src/utils/resource_mgr.h
parenteec057c7437e19b59ca1e698ce548cb56ce37240 (diff)
downloadlibdom-399da01ae4eb5c5e3e9349bacc2063c946c3d4a1.tar.gz
libdom-399da01ae4eb5c5e3e9349bacc2063c946c3d4a1.tar.bz2
Merge the branches/struggleyb/libdom-remain back to trunk.
svn path=/trunk/dom/; revision=9191
Diffstat (limited to 'src/utils/resource_mgr.h')
-rw-r--r--src/utils/resource_mgr.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/utils/resource_mgr.h b/src/utils/resource_mgr.h
new file mode 100644
index 0000000..b58f665
--- /dev/null
+++ b/src/utils/resource_mgr.h
@@ -0,0 +1,45 @@
+/*
+ * This file is part of libdom.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
+ */
+
+#ifndef dom_utils_resource_mgr_h_
+#define dom_utils_resource_mgr_h_
+
+#include <dom/functypes.h>
+#include <dom/core/exceptions.h>
+
+#include "hashtable.h"
+
+struct lwc_context_s;
+struct lwc_string_s;
+struct dom_string;
+
+/**
+ * Resource manager
+ */
+typedef struct dom_resource_mgr {
+ dom_alloc alloc;
+ void *pw;
+ struct lwc_context_s *ctx;
+} dom_resource_mgr;
+
+void *_dom_resource_mgr_alloc(struct dom_resource_mgr *res, void *ptr,
+ size_t size);
+
+dom_exception _dom_resource_mgr_create_string(struct dom_resource_mgr *res,
+ const uint8_t *data, size_t len, struct dom_string **result);
+
+dom_exception _dom_resource_mgr_create_lwcstring(struct dom_resource_mgr *res,
+ const uint8_t *data, size_t len, struct lwc_string_s **result);
+
+dom_exception _dom_resource_mgr_create_string_from_lwcstring(
+ struct dom_resource_mgr *res, struct lwc_string_s *str,
+ struct dom_string **result);
+
+dom_exception _dom_resource_mgr_create_hashtable(struct dom_resource_mgr *res,
+ size_t chains, dom_hash_func f, struct dom_hash_table **ht);
+
+#endif