Go to the SVN repository for this file.
44 const char* end = (
const char*) memchr(
str,
'\0', maxlen);
45 returnend ? (size_t)(end -
str) : maxlen;
50 #if !defined(HAVE_STRDUP) && !defined(NCBI_COMPILER_MSVC) 53 size_t size= strlen(
str) + 1;
55 returnres ? (
char*) memcpy(res,
str,
size) : 0;
74 #if !defined(NCBI_COMPILER_MSVC) && !defined(HAVE_STRCASECMP) 79 const unsigned char* p1 = (
const unsigned char*) s1;
80 const unsigned char* p2 = (
const unsigned char*) s2;
89c1 =
'A'<= c1 && c1 <=
'Z'? c1 + (
'a'-
'A') :
tolower(c1);
90c2 =
'A'<= c2 && c2 <=
'Z'? c2 + (
'a'-
'A') :
tolower(c2);
91}
while(c1 && c1 == c2);
99 const unsigned char* p1 = (
const unsigned char*) s1;
100 const unsigned char* p2 = (
const unsigned char*) s2;
101 unsigned charc1, c2;
103 if(p1 == p2 ||
n== 0)
109c1 =
'A'<= c1 && c1 <=
'Z'? c1 + (
'a'-
'A') :
tolower(c1);
110c2 =
'A'<= c2 && c2 <=
'Z'? c2 + (
'a'-
'A') :
tolower(c2);
111}
while(--
n> 0 && c1 && c1 == c2);
122 for(
t= (
unsigned char*) s; *
t; ++
t)
131 for(
t= (
unsigned char*) s; *
t; ++
t)
137 char*
strncpy0(
char* s1,
const char* s2,
size_t n)
140 returnstrncat(s1, s2,
n);
147 unsigned char* p = (
unsigned char*) s;
149 for(
i= 0;
i<
n; ++
i) {
150 if(*p != (
unsigned char) c)
163 unsigned char* e = (
unsigned char*) s +
n;
165 for(
i= 0;
i<
n; ++
i) {
166 if(*--e == (
unsigned char) c)
174 static const double x_pow10[] = { 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7 };
188v =
f< 0.0 ? -
f:
f;
189x = (long)(v + 0.5 / w);
190y = (long)(w * (v - (
double) x) + 0.5);
192 returns + sprintf(s, &
"-%ld%s%.*lu"[!(
f< 0.0)], x, &
"."[!p], p, y);
204 while(
isspace((
unsigned char)(*s)))
206 if((*s ==
'-'|| *s ==
'+')
207&& (s[1] ==
'.'||
isdigit((
unsigned char) s[1]))) {
208 n= *s++ ==
'-'? 1
: 0
;
213x = strtol(s, &e, 10);
215 if(
isdigit((
unsigned char) e[1])) {
222y = strtoul(s, &e, 10);
230}
while(p >= (
int)(
sizeof(
x_pow10)/
sizeof(
x_pow10[0])));
238 return n? (double)(-x) - (double) y / w :
239(
double) x + (double) y / w;
240}
else if(
t&& e > s)
242}
else if(
t&& e > s)
244 return(
double)(
n? -x : x);
253 if(
isspace((
unsigned char) s[
n]))
265 static intx_HasClass(
const char* s,
size_t n,
int(*isa)(
int))
268 if(isa((
unsigned char) s[
n]))
static const char * str(char *buf, int n)
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
int NCBI_HasSpaces(const char *s, size_t n)
Return non-zero(true) if a block of memory based at "s" and of size "n" has any space characters (as ...
static const double x_pow10[]
double NCBI_simple_atof(const char *s, char **t)
Locale-independent ASCII-to-double conversion of string "s".
char * strncpy0(char *s1, const char *s2, size_t n)
Copy not more than "n" characters from string "s2" into "s1", and return the result,...
char * NCBI_simple_ftoa(char *s, double f, int p)
Locale-independent double-to-ASCII conversion of value "f" into a character buffer pointed to by "s",...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4