]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/cnid/last/cnid_last.c
Remove all Appletalk stuff
[netatalk.git] / libatalk / cnid / last / cnid_last.c
index 6f0f68ea6591479645a254714b3fa241df1173d0..5903d03fe449da281238818e9501c57e812cf9f1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cnid_last.c,v 1.3 2005-05-03 14:55:14 didg Exp $
+ * $Id: cnid_last.c,v 1.5 2010-03-31 09:47:32 franklahm Exp $
  *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <arpa/inet.h>
 
 /* ------------------------ */
 cnid_t cnid_last_add(struct _cnid_db *cdb, const struct stat *st,
-                     const cnid_t did _U_, char *name _U_, const size_t len _U_, cnid_t hint _U_)
+                     cnid_t did _U_, const char *name _U_, size_t len _U_, cnid_t hint _U_)
 {
 
     /* FIXME: it relies on fact, that this is never called twice for the same file/dir. */
@@ -86,9 +87,8 @@ int cnid_last_delete(struct _cnid_db *cdb _U_, const cnid_t id _U_)
 }
 
 
-
 /* Return CNID for a given did/name. */
-cnid_t cnid_last_get(struct _cnid_db *cdb _U_, const cnid_t did _U_, char *name _U_, const size_t len _U_)
+cnid_t cnid_last_get(struct _cnid_db *cdb _U_, cnid_t did _U_, const char *name _U_, size_t len _U_)
 {
     /* FIXME: it relies on fact, that this is never called twice for the same file/dir. */
     /* Propably we should look through DID tree. */
@@ -96,10 +96,9 @@ cnid_t cnid_last_get(struct _cnid_db *cdb _U_, const cnid_t did _U_, char *name
 }
 
 
-
 /* */
-cnid_t cnid_last_lookup(struct _cnid_db *cdb _U_, const struct stat *st _U_, const cnid_t did _U_, 
-    char *name _U_, const size_t len _U_)
+cnid_t cnid_last_lookup(struct _cnid_db *cdb _U_, const struct stat *st _U_, cnid_t did _U_, 
+                        const char *name _U_, size_t len _U_)
 {
     /* FIXME: this function doesn't work in [last] scheme ! */
     /* Should be never called or CNID should be somewhat refactored again. */
@@ -144,15 +143,15 @@ static struct _cnid_db *cnid_last_new(const char *volpath)
     return cdb;
 }
 
-struct _cnid_db *cnid_last_open(const char *dir, mode_t mask _U_)
+struct _cnid_db *cnid_last_open(struct cnid_open_args *args)
 {
     struct _cnid_db *cdb;
 
-    if (!dir) {
+    if (!args->dir) {
         return NULL;
     }
 
-    if ((cdb = cnid_last_new(dir)) == NULL) {
+    if ((cdb = cnid_last_new(args->dir)) == NULL) {
         LOG(log_error, logtype_default, "cnid_open: Unable to allocate memory for database");
         return NULL;
     }
@@ -175,8 +174,8 @@ char *cnid_last_resolve(struct _cnid_db *cdb _U_, cnid_t * id _U_, void *buffer
 }
 
 
-int cnid_last_update(struct _cnid_db *cdb _U_, const cnid_t id _U_, const struct stat *st _U_,
-                     const cnid_t did  _U_, char *name  _U_, const size_t len _U_)
+int cnid_last_update(struct _cnid_db *cdb _U_, cnid_t id _U_, const struct stat *st _U_,
+                     cnid_t did  _U_, const char *name  _U_, size_t len _U_)
 {
     return 0;
 }