+/**
+ * Copy a persistent handle.
+ *
+ * Let the underlying resource factory copy the \a handle.
+ *
+ * @param a the persistent handle factory
+ * @param handle the resource to accrete
+ */
+PHP_RAPHF_API void *php_persistent_handle_accrete(
+ php_persistent_handle_factory_t *a, void *handle TSRMLS_DC);
+
+/**
+ * Retrieve persistent handle resource factory ops.
+ *
+ * These ops can be used to mask a persistent handle factory as
+ * resource factory itself, so you can transparently use the
+ * resource factory API, both for persistent and non-persistent
+ * ressources.
+ *
+ * Example:
+ * ~~~~~~~~~~~~~~~{.c}
+ * php_resource_factory_t *create_my_rf(const char *persistent_id_str,
+ * size_t persistent_id_len TSRMLS_DC)
+ * {
+ * php_resource_factory_t *rf;
+ *
+ * if (persistent_id_str) {
+ * php_persistent_handle_factory_t *pf;
+ * php_resource_factory_ops_t *ops;
+ *
+ * ops = php_persistent_handle_get_resource_factory_ops();
+ *
+ * pf = php_persistent_handle_concede(NULL, "my", 2,
+ * persistent_id_str, persistent_id_len, NULL, NULL TSRMLS_CC);
+ *
+ * rf = php_resource_factory_init(NULL, ops, pf, php_persistent_handle_abandon);
+ * } else {
+ * rf = php_resource_factory_init(NULL, &myops, NULL, NULL);
+ * }
+ * return rf;
+ * }
+ * ~~~~~~~~~~~~~~~
+ */
+PHP_RAPHF_API php_resource_factory_ops_t *
+php_persistent_handle_get_resource_factory_ops(void);
+
+/**
+ * Clean persistent handles up.
+ *
+ * Destroy persistent handles of provider \a name_str and in subsidiary
+ * namespace \a ident_str.
+ *
+ * If \a name_str is NULL, all persistent handles of all providers with a
+ * matching \a ident_str will be cleaned up.
+ *
+ * If \a ident_str is NULL all persistent handles of the provider will be
+ * cleaned up.
+ *
+ * Ergo, if both, \a name_str and \a ident_str are NULL, then all
+ * persistent handles will be cleaned up.
+ *
+ * You must call this in MSHUTDOWN, if your resource factory ops hold a
+ * registered php_resource_factory::dtor, else the dtor will point to
+ * memory not any more available if the extension has already been unloaded.
+ *
+ * @param name_str the provider name; may be NULL
+ * @param name_len the provider name length
+ * @param ident_str the subsidiary namespace name; may be NULL
+ * @param ident_len the subsidiary namespace name length
+ */
+PHP_RAPHF_API void php_persistent_handle_cleanup(const char *name_str,
+ size_t name_len, const char *ident_str, size_t ident_len TSRMLS_DC);
+
+/**
+ * Retrieve statistics about the current process/thread's persistent handles.
+ *
+ * @return a HashTable like:
+ * ~~~~~~~~~~~~~~~
+ * [
+ * "name" => [
+ * "ident" => [
+ * "used" => 1,
+ * "free" => 0,
+ * ]
+ * ]
+ * ]
+ * ~~~~~~~~~~~~~~~
+ */
+PHP_RAPHF_API HashTable *php_persistent_handle_statall(HashTable *ht TSRMLS_DC);