Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
637
Issues
637
List
Boards
Labels
Service Desk
Milestones
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
BIND
Commits
21f17946
Commit
21f17946
authored
Jun 24, 2003
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1474. [port] Provide strtoul() and memmove() for platforms
without them.
parent
de90c0b2
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
402 additions
and
23 deletions
+402
-23
CHANGES
CHANGES
+3
-0
bin/dig/host.c
bin/dig/host.c
+2
-2
bin/tests/genrandom.c
bin/tests/genrandom.c
+3
-2
bin/tests/serial_test.c
bin/tests/serial_test.c
+2
-2
configure
configure
+183
-1
configure.in
configure.in
+11
-1
lib/dns/rdata.c
lib/dns/rdata.c
+2
-1
lib/isc/Makefile.in
lib/isc/Makefile.in
+4
-4
lib/isc/include/isc/platform.h.in
lib/isc/include/isc/platform.h.in
+11
-1
lib/isc/include/isc/stdlib.h
lib/isc/include/isc/stdlib.h
+38
-0
lib/isc/include/isc/string.h
lib/isc/include/isc/string.h
+5
-1
lib/isc/parseint.c
lib/isc/parseint.c
+2
-2
lib/isc/print.c
lib/isc/print.c
+2
-2
lib/isc/strtoul.c
lib/isc/strtoul.c
+127
-0
lib/isccc/cc.c
lib/isccc/cc.c
+5
-4
util/copyrights
util/copyrights
+2
-0
No files found.
CHANGES
View file @
21f17946
1474. [port] Provide strtoul() and memmove() for platforms
without them.
1473. [bug] free_map() and free_string() failed to handle out
of memory cleanup. [RT #6813]
...
...
bin/dig/host.c
View file @
21f17946
...
...
@@ -15,10 +15,9 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: host.c,v 1.9
1 2002/12/11 06:31:37
marka Exp $ */
/* $Id: host.c,v 1.9
2 2003/06/24 05:10:31
marka Exp $ */
#include <config.h>
#include <stdlib.h>
#include <limits.h>
#include <isc/app.h>
...
...
@@ -28,6 +27,7 @@
#include <isc/string.h>
#include <isc/util.h>
#include <isc/task.h>
#include <isc/stdlib.h>
#include <dns/byaddr.h>
#include <dns/fixedname.h>
...
...
bin/tests/genrandom.c
View file @
21f17946
...
...
@@ -15,14 +15,15 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: genrandom.c,v 1.
9 2002/12/04 01:19:28
marka Exp $ */
/* $Id: genrandom.c,v 1.
10 2003/06/24 05:10:31
marka Exp $ */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <isc/stdlib.h>
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
int
bytes
;
...
...
bin/tests/serial_test.c
View file @
21f17946
...
...
@@ -15,14 +15,14 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: serial_test.c,v 1.1
1 2001/11/27 01:55:22 gson
Exp $ */
/* $Id: serial_test.c,v 1.1
2 2003/06/24 05:10:31 marka
Exp $ */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <isc/serial.h>
#include <isc/stdlib.h>
int
main
()
{
...
...
configure
View file @
21f17946
#! /bin/sh
# From configure.in Revision: 1.34
2
.
# From configure.in Revision: 1.34
3
.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
#
...
...
@@ -12946,6 +12946,186 @@ fi
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
conftest.
$ac_ext
echo
"
$as_me
:
$LINENO
: checking for memmove"
>
&5
echo
$ECHO_N
"checking for memmove...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_func_memmove
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
#line
$LINENO
"configure"
#include "confdefs.h"
/* From autoconf 2.57 */
/* Define memmove to an innocuous variant, in case <limits.h> declares memmove.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define memmove innocuous_memmove
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char memmove (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef memmove
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char memmove ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_memmove) || defined (__stub___memmove)
choke me
#else
char (*f) () = memmove;
#endif
#ifdef __cplusplus
}
#endif
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
return f != memmove;
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'test -s conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_func_memmove
=
yes
else
echo
"
$as_me
: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
ac_cv_func_memmove
=
no
fi
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
conftest.
$ac_ext
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_func_memmove
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_func_memmove
"
>
&6
if
test
$ac_cv_func_memmove
=
yes
;
then
ISC_PLATFORM_NEEDMEMMOVE
=
"#undef ISC_PLATFORM_NEEDMEMMOVE"
else
ISC_PLATFORM_NEEDMEMMOVE
=
"#define ISC_PLATFORM_NEEDMEMMOVE 1"
fi
echo
"
$as_me
:
$LINENO
: checking for strtoul"
>
&5
echo
$ECHO_N
"checking for strtoul...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_func_strtoul
+set
}
"
=
set
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
#line
$LINENO
"configure"
#include "confdefs.h"
/* From autoconf 2.57 */
/* Define strtoul to an innocuous variant, in case <limits.h> declares strtoul.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define strtoul innocuous_strtoul
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strtoul (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef strtoul
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char strtoul ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_strtoul) || defined (__stub___strtoul)
choke me
#else
char (*f) () = strtoul;
#endif
#ifdef __cplusplus
}
#endif
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
return f != strtoul;
;
return 0;
}
_ACEOF
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'test -s conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_func_strtoul
=
yes
else
echo
"
$as_me
: failed program was:"
>
&5
cat
conftest.
$ac_ext
>
&5
ac_cv_func_strtoul
=
no
fi
rm
-f
conftest.
$ac_objext
conftest
$ac_exeext
conftest.
$ac_ext
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_func_strtoul
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_func_strtoul
"
>
&6
if
test
$ac_cv_func_strtoul
=
yes
;
then
ISC_PLATFORM_NEEDSTRTOUL
=
"#undef ISC_PLATFORM_NEEDSTRTOUL"
else
ISC_PLATFORM_NEEDSTRTOUL
=
"#define ISC_PLATFORM_NEEDSTRTOUL 1"
fi
echo
"
$as_me
:
$LINENO
: checking for strlcpy"
>
&5
echo
$ECHO_N
"checking for strlcpy...
$ECHO_C
"
>
&6
if
test
"
${
ac_cv_func_strlcpy
+set
}
"
=
set
;
then
...
...
@@ -15406,6 +15586,8 @@ s,@ISC_LWRES_GETIPNODEPROTO@,$ISC_LWRES_GETIPNODEPROTO,;t t
s,@ISC_LWRES_GETADDRINFOPROTO@,
$ISC_LWRES_GETADDRINFOPROTO
,;t t
s,@ISC_LWRES_GETNAMEINFOPROTO@,
$ISC_LWRES_GETNAMEINFOPROTO
,;t t
s,@ISC_PLATFORM_NEEDSTRSEP@,
$ISC_PLATFORM_NEEDSTRSEP
,;t t
s,@ISC_PLATFORM_NEEDMEMMOVE@,
$ISC_PLATFORM_NEEDMEMMOVE
,;t t
s,@ISC_PLATFORM_NEEDSTRTOUL@,
$ISC_PLATFORM_NEEDSTRTOUL
,;t t
s,@ISC_PLATFORM_NEEDSTRLCPY@,
$ISC_PLATFORM_NEEDSTRLCPY
,;t t
s,@ISC_PLATFORM_NEEDSTRLCAT@,
$ISC_PLATFORM_NEEDSTRLCAT
,;t t
s,@ISC_PLATFORM_NEEDVSNPRINTF@,
$ISC_PLATFORM_NEEDVSNPRINTF
,;t t
...
...
configure.in
View file @
21f17946
...
...
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.34
2
$)
AC_REVISION($Revision: 1.34
3
$)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
...
...
@@ -1575,6 +1575,16 @@ AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
AC_CHECK_FUNC(memmove,
[ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
[ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
AC_CHECK_FUNC(strtoul,
[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"],
[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
AC_CHECK_FUNC(strlcpy,
[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
[ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
...
...
lib/dns/rdata.c
View file @
21f17946
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.c,v 1.17
4 2003/04/11 07:25:25
marka Exp $ */
/* $Id: rdata.c,v 1.17
5 2003/06/24 05:10:32
marka Exp $ */
#include <config.h>
#include <ctype.h>
...
...
@@ -27,6 +27,7 @@
#include <isc/parseint.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/stdlib.h>
#include <isc/util.h>
#include <dns/callbacks.h>
...
...
lib/isc/Makefile.in
View file @
21f17946
...
...
@@ -13,7 +13,7 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.7
6 2002/10/24 03:52
:32 marka Exp $
# $Id: Makefile.in,v 1.7
7 2003/06/24 05:10
:32 marka Exp $
srcdir
=
@srcdir@
VPATH
=
@srcdir@
...
...
@@ -57,8 +57,8 @@ OBJS = @ISC_EXTRA_OBJS@ \
mem.@O@ mutexblock.@O@ netaddr.@O@ netscope.@O@ ondestroy.@O@
\
parseint.@O@ quota.@O@ random.@O@
\
ratelimiter.@O@ region.@O@ result.@O@ rwlock.@O@
\
serial.@O@ sha1.@O@ sockaddr.@O@ string.@O@ s
ymtab
.@O@
\
task.@O@ taskpool.@O@ timer.@O@ version.@O@
\
serial.@O@ sha1.@O@ sockaddr.@O@ string.@O@ s
trtoul
.@O@
\
symtab.@O@
task.@O@ taskpool.@O@ timer.@O@ version.@O@
\
${UNIXOBJS}
${NLSOBJS}
${THREADOBJS}
# Alphabetically
...
...
@@ -70,7 +70,7 @@ SRCS = @ISC_EXTRA_SRCS@ \
md5.c mem.c mutexblock.c netaddr.c netscope.c ondestroy.c
\
parseint.c quota.c random.c
\
ratelimiter.c result.c rwlock.c
\
serial.c sha1.c sockaddr.c string.c symtab.c
\
serial.c sha1.c sockaddr.c string.c s
trtoul.c s
ymtab.c
\
task.c taskpool.c timer.c version.c
LIBS
=
@LIBS@
...
...
lib/isc/include/isc/platform.h.in
View file @
21f17946
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: platform.h.in,v 1.3
1 2003/04/10 04:46:27
marka Exp $ */
/* $Id: platform.h.in,v 1.3
2 2003/06/24 05:10:33
marka Exp $ */
#ifndef ISC_PLATFORM_H
#define ISC_PLATFORM_H 1
...
...
@@ -195,6 +195,16 @@
*/
@ISC_PLATFORM_HAVEIFNAMETOINDEX@
/*
* Define if this system needs strtoul.
*/
@ISC_PLATFORM_NEEDSTRTOUL@
/*
* Define if this system needs memmove.
*/
@ISC_PLATFORM_NEEDMEMMOVE@
#ifndef ISC_PLATFORM_USEDECLSPEC
#define LIBISC_EXTERNAL_DATA
#define LIBDNS_EXTERNAL_DATA
...
...
lib/isc/include/isc/stdlib.h
0 → 100644
View file @
21f17946
/*
* Copyright (C) 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: stdlib.h,v 1.1 2003/06/24 05:10:33 marka Exp $ */
#ifndef ISC_STDLIB_H
#define ISC_STDLIB_H 1
#include <stdlib.h>
#include <isc/lang.h>
#include <isc/platform.h>
#ifdef ISC_PLATFORM_NEEDSTRTOUL
#define strtoul isc_strtoul
#endif
ISC_LANG_BEGINDECLS
unsigned
long
isc_strtoul
(
const
char
*
,
char
**
,
int
);
ISC_LANG_ENDDECLS
#endif
lib/isc/include/isc/string.h
View file @
21f17946
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: string.h,v 1.1
0 2003/04/10 04:46:27
marka Exp $ */
/* $Id: string.h,v 1.1
1 2003/06/24 05:10:33
marka Exp $ */
#ifndef ISC_STRING_H
#define ISC_STRING_H 1
...
...
@@ -51,6 +51,10 @@ isc_string_separate(char **stringp, const char *delim);
#define strsep isc_string_separate
#endif
#ifdef ISC_PLATFORM_NEEDMEMMOVE
#define memmove(a,b,c) bcopy(b,a,c)
#endif
size_t
isc_string_strlcpy
(
char
*
dst
,
const
char
*
src
,
size_t
size
);
...
...
lib/isc/parseint.c
View file @
21f17946
...
...
@@ -15,17 +15,17 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parseint.c,v 1.
2 2002/02/28 20:08:05 bwelling
Exp $ */
/* $Id: parseint.c,v 1.
3 2003/06/24 05:10:32 marka
Exp $ */
#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <isc/parseint.h>
#include <isc/result.h>
#include <isc/stdlib.h>
isc_result_t
isc_parse_uint32
(
isc_uint32_t
*
uip
,
const
char
*
string
,
int
base
)
{
...
...
lib/isc/print.c
View file @
21f17946
...
...
@@ -15,13 +15,12 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: print.c,v 1.2
3 2003/02/25 21:32:07
marka Exp $ */
/* $Id: print.c,v 1.2
4 2003/06/24 05:10:32
marka Exp $ */
#include <config.h>
#include <ctype.h>
#include <stdio.h>
/* for sprintf */
#include <stdlib.h>
#define ISC__PRINT_SOURCE
/* Used to get the isc_print_* prototypes. */
...
...
@@ -29,6 +28,7 @@
#include <isc/int.h>
#include <isc/msgs.h>
#include <isc/print.h>
#include <isc/stdlib.h>
#include <isc/util.h>
/*
...
...
lib/isc/strtoul.c
0 → 100644
View file @
21f17946
/*
* Portions Copyright (C) 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static
char
sccsid
[]
=
"@(#)strtoul.c 8.1 (Berkeley) 6/4/93"
;
#endif
/* LIBC_SCCS and not lint */
/* $Id: strtoul.c,v 1.1 2003/06/24 05:10:32 marka Exp $ */
#include <config.h>
#include <limits.h>
#include <ctype.h>
#include <errno.h>
#include <isc/stdlib.h>
/*
* Convert a string to an unsigned long integer.
*
* Ignores `locale' stuff. Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
unsigned
long
isc_strtoul
(
const
char
*
nptr
,
char
**
endptr
,
int
base
)
{
const
char
*
s
=
nptr
;
unsigned
long
acc
;
unsigned
char
c
;
unsigned
long
cutoff
;
int
neg
=
0
,
any
,
cutlim
;
/*
* See strtol for comments as to the logic used.
*/
do
{
c
=
*
s
++
;
}
while
(
isspace
(
c
));
if
(
c
==
'-'
)
{
neg
=
1
;
c
=
*
s
++
;
}
else
if
(
c
==
'+'
)
c
=
*
s
++
;
if
((
base
==
0
||
base
==
16
)
&&
c
==
'0'
&&
(
*
s
==
'x'
||
*
s
==
'X'
))
{
c
=
s
[
1
];
s
+=
2
;
base
=
16
;
}
if
(
base
==
0
)
base
=
c
==
'0'
?
8
:
10
;
cutoff
=
(
unsigned
long
)
ULONG_MAX
/
(
unsigned
long
)
base
;
cutlim
=
(
unsigned
long
)
ULONG_MAX
%
(
unsigned
long
)
base
;
for
(
acc
=
0
,
any
=
0
;;
c
=
*
s
++
)
{
if
(
!
isascii
(
c
))
break
;
if
(
isdigit
(
c
))
c
-=
'0'
;
else
if
(
isalpha
(
c
))
c
-=
isupper
(
c
)
?
'A'
-
10
:
'a'
-
10
;
else
break
;
if
(
c
>=
base
)
break
;
if
(
any
<
0
||
acc
>
cutoff
||
(
acc
==
cutoff
&&
c
>
cutlim
))
any
=
-
1
;
else
{
any
=
1
;
acc
*=
base
;
acc
+=
c
;
}
}
if
(
any
<
0
)
{
acc
=
ULONG_MAX
;
errno
=
ERANGE
;
}
else
if
(
neg
)
acc
=
-
acc
;
if
(
endptr
!=
0
)
*
endptr
=
(
char
*
)(
any
?
s
-
1
:
nptr
);
return
(
acc
);
}
lib/isccc/cc.c
View file @
21f17946
...
...
@@ -16,20 +16,21 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cc.c,v 1.
7 2003/04/11 07:25:28
marka Exp $ */
/* $Id: cc.c,v 1.
8 2003/06/24 05:10:34
marka Exp $ */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <isccc/alist.h>
#include <isc/assertions.h>
#include <isc/hmacmd5.h>
#include <isc/stdlib.h>
#include <isccc/alist.h>
#include <isccc/base64.h>
#include <isccc/cc.h>
#include <isc/hmacmd5.h>
#include <isccc/result.h>
#include <isccc/sexpr.h>
#include <isccc/symtab.h>
...
...
util/copyrights
View file @
21f17946
...
...
@@ -1926,6 +1926,7 @@
./lib/isc/include/isc/sockaddr.h C 1998,1999,2000,2001,2002
./lib/isc/include/isc/socket.h C 1998,1999,2000,2001
./lib/isc/include/isc/stdio.h C 2000,2001
./lib/isc/include/isc/stdlib.h C 2003
./lib/isc/include/isc/string.h C 2000,2001
./lib/isc/include/isc/symtab.h C 1996,1997,1998,1999,2000,2001
./lib/isc/include/isc/task.h C 1998,1999,2000,2001
...
...
@@ -1988,6 +1989,7 @@
./lib/isc/sha1.c C 2000,2001
./lib/isc/sockaddr.c C 1999,2000,2001,2002
./lib/isc/string.c C 1999,2000,2001
./lib/isc/strtoul.c C.PORTION 2003
./lib/isc/symtab.c C 1996,1997,1998,1999,2000,2001
./lib/isc/task.c C 1998,1999,2000,2001
./lib/isc/task_p.h C 2000,2001
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.