summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-06-10 07:25:18 +0000
committerderaadt <deraadt@openbsd.org>1996-06-10 07:25:18 +0000
commit01504f73f184a90277ae060f0f69e4962a100822 (patch)
tree029994f4b0c28753642bea9f291008d989bed3a2
parentmerge to latest libpcap (diff)
downloadwireguard-openbsd-01504f73f184a90277ae060f0f69e4962a100822.tar.xz
wireguard-openbsd-01504f73f184a90277ae060f0f69e4962a100822.zip
internationalize, 64 bit clean
-rw-r--r--sys/adosfs/adlookup.c13
-rw-r--r--sys/adosfs/adosfs.h37
-rw-r--r--sys/adosfs/adutil.c31
-rw-r--r--sys/adosfs/advfsops.c10
4 files changed, 53 insertions, 38 deletions
diff --git a/sys/adosfs/adlookup.c b/sys/adosfs/adlookup.c
index 5bd2e4aabd9..6ff6d17437b 100644
--- a/sys/adosfs/adlookup.c
+++ b/sys/adosfs/adlookup.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: adlookup.c,v 1.4 1996/04/21 22:14:33 deraadt Exp $ */
-/* $NetBSD: adlookup.c,v 1.13 1996/04/05 05:06:07 mhitch Exp $ */
+/* $OpenBSD: adlookup.c,v 1.5 1996/06/10 07:25:18 deraadt Exp $ */
+/* $NetBSD: adlookup.c,v 1.13.4.1 1996/05/27 09:53:50 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -41,11 +41,11 @@
#include <adosfs/adosfs.h>
#ifdef ADOSFS_EXACTMATCH
-#define strmatch(s1, l1, s2, l2) \
+#define strmatch(s1, l1, s2, l2, i) \
((l1) == (l2) && bcmp((s1), (s2), (l1)) == 0)
#else
-#define strmatch(s1, l1, s2, l2) \
- ((l1) == (l2) && strncasecmp((s1), (s2), (l1)) == 0)
+#define strmatch(s1, l1, s2, l2, i) \
+ ((l1) == (l2) && adoscaseequ((s1), (s2), (l1), (i)))
#endif
/*
@@ -214,7 +214,8 @@ adosfs_lookup(v)
adp->tabi[hval] = -adp->tabi[hval];
}
}
- if (strmatch(pelt, plen, ap->name, strlen(ap->name)))
+ if (strmatch(pelt, plen, ap->name, strlen(ap->name),
+ IS_INTER(adp->amp)))
goto found;
bn = ap->hashf;
vput(*vpp);
diff --git a/sys/adosfs/adosfs.h b/sys/adosfs/adosfs.h
index 6fd3fbe5083..82f6180ab71 100644
--- a/sys/adosfs/adosfs.h
+++ b/sys/adosfs/adosfs.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: adosfs.h,v 1.4 1996/04/21 22:14:36 deraadt Exp $ */
-/* $NetBSD: adosfs.h,v 1.10 1996/04/05 05:06:08 mhitch Exp $ */
+/* $OpenBSD: adosfs.h,v 1.5 1996/06/10 07:25:18 deraadt Exp $ */
+/* $NetBSD: adosfs.h,v 1.10.4.2 1996/05/27 10:21:26 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -36,9 +36,9 @@
* Amigados datestamp. (from 1/1/1978 00:00:00 local)
*/
struct datestamp {
- u_long days;
- u_long mins;
- u_long ticks; /* 20000 * (ticks % 50) = useconds */
+ u_int32_t days;
+ u_int32_t mins;
+ u_int32_t ticks; /* 20000 * (ticks % 50) = useconds */
/* ticks / 50 = seconds */
};
@@ -93,7 +93,7 @@ struct anode {
struct adosfsmount {
LIST_HEAD(anodechain, anode) anodetab[ANODEHASHSZ];
struct mount *mp; /* owner mount */
- u_long dostype; /* type of volume */
+ u_int32_t dostype; /* type of volume */
u_long rootb; /* root block number */
u_long secsperblk; /* sectors per block */
u_long bsize; /* size of blocks */
@@ -119,16 +119,16 @@ struct adosfsmount {
*/
#define BBOFF (0)
-#define BPT_SHORT (2)
-#define BPT_DATA (8)
-#define BPT_LIST (16)
+#define BPT_SHORT ((u_int32_t)2)
+#define BPT_DATA ((u_int32_t)8)
+#define BPT_LIST ((u_int32_t)16)
-#define BST_RDIR (1)
-#define BST_UDIR (2)
-#define BST_SLINK (3)
-#define BST_LDIR (4)
-#define BST_FILE (-3L)
-#define BST_LFILE (-4L)
+#define BST_RDIR ((u_int32_t)1)
+#define BST_UDIR ((u_int32_t)2)
+#define BST_SLINK ((u_int32_t)3)
+#define BST_LDIR ((u_int32_t)4)
+#define BST_FILE ((u_int32_t)-3)
+#define BST_LFILE ((u_int32_t)-4)
#define OFS_DATA_OFFSET (24)
@@ -136,12 +136,13 @@ struct adosfsmount {
* utility protos
*/
#ifndef m68k
-long adoswordn __P((struct buf *, int));
+u_int32_t adoswordn __P((struct buf *, int));
#else
-#define adoswordn(bp,wn) (*((long *)(bp)->b_data + (wn)))
+#define adoswordn(bp,wn) (*((u_int32_t *)(bp)->b_data + (wn)))
#endif
-long adoscksum __P((struct buf *, long));
+u_int32_t adoscksum __P((struct buf *, int));
+int adoscaseequ __P((const u_char *, const u_char *, int, int));
int adoshash __P((const u_char *, int, int, int));
int adunixprot __P((int));
int adosfs_getblktype __P((struct adosfsmount *, struct buf *));
diff --git a/sys/adosfs/adutil.c b/sys/adosfs/adutil.c
index 259c488b01e..a88f9349334 100644
--- a/sys/adosfs/adutil.c
+++ b/sys/adosfs/adutil.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: adutil.c,v 1.5 1996/05/02 13:05:14 deraadt Exp $ */
-/* $NetBSD: adutil.c,v 1.10 1996/04/23 05:18:29 veego Exp $ */
+/* $OpenBSD: adutil.c,v 1.6 1996/06/10 07:25:19 deraadt Exp $ */
+/* $NetBSD: adutil.c,v 1.10.4.2 1996/05/27 10:21:29 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -160,22 +160,35 @@ CapitalChar(ch, inter)
return(ch);
}
-long
+u_int32_t
adoscksum(bp, n)
struct buf *bp;
- long n;
+ int n;
{
- long sum, *lp;
+ u_int32_t sum, *lp;
- lp = (long *)bp->b_data;
+ lp = (u_int32_t *)bp->b_data;
sum = 0;
while (n--)
- sum += *lp++;
+ sum += ntohl(*lp++);
return(sum);
}
int
+adoscaseequ(name1, name2, len, inter)
+ const u_char *name1, *name2;
+ int len;
+{
+ while (len-- > 0)
+ if (CapitalChar(*name1++, inter) !=
+ CapitalChar(*name2++, inter))
+ return 0;
+
+ return 1;
+}
+
+int
adoshash(nam, namlen, nelt, inter)
const u_char *nam;
int namlen, nelt, inter;
@@ -211,7 +224,7 @@ tvtods(tvp, dsp)
#endif
#ifndef m68k
-long
+u_int32_t
adoswordn(bp, wn)
struct buf *bp;
int wn;
@@ -219,6 +232,6 @@ adoswordn(bp, wn)
/*
* ados stored in network (big endian) order
*/
- return(ntohl(*((long *)bp->b_data + wn)));
+ return(ntohl(*((u_int32_t *)bp->b_data + wn)));
}
#endif
diff --git a/sys/adosfs/advfsops.c b/sys/adosfs/advfsops.c
index 0b332d71c5e..612e81e8770 100644
--- a/sys/adosfs/advfsops.c
+++ b/sys/adosfs/advfsops.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: advfsops.c,v 1.6 1996/05/02 13:05:16 deraadt Exp $ */
-/* $NetBSD: advfsops.c,v 1.19 1996/04/28 06:18:12 mhitch Exp $ */
+/* $OpenBSD: advfsops.c,v 1.7 1996/06/10 07:25:19 deraadt Exp $ */
+/* $NetBSD: advfsops.c,v 1.19.4.1 1996/05/27 10:21:30 is Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -449,7 +449,7 @@ adosfs_vget(mp, an, vpp)
/*
* copy in name (from original block)
*/
- nam = bp->b_data + (ap->nwords - 20) * sizeof(long);
+ nam = bp->b_data + (ap->nwords - 20) * sizeof(u_int32_t);
namlen = *(u_char *)nam++;
if (namlen > 30) {
#ifdef DIAGNOSTIC
@@ -581,8 +581,8 @@ adosfs_loadbitmap(amp)
break;
if (adoscksum(mapbp, amp->nwords)) {
#ifdef DIAGNOSTIC
- printf("adosfs: loadbitmap - cksum of blk %ld failed\n",
- adoswordn(bp, blkix));
+ printf("adosfs: loadbitmap - cksum of blk %d failed\n",
+ adoswordn(bp, blkix));
#endif
/* XXX Force read-only? Set free space 0? */
break;