/
index
/
libcext.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switch the "namespace" to "lce"
[libcext.git]
/
strtonum.h
diff --git
a/strtonum.h
b/strtonum.h
index 471aea8b4bf7b766edc4d965433488946b44162b..f192630b1e5a8bff4bf1b3e04da79749ec828ff6 100644
(file)
--- a/
strtonum.h
+++ b/
strtonum.h
@@
-16,28
+16,28
@@
*/
/* https://git.datadissipation.net */
*/
/* https://git.datadissipation.net */
-#ifndef
STRTONUM_H_
- #define
STRTONUM_H_
1
+#ifndef
LCE_STRTONUM_H
+ #define
LCE_STRTONUM_H
1
- #ifdef STRTONUM_INCLUDE_LIBC
+ #ifdef
LCE_
STRTONUM_INCLUDE_LIBC
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
- #endif /* STRTONUM_INCLUDE_LIBC */
+ #endif /*
LCE_
STRTONUM_INCLUDE_LIBC */
#ifndef HAVE_STRTONUM
#ifndef HAVE_STRTONUM
- #define strtonum
i
_strtonum_
-long long
i
_strtonum_(const char *numstr, long long minval, long long maxval,
+ #define strtonum
lce
_strtonum_
+long long
lce
_strtonum_(const char *numstr, long long minval, long long maxval,
const char **errstrp);
#endif /* !HAVE_STRTONUM */
const char **errstrp);
#endif /* !HAVE_STRTONUM */
- #ifdef STRTONUM_IMPLEMENTATION
- #define
I_INVALID_
1
- #define
I_TOOSMALL_
2
- #define
I_TOOLARGE_
3
+ #ifdef
LCE_
STRTONUM_IMPLEMENTATION
+ #define
LCE_INVALID_
1
+ #define
LCE_TOOSMALL_
2
+ #define
LCE_TOOLARGE_
3
long long
long long
-
i
_strtonum_(const char *numstr, long long minval, long long maxval,
+
lce
_strtonum_(const char *numstr, long long minval, long long maxval,
const char **errstrp)
{
long long ll = 0;
const char **errstrp)
{
long long ll = 0;
@@
-56,15
+56,15
@@
i_strtonum_(const char *numstr, long long minval, long long maxval,
ev[0].err = errno;
errno = 0;
if (minval > maxval) {
ev[0].err = errno;
errno = 0;
if (minval > maxval) {
- error =
I
_INVALID_;
+ error =
LCE
_INVALID_;
} else {
ll = strtoll(numstr, &ep, 10);
if (numstr == ep || *ep != '\0')
} else {
ll = strtoll(numstr, &ep, 10);
if (numstr == ep || *ep != '\0')
- error =
I
_INVALID_;
+ error =
LCE
_INVALID_;
else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval)
else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval)
- error =
I
_TOOSMALL_;
+ error =
LCE
_TOOSMALL_;
else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval)
else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval)
- error =
I
_TOOLARGE_;
+ error =
LCE
_TOOLARGE_;
}
if (errstrp != NULL)
*errstrp = ev[error].errstr;
}
if (errstrp != NULL)
*errstrp = ev[error].errstr;
@@
-74,5
+74,5
@@
i_strtonum_(const char *numstr, long long minval, long long maxval,
return (ll);
}
return (ll);
}
- #endif /* STRTONUM_IMPLEMENTATION */
-#endif /* !
STRTONUM_H_
*/
+ #endif /*
LCE_
STRTONUM_IMPLEMENTATION */
+#endif /* !
LCE_STRTONUM_H
*/