aboutsummaryrefslogtreecommitdiffstats
path: root/indep.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-25 16:11:07 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-25 16:11:07 +0000
commit6ab6376f3198c02173985290c5f0dff2a8210abd (patch)
treebe3d6db198738b6f5d0b822818a8d56614985533 /indep.c
parent[w3m-dev 02727] (diff)
downloadw3m-6ab6376f3198c02173985290c5f0dff2a8210abd.tar.gz
w3m-6ab6376f3198c02173985290c5f0dff2a8210abd.zip
[w3m-dev 02725] bcopy, bzero
From: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
Diffstat (limited to 'indep.c')
-rw-r--r--indep.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/indep.c b/indep.c
index 95f89f8..13f1a30 100644
--- a/indep.c
+++ b/indep.c
@@ -1,4 +1,4 @@
-/* $Id: indep.c,v 1.18 2001/12/14 17:10:54 ukai Exp $ */
+/* $Id: indep.c,v 1.19 2001/12/25 16:11:07 ukai Exp $ */
#include "fm.h"
#include <stdio.h>
#include <pwd.h>
@@ -11,6 +11,32 @@
#include "myctype.h"
#include "entity.h"
+#ifndef HAVE_BCOPY
+void
+bcopy(void *src, void *dest, int len)
+{
+ int i;
+ if (src == dest)
+ return;
+ if (src < dest) {
+ for (i = len - 1; i >= 0; i--)
+ dest[i] = src[i];
+ }
+ else { /* src > dest */
+ for (i = 0; i < len; i++)
+ dest[i] = src[i];
+ }
+}
+
+void
+bzero(void *ptr, int len)
+{
+ int i;
+ for (i = 0; i < len; i++)
+ *(ptr++) = 0;
+}
+#endif /* not HAVE_BCOPY */
+
char *
allocStr(const char *s, int len)
{