0
|
1 /*
|
|
2 * $Id: bcopy.c,v 1.5 2005/04/10 15:26:37 aonoto Exp $
|
|
3 */
|
|
4
|
|
5 /*
|
|
6 * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
|
|
7 * This file is part of FreeWnn.
|
|
8 *
|
|
9 * Copyright Kyoto University Research Institute for Mathematical Sciences
|
|
10 * 1987, 1988, 1989, 1990, 1991, 1992
|
|
11 * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
|
|
12 * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
|
|
13 * Copyright FreeWnn Project 1999, 2000, 2002
|
|
14 *
|
|
15 * Maintainer: FreeWnn Project <freewnn@tomo.gr.jp>
|
|
16 *
|
|
17 * This library is free software; you can redistribute it and/or
|
|
18 * modify it under the terms of the GNU Lesser General Public
|
|
19 * License as published by the Free Software Foundation; either
|
|
20 * version 2 of the License, or (at your option) any later version.
|
|
21 *
|
|
22 * This library is distributed in the hope that it will be useful,
|
|
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
25 * Lesser General Public License for more details.
|
|
26 *
|
|
27 * You should have received a copy of the GNU Lesser General Public
|
|
28 * License along with this library; if not, write to the
|
|
29 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
30 * Boston, MA 02111-1307, USA.
|
|
31 */
|
|
32
|
|
33 #ifdef HAVE_CONFIG_H
|
|
34 # include <config.h>
|
|
35 #endif
|
|
36
|
|
37 #include "commonhd.h"
|
|
38
|
|
39 #ifndef HAVE_BCOPY
|
|
40 void
|
|
41 bcopy (b1, b2, length)
|
|
42 unsigned char *b1, *b2;
|
|
43 int length;
|
|
44 {
|
|
45 if (length <= 0)
|
|
46 return;
|
|
47 if (b1 < b2 && b1 + length > b2)
|
|
48 {
|
|
49 b2 += length;
|
|
50 b1 += length;
|
|
51 while (length--)
|
|
52 {
|
|
53 *--b2 = *--b1;
|
|
54 }
|
|
55 }
|
|
56 else
|
|
57 {
|
|
58 memcpy (b2, b1, length);
|
|
59 }
|
|
60 }
|
|
61 #endif /* !HAVE_BCOPY */
|
|
62
|
|
63 #ifndef HAVE_BZERO
|
|
64 void
|
|
65 bzero (b, length)
|
|
66 unsigned char *b;
|
|
67 int length;
|
|
68 {
|
|
69 memset (b, 0, length);
|
|
70 }
|
|
71 #endif /* !HAVE_BZERO */
|
|
72
|
|
73 #ifndef HAVE_BCMP
|
|
74 int
|
|
75 bcmp (b1, b2, length)
|
|
76 unsigned char *b1;
|
|
77 unsigned char *b2;
|
|
78 int length;
|
|
79 {
|
|
80 if (length == 0)
|
|
81 return 0;
|
|
82 return memcmp (b1, b2, length);
|
|
83 }
|
|
84 #endif /* !HAVE_BCMP */
|