4 Original GPL release version 4.12
5 Copyright 1993-2000 Jonathan Potter
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 All users of Directory Opus 4 (including versions distributed
22 under the GPL) are entitled to upgrade to the latest version of
23 Directory Opus version 5 at a reduced price. Please see
24 http://www.gpsoft.com.au for more information.
26 The release of Directory Opus 4 under the GPL in NO WAY affects
27 the existing commercial status of Directory Opus 5.
33 __saveds
int DoStrCombine(register char *buf
__asm("a0"),
34 register char *one
__asm("a1"),
35 register char *two
__asm("a2"),
36 register int lim
__asm("d0"))
40 a
=strlen(one
); if (a
>=lim
) a
=lim
-1;
41 LStrnCpy(buf
,one
,a
); buf
[a
]=0;
42 return(DoStrConcat(buf
,two
,lim
));
45 __saveds
int DoStrConcat(register char *buf
__asm("a0"),
46 register char *cat
__asm("a1"),
47 register int lim
__asm("d0"))
51 a
=strlen(cat
); b
=strlen(buf
);
54 LStrnCpy(&buf
[b
],cat
,a
); buf
[b
+a
]=0;
57 if (lim
>b
) LStrnCpy(&buf
[b
],cat
,lim
-b
);
62 __saveds
int DoAtoh(register unsigned char *buf
__asm("a0"),
63 register int len
__asm("d0"))
69 if (!buf
[a
] || !((buf
[a
]>='0' && buf
[a
]<='9') || (buf
[a
]>='a' && buf
[a
]<='f') ||
70 (buf
[a
]>='A' && buf
[a
]<='F'))) break;
71 if ((++e
)==len
) break;
75 for (a
=1;a
<e
;a
++) f
*=16;
77 if (buf
[a
]>='0' && buf
[a
]<='9') d
=buf
[a
]-'0';
78 else if (buf
[a
]>='A' && buf
[a
]<='F') d
=10+(buf
[a
]-'A');
79 else if (buf
[a
]>='a' && buf
[a
]<='f') d
=10+(buf
[a
]-'a');