]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/switch.c
First working IPC reconnect
[netatalk.git] / etc / afpd / switch.c
index 9e286c72ab8109cb33ea0a651c1add0c1b6bbac6..5c98e8df57d511565c8d3366a5306925efb74ff6 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: switch.c,v 1.17 2009-09-11 09:14:16 franklahm Exp $
- *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -33,8 +31,7 @@
 
 #include <atalk/afp.h>
 #include <atalk/uam.h>
-
-#include "globals.h"
+#include <atalk/globals.h>
 
 /* grab the FP functions */
 #include "auth.h" 
 #include "filedir.h"
 #include "status.h"
 #include "misc.h"
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
 #include "acls.h"
 #endif
 
-static int afp_null(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj  *obj _U_;
-char   *ibuf, *rbuf _U_;
-int    ibuflen _U_, *rbuflen;
+static int afp_null(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_,  size_t *rbuflen)
 {
     LOG(log_info, logtype_afpd, "afp_null handle %d", *ibuf );
     *rbuflen = 0;
@@ -65,7 +59,7 @@ int   ibuflen _U_, *rbuflen;
  * Routines marked "afp_null" are AFP functions
  * which are not yet implemented. A fine line...
  */
-int    (*preauth_switch[])() = {
+static AFPCmd preauth_switch[] = {
     NULL, NULL, NULL, NULL,
     NULL, NULL, NULL, NULL,                                    /*   0 -   7 */
     NULL, NULL, NULL, NULL,
@@ -132,9 +126,9 @@ int (*preauth_switch[])() = {
     NULL, NULL, NULL, NULL,                                    /* 248 - 255 */
 };
 
-int    (**afp_switch)() = preauth_switch;
+AFPCmd *afp_switch = preauth_switch;
 
-int    (*postauth_switch[])() = {
+AFPCmd postauth_switch[] = {
     NULL, afp_bytelock, afp_closevol, afp_closedir,
     afp_closefork, afp_copyfile, afp_createdir, afp_createfile,        /*   0 -   7 */
     afp_delete, afp_enumerate, afp_flush, afp_flushfork,
@@ -206,20 +200,20 @@ int       (*postauth_switch[])() = {
 /* add a new function if it's specified. return the old function in
  * "old" if there's a pointer there. */
 int uam_afpserver_action(const int id, const int which,
-                         int (*new)(), int (**old)())
+                         AFPCmd new_table, AFPCmd *old)
 {
     switch (which) {
     case UAM_AFPSERVER_PREAUTH:
         if (old)
             *old = preauth_switch[id];
-        if (new)
-            preauth_switch[id] = new;
+        if (new_table)
+            preauth_switch[id] = new_table;
         break;
     case UAM_AFPSERVER_POSTAUTH:
         if (old)
             *old = postauth_switch[id];
-        if (new)
-            postauth_switch[id] = new;
+        if (new_table)
+            postauth_switch[id] = new_table;
         break;
     default:
         LOG(log_debug, logtype_afpd, "uam_afpserver_action: unknown switch %d[%d]",