+/**
+ * Initialize a pre-allocated buffer to the specific class of resource, setting its private data to @priv.
+ * This resource can be added to the current pool by @res_add().
+ **/
+static inline struct resource *res_init(struct resource *r, const struct res_class *rc, void *priv)
+{
+ r->flags = 0;
+ r->rclass = rc;
+ r->priv = priv;
+ return r;
+}
+
+/**
+ * Links a pre-initialized resource to the active pool.
+ **/
+void res_add(struct resource *r);
+