]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/cnid/cdb/cnid_cdb_nextid.c
- merge branch-netatalk-afp-3x-dev, HEAD was tagged before
[netatalk.git] / libatalk / cnid / cdb / cnid_cdb_nextid.c
diff --git a/libatalk/cnid/cdb/cnid_cdb_nextid.c b/libatalk/cnid/cdb/cnid_cdb_nextid.c
new file mode 100644 (file)
index 0000000..60141c3
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * $Id: cnid_cdb_nextid.c,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifdef CNID_BACKEND_CDB
+
+#ifdef unused
+#include "cnid_cdb_private.h"
+
+/* return the next id. we use the fact that ad files are memory
+ * mapped. */
+cnid_t cnid_cdb_nextid(struct _cnid_db *cdb)
+{
+    CNID_private *db;
+    cnid_t id;
+
+    if (!cdb || !(db = cdb->_private))
+        return 0;
+
+    memcpy(&id, ad_entry(&db->rootinfo, ADEID_DID), sizeof(id));
+    return id;
+}
+#endif
+
+#endif /* CNID_BACKEND_CDB */