]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/uam.c
Cleanup header checks in configure.in
[netatalk.git] / etc / afpd / uam.c
index 1b71fc9bebacc3d856e779e14965fdee68b4ec3c..18f57ea1eef7bfe0cecfc0211a6bc4c6e21faac5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam.c,v 1.34 2009-11-08 01:01:43 didg Exp $
+ * $Id: uam.c,v 1.35 2009-11-08 01:15:31 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
 
 #include <stdio.h>
 #include <stdlib.h>
-
-/* STDC check */
-#if STDC_HEADERS
 #include <string.h>
-#else /* STDC_HEADERS */
-#ifndef HAVE_STRCHR
-#define strchr index
-#define strrchr index
-#endif /* HAVE_STRCHR */
-char *strchr (), *strrchr ();
-#ifndef HAVE_MEMCPY
-#define memcpy(d,s,n) bcopy ((s), (d), (n))
-#define memmove(d,s,n) bcopy ((s), (d), (n))
-#endif /* ! HAVE_MEMCPY */
-#endif /* STDC_HEADERS */
-
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
 #include <ctype.h>
 #include <atalk/logger.h>
 #include <sys/param.h>
@@ -363,7 +344,7 @@ int uam_afpserver_option(void *private, const int what, void *option,
 
     switch (what) {
     case UAM_OPTION_USERNAME:
-        *buf = obj->username;
+        *buf = &(obj->username[0]);
         if (len)
             *len = sizeof(obj->username) - 1;
         break;
@@ -428,7 +409,7 @@ int uam_afpserver_option(void *private, const int what, void *option,
     {
         struct DSI *dsi = obj->handle;
         const struct sockaddr *sa;
-        char hbuf[NI_MAXHOST];
+        static char hbuf[NI_MAXHOST];
         
         sa = (struct sockaddr *)&dsi->client;
         if (getnameinfo(sa, sizeof(dsi->client), hbuf, sizeof(hbuf), NULL, 0, 0) == 0)
@@ -491,6 +472,7 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen,
     if (!obj)
         return AFPERR_PARAM;
 
+#ifndef NO_DDP
     switch (obj->proto) {
     case AFPPROTO_ASP:
         if ((len = asp_wrtcont(obj->handle, buf, buflen )) < 0)
@@ -499,6 +481,7 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen,
         break;
 
     case AFPPROTO_DSI:
+#endif
         len = dsi_writeinit(obj->handle, buf, *buflen);
         if (!len || ((len = action(handle, buf, len)) < 0)) {
             dsi_writeflush(obj->handle);
@@ -511,8 +494,10 @@ int uam_afp_read(void *handle, char *buf, size_t *buflen,
                 goto uam_afp_read_err;
             }
         }
+#ifndef NO_DDP
         break;
     }
+#endif
     return 0;
 
 uam_afp_read_err:
@@ -573,7 +558,8 @@ int uam_sia_validate_user(sia_collect_func_t * collect, int argc, char **argv,
 
 /* --- papd-specific functions (just placeholders) --- */
 struct papfile;
-void append(struct papfile *pf  _U_, const char *data _U_, int len _U_)
+
+UAM_MODULE_EXPORT void append(struct papfile *pf  _U_, const char *data _U_, int len _U_)
 {
     return;
 }