Remove DUX/OSF code
[openafs.git] / src / fsint / afsaux.c
index ecde217..3eeca5a 100644 (file)
@@ -1,21 +1,15 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
-RCSID
-    ("$Header$");
 
 #ifdef KERNEL
 #if defined(UKERNEL)
@@ -23,12 +17,14 @@ RCSID
 #include "afsincludes.h"
 #include "rx/xdr.h"
 #else /* defined(UKERNEL) */
-#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_NBSD50_ENV)
+#include "afs/afs_osi.h"
+#endif
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #else
 #include "h/types.h"
-#include "rpc/types.h"
 #include "rx/xdr.h"
 #endif
 #if !defined(AFS_ALPHA_ENV)
@@ -42,6 +38,7 @@ RCSID
 #endif /* defined(UKERNEL) */
 #include "afsint.h"
 #else /* KERNEL */
+# include <roken.h>
 # include <rx/xdr.h>
 # include "afsint.h"
 #endif /* KERNEL */
@@ -60,45 +57,8 @@ static afs_int32 bslosers = 0;
     only for the kernel system.  Later, when R is expunged, we'll remove the ifdef */
 #ifdef KERNEL
 #ifndef AFS_USR_DARWIN_ENV
-#ifdef AFS_AIXNFS11
-#define        AUTH_DES 1
-#endif
-#if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV)
-#ifndef        AFS_AIX32_ENV
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
 /*
- * XDR chars; from user mode xdr package.
- */
-bool_t
-xdr_char(register XDR * xdrs, char *sp)
-{
-    afs_int32 l;
-
-    switch (xdrs->x_op) {
-
-    case XDR_ENCODE:
-       l = (afs_int32) * sp;
-       return (XDR_PUTINT32(xdrs, &l));
-
-    case XDR_DECODE:
-       if (!XDR_GETINT32(xdrs, &l)) {
-           return (FALSE);
-       }
-       *sp = (char)l;
-       return (TRUE);
-
-    case XDR_FREE:
-       return (TRUE);
-    }
-    return (FALSE);
-}
-#endif /* AFS_HPUX110_ENV && AFS_LINUX20_ENV */
-#endif
-#endif /* defined(AFS_AIX_ENV) && !defined(AUTH_DES) */
-
-
-/* 
- * Wrapper for xdr_string that can be called directly from 
+ * Wrapper for xdr_string that can be called directly from
  * routines like clnt_call; from user-mode xdr package.
  */
 #ifndef        AFS_SUN5_ENV
@@ -114,32 +74,6 @@ xdr_wrapstring(XDR * xdrs, char **cpp)
 #endif /* AFS_HPUX110_ENV */
 #endif /* AFS_SUN5_ENV */
 
-/*
- * xdr_vector():
- *
- * XDR a fixed length array. Unlike variable-length arrays,
- * the storage of fixed length arrays is static and unfreeable.
- * > basep: base of the array
- * > size: size of the array
- * > elemsize: size of each element
- * > xdr_elem: routine to XDR each element
- */
-bool_t
-xdr_vector(register XDR * xdrs, register char *basep, register u_int nelem,
-          register u_int elemsize, register xdrproc_t xdr_elem)
-{
-    register u_int i;
-    register char *elptr;
-
-    elptr = basep;
-    for (i = 0; i < nelem; i++) {
-       if (!(*xdr_elem) (xdrs, elptr, (u_int) (~0))) {
-           return (FALSE);
-       }
-       elptr += elemsize;
-    }
-    return (TRUE);
-}
 #endif
 #endif /* KERNEL */
 
@@ -164,7 +98,7 @@ xdr_CBS(XDR * x, struct CBS * abbs)
            return FALSE;
        }
        if (!abbs->SeqBody)
-           abbs->SeqBody = (char *)NVALLOC(len);
+           abbs->SeqBody = NVALLOC(len);
        abbs->SeqLen = len;
        xdr_opaque(x, abbs->SeqBody, len);
        return TRUE;
@@ -193,7 +127,7 @@ xdr_BBS(XDR * x, struct BBS * abbs)
            return FALSE;
        }
        if (!abbs->SeqBody)
-           abbs->SeqBody = (char *)NVALLOC(maxLen);
+           abbs->SeqBody = NVALLOC(maxLen);
        abbs->MaxSeqLen = maxLen;
        abbs->SeqLen = len;
        xdr_opaque(x, abbs->SeqBody, len);
@@ -223,7 +157,7 @@ xdr_AFSAccessList(XDR * x, AFSAccessList * abbs)
            return FALSE;
        }
        if (!abbs->SeqBody)
-           abbs->SeqBody = (char *)NVALLOC(maxLen);
+           abbs->SeqBody = NVALLOC(maxLen);
        abbs->MaxSeqLen = maxLen;
        abbs->SeqLen = len;
        xdr_opaque(x, abbs->SeqBody, len);