1 ################################################################################
5 ## $Date: 2010/03/07 13:15:46 +0100 $
7 ################################################################################
9 ## Version 3.x, Copyright (C) 2004-2010, Marcus Holland-Moritz.
10 ## Version 2.x, Copyright (C) 2001, Paul Marquess.
11 ## Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
13 ## This program is free software; you can redistribute it and/or
14 ## modify it under the same terms as Perl itself.
16 ################################################################################
25 __UNDEFINED__ memNE(s1,s2,l) (memcmp(s1,s2,l))
26 __UNDEFINED__ memEQ(s1,s2,l) (!memcmp(s1,s2,l))
28 __UNDEFINED__ memNE(s1,s2,l) (bcmp(s1,s2,l))
29 __UNDEFINED__ memEQ(s1,s2,l) (!bcmp(s1,s2,l))
32 __UNDEFINED__ memEQs(s1, l, s2) \
33 (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
34 __UNDEFINED__ memNEs(s1, l, s2) !memEQs(s1, l, s2)
36 __UNDEFINED__ MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
37 __UNDEFINED__ CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
39 __UNDEFINED__ ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
41 __UNDEFINED__ ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
44 __UNDEFINED__ PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
45 __UNDEFINED__ PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
46 __UNDEFINED__ PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
47 __UNDEFINED__ Poison(d,n,t) PoisonFree(d,n,t)
49 __UNDEFINED__ Newx(v,n,t) New(0,v,n,t)
50 __UNDEFINED__ Newxc(v,n,t,c) Newc(0,v,n,t,c)
51 __UNDEFINED__ Newxz(v,n,t) Newz(0,v,n,t)
63 CopyD("Hello", p, 6, char);
64 if (memEQ(p, "Hello", 6))
67 if (memEQ(p, "\0\0\0\0\0\0", 6))
69 if (memEQs(p, 6, "\0\0\0\0\0\0"))
72 if (memNE(p, "\0\0\0\0\0\0", 6))
74 if (memNEs(p, 6, "\0\0\0\0\0\0"))
79 if (memEQ(p, "\0\0\0\0\0\0", 6))
83 Newxc(p, 3, short, char);
91 ok(Devel::PPPort::checkmem(), 6);