Remove tabs in firmware path (taking into account the original spacing).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24864 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3f5f3524d4
commit
0b7dcd69c8
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<memchr>>---search for character in memory
|
||||
<<memchr>>---search for character in memory
|
||||
|
||||
INDEX
|
||||
memchr
|
||||
memchr
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
void * memchr(const void *<[s1]>, int <[c]>, size_t <[n]>);
|
||||
#include <string.h>
|
||||
void * memchr(const void *<[s1]>, int <[c]>, size_t <[n]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
void * memchr(<[s1]>, <[c]>, <[n]>);
|
||||
void *<[string]>;
|
||||
int *<[c]>;
|
||||
size_t *<[n]>;
|
||||
#include <string.h>
|
||||
void * memchr(<[s1]>, <[c]>, <[n]>);
|
||||
void *<[string]>;
|
||||
int *<[c]>;
|
||||
size_t *<[n]>;
|
||||
|
||||
DESCRIPTION
|
||||
This function scans the first <[n]> bytes of the memory pointed
|
||||
to by <[s1]> for the character <[c]> (converted to a char).
|
||||
This function scans the first <[n]> bytes of the memory pointed
|
||||
to by <[s1]> for the character <[c]> (converted to a char).
|
||||
|
||||
RETURNS
|
||||
Returns a pointer to the matching byte, or a null pointer if
|
||||
<[c]> does not occur in <[s1]>.
|
||||
Returns a pointer to the matching byte, or a null pointer if
|
||||
<[c]> does not occur in <[s1]>.
|
||||
|
||||
PORTABILITY
|
||||
<<memchr>> is ANSI C.
|
||||
|
@ -30,7 +30,7 @@ PORTABILITY
|
|||
<<memchr>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
memchr ansi pure
|
||||
memchr ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -59,8 +59,8 @@ QUICKREF
|
|||
|
||||
void *
|
||||
_DEFUN (memchr, (s1, i, n),
|
||||
_CONST void *s1 _AND
|
||||
int i _AND size_t n)
|
||||
_CONST void *s1 _AND
|
||||
int i _AND size_t n)
|
||||
{
|
||||
_CONST unsigned char *s = (_CONST unsigned char *)s1;
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
|
@ -69,9 +69,9 @@ _DEFUN (memchr, (s1, i, n),
|
|||
while (n-- > 0)
|
||||
{
|
||||
if (*s == c)
|
||||
{
|
||||
{
|
||||
return (void *)s;
|
||||
}
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
|
@ -89,15 +89,15 @@ _DEFUN (memchr, (s1, i, n),
|
|||
|
||||
aligned_addr = (unsigned long*)s;
|
||||
while ((!DETECTCHAR (*aligned_addr, mask)) && (n>LBLOCKSIZE))
|
||||
{
|
||||
{
|
||||
aligned_addr++;
|
||||
n -= LBLOCKSIZE;
|
||||
}
|
||||
n -= LBLOCKSIZE;
|
||||
}
|
||||
|
||||
/* The block of bytes currently pointed to by aligned_addr
|
||||
may contain the target character or there may be less than
|
||||
LBLOCKSIZE bytes left to search. We check the last few
|
||||
bytes using the bytewise search. */
|
||||
LBLOCKSIZE bytes left to search. We check the last few
|
||||
bytes using the bytewise search. */
|
||||
|
||||
s = (unsigned char*)aligned_addr;
|
||||
}
|
||||
|
@ -105,9 +105,9 @@ _DEFUN (memchr, (s1, i, n),
|
|||
while (n-- > 0)
|
||||
{
|
||||
if (*s == c)
|
||||
{
|
||||
{
|
||||
return (void *)s;
|
||||
}
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<memcmp>>---compare two memory areas
|
||||
<<memcmp>>---compare two memory areas
|
||||
|
||||
INDEX
|
||||
memcmp
|
||||
memcmp
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
|
||||
#include <string.h>
|
||||
int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
int memcmp(<[s1]>, <[s2]>, <[n]>)
|
||||
void *<[s1]>;
|
||||
void *<[s2]>;
|
||||
size_t <[n]>;
|
||||
#include <string.h>
|
||||
int memcmp(<[s1]>, <[s2]>, <[n]>)
|
||||
void *<[s1]>;
|
||||
void *<[s2]>;
|
||||
size_t <[n]>;
|
||||
|
||||
DESCRIPTION
|
||||
This function compares not more than <[n]> characters of the
|
||||
object pointed to by <[s1]> with the object pointed to by <[s2]>.
|
||||
This function compares not more than <[n]> characters of the
|
||||
object pointed to by <[s1]> with the object pointed to by <[s2]>.
|
||||
|
||||
|
||||
RETURNS
|
||||
The function returns an integer greater than, equal to or
|
||||
less than zero according to whether the object pointed to by
|
||||
<[s1]> is greater than, equal to or less than the object
|
||||
pointed to by <[s2]>.
|
||||
The function returns an integer greater than, equal to or
|
||||
less than zero according to whether the object pointed to by
|
||||
<[s1]> is greater than, equal to or less than the object
|
||||
pointed to by <[s2]>.
|
||||
|
||||
PORTABILITY
|
||||
<<memcmp>> is ANSI C.
|
||||
|
@ -33,7 +33,7 @@ PORTABILITY
|
|||
<<memcmp>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
memcmp ansi pure
|
||||
memcmp ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -51,9 +51,9 @@ QUICKREF
|
|||
|
||||
int
|
||||
_DEFUN (memcmp, (m1, m2, n),
|
||||
_CONST _PTR m1 _AND
|
||||
_CONST _PTR m2 _AND
|
||||
size_t n)
|
||||
_CONST _PTR m1 _AND
|
||||
_CONST _PTR m2 _AND
|
||||
size_t n)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
unsigned char *s1 = (unsigned char *) m1;
|
||||
|
@ -62,9 +62,9 @@ _DEFUN (memcmp, (m1, m2, n),
|
|||
while (n--)
|
||||
{
|
||||
if (*s1 != *s2)
|
||||
{
|
||||
return *s1 - *s2;
|
||||
}
|
||||
{
|
||||
return *s1 - *s2;
|
||||
}
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ _DEFUN (memcmp, (m1, m2, n),
|
|||
while (n >= LBLOCKSIZE)
|
||||
{
|
||||
if (*a1 != *a2)
|
||||
break;
|
||||
break;
|
||||
a1++;
|
||||
a2++;
|
||||
n -= LBLOCKSIZE;
|
||||
|
@ -102,7 +102,7 @@ _DEFUN (memcmp, (m1, m2, n),
|
|||
while (n--)
|
||||
{
|
||||
if (*s1 != *s2)
|
||||
return *s1 - *s2;
|
||||
return *s1 - *s2;
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ PORTABILITY
|
|||
|
||||
QUICKREF
|
||||
memcpy ansi pure
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <_ansi.h>
|
||||
|
@ -51,15 +51,15 @@ QUICKREF
|
|||
|
||||
_PTR
|
||||
_DEFUN (memcpy, (dst0, src0, len0),
|
||||
_PTR dst0 _AND
|
||||
_CONST _PTR src0 _AND
|
||||
size_t len0) ICODE_ATTR;
|
||||
_PTR dst0 _AND
|
||||
_CONST _PTR src0 _AND
|
||||
size_t len0) ICODE_ATTR;
|
||||
|
||||
_PTR
|
||||
_DEFUN (memcpy, (dst0, src0, len0),
|
||||
_PTR dst0 _AND
|
||||
_CONST _PTR src0 _AND
|
||||
size_t len0)
|
||||
_PTR dst0 _AND
|
||||
_CONST _PTR src0 _AND
|
||||
size_t len0)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
char *dst = (char *) dst0;
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<memmove>>---move possibly overlapping memory
|
||||
<<memmove>>---move possibly overlapping memory
|
||||
|
||||
INDEX
|
||||
memmove
|
||||
memmove
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);
|
||||
#include <string.h>
|
||||
void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
void *memmove(<[dst]>, <[src]>, <[length]>)
|
||||
void *<[dst]>;
|
||||
void *<[src]>;
|
||||
size_t <[length]>;
|
||||
#include <string.h>
|
||||
void *memmove(<[dst]>, <[src]>, <[length]>)
|
||||
void *<[dst]>;
|
||||
void *<[src]>;
|
||||
size_t <[length]>;
|
||||
|
||||
DESCRIPTION
|
||||
This function moves <[length]> characters from the block of
|
||||
memory starting at <<*<[src]>>> to the memory starting at
|
||||
<<*<[dst]>>>. <<memmove>> reproduces the characters correctly
|
||||
at <<*<[dst]>>> even if the two areas overlap.
|
||||
This function moves <[length]> characters from the block of
|
||||
memory starting at <<*<[src]>>> to the memory starting at
|
||||
<<*<[dst]>>>. <<memmove>> reproduces the characters correctly
|
||||
at <<*<[dst]>>> even if the two areas overlap.
|
||||
|
||||
|
||||
RETURNS
|
||||
The function returns <[dst]> as passed.
|
||||
The function returns <[dst]> as passed.
|
||||
|
||||
PORTABILITY
|
||||
<<memmove>> is ANSI C.
|
||||
|
@ -32,7 +32,7 @@ PORTABILITY
|
|||
<<memmove>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
memmove ansi pure
|
||||
memmove ansi pure
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -54,15 +54,15 @@ QUICKREF
|
|||
|
||||
_PTR
|
||||
_DEFUN (memmove, (dst_void, src_void, length),
|
||||
_PTR dst_void _AND
|
||||
_CONST _PTR src_void _AND
|
||||
size_t length) ICODE_ATTR;
|
||||
_PTR dst_void _AND
|
||||
_CONST _PTR src_void _AND
|
||||
size_t length) ICODE_ATTR;
|
||||
|
||||
_PTR
|
||||
_DEFUN (memmove, (dst_void, src_void, length),
|
||||
_PTR dst_void _AND
|
||||
_CONST _PTR src_void _AND
|
||||
size_t length)
|
||||
_PTR dst_void _AND
|
||||
_CONST _PTR src_void _AND
|
||||
size_t length)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
char *dst = dst_void;
|
||||
|
@ -74,16 +74,16 @@ _DEFUN (memmove, (dst_void, src_void, length),
|
|||
src += length;
|
||||
dst += length;
|
||||
while (length--)
|
||||
{
|
||||
*--dst = *--src;
|
||||
}
|
||||
{
|
||||
*--dst = *--src;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (length--)
|
||||
{
|
||||
*dst++ = *src++;
|
||||
}
|
||||
{
|
||||
*dst++ = *src++;
|
||||
}
|
||||
}
|
||||
|
||||
return dst_void;
|
||||
|
@ -100,9 +100,9 @@ _DEFUN (memmove, (dst_void, src_void, length),
|
|||
src += len;
|
||||
dst += len;
|
||||
while (len--)
|
||||
{
|
||||
*--dst = *--src;
|
||||
}
|
||||
{
|
||||
*--dst = *--src;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<memset>>---set an area of memory
|
||||
<<memset>>---set an area of memory
|
||||
|
||||
INDEX
|
||||
memset
|
||||
memset
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
void *memset(const void *<[dst]>, int <[c]>, size_t <[length]>);
|
||||
#include <string.h>
|
||||
void *memset(const void *<[dst]>, int <[c]>, size_t <[length]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
void *memset(<[dst]>, <[c]>, <[length]>)
|
||||
void *<[dst]>;
|
||||
int <[c]>;
|
||||
size_t <[length]>;
|
||||
#include <string.h>
|
||||
void *memset(<[dst]>, <[c]>, <[length]>)
|
||||
void *<[dst]>;
|
||||
int <[c]>;
|
||||
size_t <[length]>;
|
||||
|
||||
DESCRIPTION
|
||||
This function converts the argument <[c]> into an unsigned
|
||||
char and fills the first <[length]> characters of the array
|
||||
pointed to by <[dst]> to the value.
|
||||
This function converts the argument <[c]> into an unsigned
|
||||
char and fills the first <[length]> characters of the array
|
||||
pointed to by <[dst]> to the value.
|
||||
|
||||
RETURNS
|
||||
<<memset>> returns the value of <[m]>.
|
||||
<<memset>> returns the value of <[m]>.
|
||||
|
||||
PORTABILITY
|
||||
<<memset>> is ANSI C.
|
||||
|
@ -30,7 +30,7 @@ PORTABILITY
|
|||
<<memset>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
memset ansi pure
|
||||
memset ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -41,9 +41,9 @@ QUICKREF
|
|||
|
||||
_PTR
|
||||
_DEFUN (memset, (m, c, n),
|
||||
_PTR m _AND
|
||||
int c _AND
|
||||
size_t n)
|
||||
_PTR m _AND
|
||||
int c _AND
|
||||
size_t n)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
char *s = (char *) m;
|
||||
|
@ -78,7 +78,7 @@ _DEFUN (memset, (m, c, n),
|
|||
{
|
||||
buffer = 0;
|
||||
for (i = 0; i < LBLOCKSIZE; i++)
|
||||
buffer = (buffer << 8) | c;
|
||||
buffer = (buffer << 8) | c;
|
||||
}
|
||||
|
||||
while (n >= LBLOCKSIZE*4)
|
||||
|
|
|
@ -3,20 +3,20 @@ FUNCTION
|
|||
<<qsort>>---sort an array
|
||||
|
||||
INDEX
|
||||
qsort
|
||||
qsort
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <stdlib.h>
|
||||
void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
|
||||
int (*<[compar]>)(const void *, const void *) );
|
||||
#include <stdlib.h>
|
||||
void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
|
||||
int (*<[compar]>)(const void *, const void *) );
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <stdlib.h>
|
||||
qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
|
||||
char *<[base]>;
|
||||
size_t <[nmemb]>;
|
||||
size_t <[size]>;
|
||||
int (*<[compar]>)();
|
||||
#include <stdlib.h>
|
||||
qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
|
||||
char *<[base]>;
|
||||
size_t <[nmemb]>;
|
||||
size_t <[size]>;
|
||||
int (*<[compar]>)();
|
||||
|
||||
DESCRIPTION
|
||||
<<qsort>> sorts an array (beginning at <[base]>) of <[nmemb]> objects.
|
||||
|
@ -43,7 +43,7 @@ PORTABILITY
|
|||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* 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
|
||||
|
@ -55,8 +55,8 @@ PORTABILITY
|
|||
* 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.
|
||||
* 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.
|
||||
|
@ -81,142 +81,142 @@ PORTABILITY
|
|||
#define inline
|
||||
#endif
|
||||
|
||||
static inline char *med3 _PARAMS((char *, char *, char *, int (*cmp)(const _PTR,const _PTR)));
|
||||
static inline void swapfunc _PARAMS((char *, char *, int, int));
|
||||
static inline char *med3 _PARAMS((char *, char *, char *, int (*cmp)(const _PTR,const _PTR)));
|
||||
static inline void swapfunc _PARAMS((char *, char *, int, int));
|
||||
|
||||
#define min(a, b) (a) < (b) ? a : b
|
||||
#define min(a, b) (a) < (b) ? a : b
|
||||
|
||||
/*
|
||||
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
|
||||
*/
|
||||
#define swapcode(TYPE, parmi, parmj, n) { \
|
||||
long i = (n) / sizeof (TYPE); \
|
||||
register TYPE *pi = (TYPE *) (parmi); \
|
||||
register TYPE *pj = (TYPE *) (parmj); \
|
||||
do { \
|
||||
register TYPE t = *pi; \
|
||||
*pi++ = *pj; \
|
||||
*pj++ = t; \
|
||||
} while (--i > 0); \
|
||||
#define swapcode(TYPE, parmi, parmj, n) { \
|
||||
long i = (n) / sizeof (TYPE); \
|
||||
register TYPE *pi = (TYPE *) (parmi); \
|
||||
register TYPE *pj = (TYPE *) (parmj); \
|
||||
do { \
|
||||
register TYPE t = *pi; \
|
||||
*pi++ = *pj; \
|
||||
*pj++ = t; \
|
||||
} while (--i > 0); \
|
||||
}
|
||||
|
||||
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
|
||||
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
|
||||
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
|
||||
|
||||
static inline void
|
||||
_DEFUN(swapfunc, (a, b, n, swaptype),
|
||||
char *a _AND
|
||||
char *b _AND
|
||||
int n _AND
|
||||
int swaptype)
|
||||
char *a _AND
|
||||
char *b _AND
|
||||
int n _AND
|
||||
int swaptype)
|
||||
{
|
||||
if(swaptype <= 1)
|
||||
swapcode(long, a, b, n)
|
||||
else
|
||||
swapcode(char, a, b, n)
|
||||
if(swaptype <= 1)
|
||||
swapcode(long, a, b, n)
|
||||
else
|
||||
swapcode(char, a, b, n)
|
||||
}
|
||||
|
||||
#define swap(a, b) \
|
||||
if (swaptype == 0) { \
|
||||
long t = *(long *)(a); \
|
||||
*(long *)(a) = *(long *)(b); \
|
||||
*(long *)(b) = t; \
|
||||
} else \
|
||||
swapfunc(a, b, es, swaptype)
|
||||
#define swap(a, b) \
|
||||
if (swaptype == 0) { \
|
||||
long t = *(long *)(a); \
|
||||
*(long *)(a) = *(long *)(b); \
|
||||
*(long *)(b) = t; \
|
||||
} else \
|
||||
swapfunc(a, b, es, swaptype)
|
||||
|
||||
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
|
||||
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
|
||||
|
||||
static inline char *
|
||||
_DEFUN(med3, (a, b, c, cmp),
|
||||
char *a _AND
|
||||
char *b _AND
|
||||
char *c _AND
|
||||
int (*cmp)(const _PTR,const _PTR))
|
||||
char *a _AND
|
||||
char *b _AND
|
||||
char *c _AND
|
||||
int (*cmp)(const _PTR,const _PTR))
|
||||
{
|
||||
return cmp(a, b) < 0 ?
|
||||
(cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
|
||||
return cmp(a, b) < 0 ?
|
||||
(cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
|
||||
:(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
|
||||
}
|
||||
|
||||
void
|
||||
_DEFUN(qsort, (a, n, es, cmp),
|
||||
void *a _AND
|
||||
size_t n _AND
|
||||
size_t es _AND
|
||||
int (*cmp)(const _PTR,const _PTR))
|
||||
void *a _AND
|
||||
size_t n _AND
|
||||
size_t es _AND
|
||||
int (*cmp)(const _PTR,const _PTR))
|
||||
{
|
||||
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
|
||||
int d, r, swaptype, swap_cnt;
|
||||
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
|
||||
int d, r, swaptype, swap_cnt;
|
||||
|
||||
loop: SWAPINIT(a, es);
|
||||
swap_cnt = 0;
|
||||
if (n < 7) {
|
||||
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
pm = (char *) a + (n / 2) * es;
|
||||
if (n > 7) {
|
||||
pl = a;
|
||||
pn = (char *) a + (n - 1) * es;
|
||||
if (n > 40) {
|
||||
d = (n / 8) * es;
|
||||
pl = med3(pl, pl + d, pl + 2 * d, cmp);
|
||||
pm = med3(pm - d, pm, pm + d, cmp);
|
||||
pn = med3(pn - 2 * d, pn - d, pn, cmp);
|
||||
}
|
||||
pm = med3(pl, pm, pn, cmp);
|
||||
}
|
||||
swap(a, pm);
|
||||
pa = pb = (char *) a + es;
|
||||
loop: SWAPINIT(a, es);
|
||||
swap_cnt = 0;
|
||||
if (n < 7) {
|
||||
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
pm = (char *) a + (n / 2) * es;
|
||||
if (n > 7) {
|
||||
pl = a;
|
||||
pn = (char *) a + (n - 1) * es;
|
||||
if (n > 40) {
|
||||
d = (n / 8) * es;
|
||||
pl = med3(pl, pl + d, pl + 2 * d, cmp);
|
||||
pm = med3(pm - d, pm, pm + d, cmp);
|
||||
pn = med3(pn - 2 * d, pn - d, pn, cmp);
|
||||
}
|
||||
pm = med3(pl, pm, pn, cmp);
|
||||
}
|
||||
swap(a, pm);
|
||||
pa = pb = (char *) a + es;
|
||||
|
||||
pc = pd = (char *) a + (n - 1) * es;
|
||||
for (;;) {
|
||||
while (pb <= pc && (r = cmp(pb, a)) <= 0) {
|
||||
if (r == 0) {
|
||||
swap_cnt = 1;
|
||||
swap(pa, pb);
|
||||
pa += es;
|
||||
}
|
||||
pb += es;
|
||||
}
|
||||
while (pb <= pc && (r = cmp(pc, a)) >= 0) {
|
||||
if (r == 0) {
|
||||
swap_cnt = 1;
|
||||
swap(pc, pd);
|
||||
pd -= es;
|
||||
}
|
||||
pc -= es;
|
||||
}
|
||||
if (pb > pc)
|
||||
break;
|
||||
swap(pb, pc);
|
||||
swap_cnt = 1;
|
||||
pb += es;
|
||||
pc -= es;
|
||||
}
|
||||
if (swap_cnt == 0) { /* Switch to insertion sort */
|
||||
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
pc = pd = (char *) a + (n - 1) * es;
|
||||
for (;;) {
|
||||
while (pb <= pc && (r = cmp(pb, a)) <= 0) {
|
||||
if (r == 0) {
|
||||
swap_cnt = 1;
|
||||
swap(pa, pb);
|
||||
pa += es;
|
||||
}
|
||||
pb += es;
|
||||
}
|
||||
while (pb <= pc && (r = cmp(pc, a)) >= 0) {
|
||||
if (r == 0) {
|
||||
swap_cnt = 1;
|
||||
swap(pc, pd);
|
||||
pd -= es;
|
||||
}
|
||||
pc -= es;
|
||||
}
|
||||
if (pb > pc)
|
||||
break;
|
||||
swap(pb, pc);
|
||||
swap_cnt = 1;
|
||||
pb += es;
|
||||
pc -= es;
|
||||
}
|
||||
if (swap_cnt == 0) { /* Switch to insertion sort */
|
||||
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
|
||||
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
|
||||
pl -= es)
|
||||
swap(pl, pl - es);
|
||||
return;
|
||||
}
|
||||
|
||||
pn = (char *) a + n * es;
|
||||
r = min(pa - (char *)a, pb - pa);
|
||||
vecswap(a, pb - r, r);
|
||||
r = min((unsigned int)(pd - pc), pn - pd - es);
|
||||
vecswap(pb, pn - r, r);
|
||||
if ((unsigned int)(r = pb - pa) > es)
|
||||
qsort(a, r / es, es, cmp);
|
||||
if ((unsigned int)(r = pd - pc) > es) {
|
||||
/* Iterate rather than recurse to save stack space */
|
||||
a = pn - r;
|
||||
n = r / es;
|
||||
goto loop;
|
||||
}
|
||||
/* qsort(pn - r, r / es, es, cmp);*/
|
||||
pn = (char *) a + n * es;
|
||||
r = min(pa - (char *)a, pb - pa);
|
||||
vecswap(a, pb - r, r);
|
||||
r = min((unsigned int)(pd - pc), pn - pd - es);
|
||||
vecswap(pb, pn - r, r);
|
||||
if ((unsigned int)(r = pb - pa) > es)
|
||||
qsort(a, r / es, es, cmp);
|
||||
if ((unsigned int)(r = pd - pc) > es) {
|
||||
/* Iterate rather than recurse to save stack space */
|
||||
a = pn - r;
|
||||
n = r / es;
|
||||
goto loop;
|
||||
}
|
||||
/* qsort(pn - r, r / es, es, cmp);*/
|
||||
}
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<strchr>>---search for character in string
|
||||
<<strchr>>---search for character in string
|
||||
|
||||
INDEX
|
||||
strchr
|
||||
strchr
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
char * strchr(const char *<[string]>, int <[c]>);
|
||||
#include <string.h>
|
||||
char * strchr(const char *<[string]>, int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
char * strchr(<[string]>, <[c]>);
|
||||
char *<[string]>;
|
||||
int *<[c]>;
|
||||
#include <string.h>
|
||||
char * strchr(<[string]>, <[c]>);
|
||||
char *<[string]>;
|
||||
int *<[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
This function finds the first occurence of <[c]> (converted to
|
||||
a char) in the string pointed to by <[string]> (including the
|
||||
terminating null character).
|
||||
This function finds the first occurence of <[c]> (converted to
|
||||
a char) in the string pointed to by <[string]> (including the
|
||||
terminating null character).
|
||||
|
||||
RETURNS
|
||||
Returns a pointer to the located character, or a null pointer
|
||||
if <[c]> does not occur in <[string]>.
|
||||
Returns a pointer to the located character, or a null pointer
|
||||
if <[c]> does not occur in <[string]>.
|
||||
|
||||
PORTABILITY
|
||||
<<strchr>> is ANSI C.
|
||||
|
@ -30,7 +30,7 @@ PORTABILITY
|
|||
<<strchr>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
strchr ansi pure
|
||||
strchr ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -59,8 +59,8 @@ QUICKREF
|
|||
|
||||
char *
|
||||
_DEFUN (strchr, (s1, i),
|
||||
_CONST char *s1 _AND
|
||||
int i)
|
||||
_CONST char *s1 _AND
|
||||
int i)
|
||||
{
|
||||
_CONST unsigned char *s = (_CONST unsigned char *)s1;
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<strcmp>>---character string compare
|
||||
|
||||
<<strcmp>>---character string compare
|
||||
|
||||
INDEX
|
||||
strcmp
|
||||
strcmp
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
int strcmp(const char *<[a]>, const char *<[b]>);
|
||||
#include <string.h>
|
||||
int strcmp(const char *<[a]>, const char *<[b]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
int strcmp(<[a]>, <[b]>)
|
||||
char *<[a]>;
|
||||
char *<[b]>;
|
||||
#include <string.h>
|
||||
int strcmp(<[a]>, <[b]>)
|
||||
char *<[a]>;
|
||||
char *<[b]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<strcmp>> compares the string at <[a]> to
|
||||
the string at <[b]>.
|
||||
<<strcmp>> compares the string at <[a]> to
|
||||
the string at <[b]>.
|
||||
|
||||
RETURNS
|
||||
If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
|
||||
<<strcmp>> returns a number greater than zero. If the two
|
||||
strings match, <<strcmp>> returns zero. If <<*<[a]>>>
|
||||
sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a
|
||||
number less than zero.
|
||||
If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
|
||||
<<strcmp>> returns a number greater than zero. If the two
|
||||
strings match, <<strcmp>> returns zero. If <<*<[a]>>>
|
||||
sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a
|
||||
number less than zero.
|
||||
|
||||
PORTABILITY
|
||||
<<strcmp>> is ANSI C.
|
||||
|
@ -32,7 +32,7 @@ PORTABILITY
|
|||
<<strcmp>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
strcmp ansi pure
|
||||
strcmp ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -59,8 +59,8 @@ QUICKREF
|
|||
|
||||
int
|
||||
_DEFUN (strcmp, (s1, s2),
|
||||
_CONST char *s1 _AND
|
||||
_CONST char *s2)
|
||||
_CONST char *s1 _AND
|
||||
_CONST char *s2)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
while (*s1 != '\0' && *s1 == *s2)
|
||||
|
@ -83,9 +83,9 @@ _DEFUN (strcmp, (s1, s2),
|
|||
while (*a1 == *a2)
|
||||
{
|
||||
/* To get here, *a1 == *a2, thus if we find a null in *a1,
|
||||
then the strings must be equal, so return zero. */
|
||||
then the strings must be equal, so return zero. */
|
||||
if (DETECTNULL (*a1))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
a1++;
|
||||
a2++;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<strcpy>>---copy string
|
||||
<<strcpy>>---copy string
|
||||
|
||||
INDEX
|
||||
strcpy
|
||||
strcpy
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
char *strcpy(char *<[dst]>, const char *<[src]>);
|
||||
#include <string.h>
|
||||
char *strcpy(char *<[dst]>, const char *<[src]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
char *strcpy(<[dst]>, <[src]>)
|
||||
char *<[dst]>;
|
||||
char *<[src]>;
|
||||
#include <string.h>
|
||||
char *strcpy(<[dst]>, <[src]>)
|
||||
char *<[dst]>;
|
||||
char *<[src]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<strcpy>> copies the string pointed to by <[src]>
|
||||
(including the terminating null character) to the array
|
||||
pointed to by <[dst]>.
|
||||
<<strcpy>> copies the string pointed to by <[src]>
|
||||
(including the terminating null character) to the array
|
||||
pointed to by <[dst]>.
|
||||
|
||||
RETURNS
|
||||
This function returns the initial value of <[dst]>.
|
||||
This function returns the initial value of <[dst]>.
|
||||
|
||||
PORTABILITY
|
||||
<<strcpy>> is ANSI C.
|
||||
|
@ -29,7 +29,7 @@ PORTABILITY
|
|||
<<strcpy>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
strcpy ansi pure
|
||||
strcpy ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -59,8 +59,8 @@ QUICKREF
|
|||
|
||||
char*
|
||||
_DEFUN (strcpy, (dst0, src0),
|
||||
char *dst0 _AND
|
||||
_CONST char *src0)
|
||||
char *dst0 _AND
|
||||
_CONST char *src0)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
char *s = dst0;
|
||||
|
|
|
@ -29,28 +29,28 @@
|
|||
size_t
|
||||
strlcat(char *dst, const char *src, size_t siz)
|
||||
{
|
||||
char *d = dst;
|
||||
const char *s = src;
|
||||
size_t n = siz;
|
||||
size_t dlen;
|
||||
char *d = dst;
|
||||
const char *s = src;
|
||||
size_t n = siz;
|
||||
size_t dlen;
|
||||
|
||||
/* Find the end of dst and adjust bytes left but don't go past end */
|
||||
while (n-- != 0 && *d != '\0')
|
||||
d++;
|
||||
dlen = d - dst;
|
||||
n = siz - dlen;
|
||||
/* Find the end of dst and adjust bytes left but don't go past end */
|
||||
while (n-- != 0 && *d != '\0')
|
||||
d++;
|
||||
dlen = d - dst;
|
||||
n = siz - dlen;
|
||||
|
||||
if (n == 0)
|
||||
return(dlen + strlen(s));
|
||||
while (*s != '\0') {
|
||||
if (n != 1) {
|
||||
*d++ = *s;
|
||||
n--;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
*d = '\0';
|
||||
if (n == 0)
|
||||
return(dlen + strlen(s));
|
||||
while (*s != '\0') {
|
||||
if (n != 1) {
|
||||
*d++ = *s;
|
||||
n--;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
*d = '\0';
|
||||
|
||||
return(dlen + (s - src)); /* count does not include NUL */
|
||||
return(dlen + (s - src)); /* count does not include NUL */
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
|
||||
/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
|
@ -27,26 +27,26 @@
|
|||
size_t
|
||||
strlcpy(char *dst, const char *src, size_t siz)
|
||||
{
|
||||
char *d = dst;
|
||||
const char *s = src;
|
||||
size_t n = siz;
|
||||
char *d = dst;
|
||||
const char *s = src;
|
||||
size_t n = siz;
|
||||
|
||||
/* Copy as many bytes as will fit */
|
||||
if (n != 0) {
|
||||
while (--n != 0) {
|
||||
if ((*d++ = *s++) == '\0')
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Copy as many bytes as will fit */
|
||||
if (n != 0) {
|
||||
while (--n != 0) {
|
||||
if ((*d++ = *s++) == '\0')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Not enough room in dst, add NUL and traverse rest of src */
|
||||
if (n == 0) {
|
||||
if (siz != 0)
|
||||
*d = '\0'; /* NUL-terminate dst */
|
||||
while (*s++)
|
||||
;
|
||||
}
|
||||
/* Not enough room in dst, add NUL and traverse rest of src */
|
||||
if (n == 0) {
|
||||
if (siz != 0)
|
||||
*d = '\0'; /* NUL-terminate dst */
|
||||
while (*s++)
|
||||
;
|
||||
}
|
||||
|
||||
return(s - src - 1); /* count does not include NUL */
|
||||
return(s - src - 1); /* count does not include NUL */
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<strlen>>---character string length
|
||||
|
||||
<<strlen>>---character string length
|
||||
|
||||
INDEX
|
||||
strlen
|
||||
strlen
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
size_t strlen(const char *<[str]>);
|
||||
#include <string.h>
|
||||
size_t strlen(const char *<[str]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
size_t strlen(<[str]>)
|
||||
char *<[src]>;
|
||||
#include <string.h>
|
||||
size_t strlen(<[str]>)
|
||||
char *<[src]>;
|
||||
|
||||
DESCRIPTION
|
||||
The <<strlen>> function works out the length of the string
|
||||
starting at <<*<[str]>>> by counting chararacters until it
|
||||
reaches a <<NULL>> character.
|
||||
The <<strlen>> function works out the length of the string
|
||||
starting at <<*<[str]>>> by counting chararacters until it
|
||||
reaches a <<NULL>> character.
|
||||
|
||||
RETURNS
|
||||
<<strlen>> returns the character count.
|
||||
<<strlen>> returns the character count.
|
||||
|
||||
PORTABILITY
|
||||
<<strlen>> is ANSI C.
|
||||
|
@ -28,7 +28,7 @@ PORTABILITY
|
|||
<<strlen>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
strlen ansi pure
|
||||
strlen ansi pure
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -56,11 +56,11 @@ QUICKREF
|
|||
|
||||
size_t
|
||||
_DEFUN (strlen, (str),
|
||||
_CONST char *str) ICODE_ATTR;
|
||||
_CONST char *str) ICODE_ATTR;
|
||||
|
||||
size_t
|
||||
_DEFUN (strlen, (str),
|
||||
_CONST char *str)
|
||||
_CONST char *str)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
_CONST char *start = str;
|
||||
|
|
|
@ -75,26 +75,26 @@ compare_right(char const *a, char const *b)
|
|||
int ca, cb;
|
||||
|
||||
/* The longest run of digits wins. That aside, the greatest
|
||||
value wins, but we can't know that it will until we've scanned
|
||||
both numbers to know that they have the same magnitude, so we
|
||||
remember it in BIAS. */
|
||||
value wins, but we can't know that it will until we've scanned
|
||||
both numbers to know that they have the same magnitude, so we
|
||||
remember it in BIAS. */
|
||||
for (;; a++, b++) {
|
||||
ca = to_int(*a);
|
||||
cb = to_int(*b);
|
||||
if (!nat_isdigit(ca) && !nat_isdigit(cb))
|
||||
return bias;
|
||||
else if (!nat_isdigit(ca))
|
||||
return -1;
|
||||
else if (!nat_isdigit(cb))
|
||||
return +1;
|
||||
else if (ca < cb) {
|
||||
if (!bias)
|
||||
bias = -1;
|
||||
} else if (ca > cb) {
|
||||
if (!bias)
|
||||
bias = +1;
|
||||
} else if (!ca && !cb)
|
||||
return bias;
|
||||
if (!nat_isdigit(ca) && !nat_isdigit(cb))
|
||||
return bias;
|
||||
else if (!nat_isdigit(ca))
|
||||
return -1;
|
||||
else if (!nat_isdigit(cb))
|
||||
return +1;
|
||||
else if (ca < cb) {
|
||||
if (!bias)
|
||||
bias = -1;
|
||||
} else if (ca > cb) {
|
||||
if (!bias)
|
||||
bias = +1;
|
||||
} else if (!ca && !cb)
|
||||
return bias;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -107,18 +107,18 @@ compare_left(char const *a, char const *b)
|
|||
/* Compare two left-aligned numbers: the first to have a
|
||||
different value wins. */
|
||||
for (;; a++, b++) {
|
||||
if (!nat_isdigit(*a) && !nat_isdigit(*b))
|
||||
return 0;
|
||||
else if (!nat_isdigit(*a))
|
||||
return -1;
|
||||
else if (!nat_isdigit(*b))
|
||||
return +1;
|
||||
else if (*a < *b)
|
||||
return -1;
|
||||
else if (*a > *b)
|
||||
return +1;
|
||||
if (!nat_isdigit(*a) && !nat_isdigit(*b))
|
||||
return 0;
|
||||
else if (!nat_isdigit(*a))
|
||||
return -1;
|
||||
else if (!nat_isdigit(*b))
|
||||
return +1;
|
||||
else if (*a < *b)
|
||||
return -1;
|
||||
else if (*a > *b)
|
||||
return +1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -134,39 +134,39 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
|
|||
ca = to_int(a[ai]);
|
||||
cb = to_int(b[bi]);
|
||||
|
||||
/* process run of digits */
|
||||
if (nat_isdigit(ca) && nat_isdigit(cb)) {
|
||||
fractional = (ca == '0' || cb == '0');
|
||||
/* process run of digits */
|
||||
if (nat_isdigit(ca) && nat_isdigit(cb)) {
|
||||
fractional = (ca == '0' || cb == '0');
|
||||
|
||||
if (fractional) {
|
||||
if ((result = compare_left(a+ai, b+bi)) != 0)
|
||||
return result;
|
||||
} else {
|
||||
if ((result = compare_right(a+ai, b+bi)) != 0)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (fractional) {
|
||||
if ((result = compare_left(a+ai, b+bi)) != 0)
|
||||
return result;
|
||||
} else {
|
||||
if ((result = compare_right(a+ai, b+bi)) != 0)
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ca && !cb) {
|
||||
/* The strings compare the same. Call str[case]cmp() to ensure
|
||||
if (!ca && !cb) {
|
||||
/* The strings compare the same. Call str[case]cmp() to ensure
|
||||
consistent results. */
|
||||
if(fold_case)
|
||||
return strcasecmp(a,b);
|
||||
else
|
||||
return strcmp(a,b);
|
||||
}
|
||||
}
|
||||
|
||||
if (fold_case) {
|
||||
ca = nat_unify_case(ca);
|
||||
cb = nat_unify_case(cb);
|
||||
}
|
||||
|
||||
if (ca < cb)
|
||||
return -1;
|
||||
else if (ca > cb)
|
||||
return +1;
|
||||
if (fold_case) {
|
||||
ca = nat_unify_case(ca);
|
||||
cb = nat_unify_case(cb);
|
||||
}
|
||||
|
||||
if (ca < cb)
|
||||
return -1;
|
||||
else if (ca > cb)
|
||||
return +1;
|
||||
|
||||
++ai; ++bi;
|
||||
++ai; ++bi;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<strncmp>>---character string compare
|
||||
|
||||
<<strncmp>>---character string compare
|
||||
|
||||
INDEX
|
||||
strncmp
|
||||
strncmp
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
|
||||
#include <string.h>
|
||||
int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
int strncmp(<[a]>, <[b]>, <[length]>)
|
||||
char *<[a]>;
|
||||
char *<[b]>;
|
||||
size_t <[length]>
|
||||
#include <string.h>
|
||||
int strncmp(<[a]>, <[b]>, <[length]>)
|
||||
char *<[a]>;
|
||||
char *<[b]>;
|
||||
size_t <[length]>
|
||||
|
||||
DESCRIPTION
|
||||
<<strncmp>> compares up to <[length]> characters
|
||||
from the string at <[a]> to the string at <[b]>.
|
||||
<<strncmp>> compares up to <[length]> characters
|
||||
from the string at <[a]> to the string at <[b]>.
|
||||
|
||||
RETURNS
|
||||
If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
|
||||
<<strncmp>> returns a number greater than zero. If the two
|
||||
strings are equivalent, <<strncmp>> returns zero. If <<*<[a]>>>
|
||||
sorts lexicographically before <<*<[b]>>>, <<strncmp>> returns a
|
||||
number less than zero.
|
||||
If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
|
||||
<<strncmp>> returns a number greater than zero. If the two
|
||||
strings are equivalent, <<strncmp>> returns zero. If <<*<[a]>>>
|
||||
sorts lexicographically before <<*<[b]>>>, <<strncmp>> returns a
|
||||
number less than zero.
|
||||
|
||||
PORTABILITY
|
||||
<<strncmp>> is ANSI C.
|
||||
|
@ -33,7 +33,7 @@ PORTABILITY
|
|||
<<strncmp>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
strncmp ansi pure
|
||||
strncmp ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
@ -60,9 +60,9 @@ QUICKREF
|
|||
|
||||
int
|
||||
_DEFUN (strncmp, (s1, s2, n),
|
||||
_CONST char *s1 _AND
|
||||
_CONST char *s2 _AND
|
||||
size_t n)
|
||||
_CONST char *s1 _AND
|
||||
_CONST char *s2 _AND
|
||||
size_t n)
|
||||
{
|
||||
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
|
||||
if (n == 0)
|
||||
|
@ -71,7 +71,7 @@ _DEFUN (strncmp, (s1, s2, n),
|
|||
while (n-- != 0 && *s1 == *s2)
|
||||
{
|
||||
if (n == 0 || *s1 == '\0')
|
||||
break;
|
||||
break;
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
@ -95,9 +95,9 @@ _DEFUN (strncmp, (s1, s2, n),
|
|||
n -= sizeof (long);
|
||||
|
||||
/* If we've run out of bytes or hit a null, return zero
|
||||
since we already know *a1 == *a2. */
|
||||
since we already know *a1 == *a2. */
|
||||
if (n == 0 || DETECTNULL (*a1))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
a1++;
|
||||
a2++;
|
||||
|
@ -111,9 +111,9 @@ _DEFUN (strncmp, (s1, s2, n),
|
|||
while (n-- > 0 && *s1 == *s2)
|
||||
{
|
||||
/* If we've run out of bytes or hit a null, return zero
|
||||
since we already know *s1 == *s2. */
|
||||
since we already know *s1 == *s2. */
|
||||
if (n == 0 || *s1 == '\0')
|
||||
return 0;
|
||||
return 0;
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
FUNCTION
|
||||
<<strrchr>>---reverse search for character in string
|
||||
<<strrchr>>---reverse search for character in string
|
||||
|
||||
INDEX
|
||||
strrchr
|
||||
strrchr
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <string.h>
|
||||
char * strrchr(const char *<[string]>, int <[c]>);
|
||||
#include <string.h>
|
||||
char * strrchr(const char *<[string]>, int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <string.h>
|
||||
char * strrchr(<[string]>, <[c]>);
|
||||
char *<[string]>;
|
||||
int *<[c]>;
|
||||
#include <string.h>
|
||||
char * strrchr(<[string]>, <[c]>);
|
||||
char *<[string]>;
|
||||
int *<[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
This function finds the last occurence of <[c]> (converted to
|
||||
a char) in the string pointed to by <[string]> (including the
|
||||
terminating null character).
|
||||
This function finds the last occurence of <[c]> (converted to
|
||||
a char) in the string pointed to by <[string]> (including the
|
||||
terminating null character).
|
||||
|
||||
RETURNS
|
||||
Returns a pointer to the located character, or a null pointer
|
||||
if <[c]> does not occur in <[string]>.
|
||||
Returns a pointer to the located character, or a null pointer
|
||||
if <[c]> does not occur in <[string]>.
|
||||
|
||||
PORTABILITY
|
||||
<<strrchr>> is ANSI C.
|
||||
|
@ -30,30 +30,30 @@ PORTABILITY
|
|||
<<strrchr>> requires no supporting OS subroutines.
|
||||
|
||||
QUICKREF
|
||||
strrchr ansi pure
|
||||
strrchr ansi pure
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
char *
|
||||
_DEFUN (strrchr, (s, i),
|
||||
_CONST char *s _AND
|
||||
int i)
|
||||
_CONST char *s _AND
|
||||
int i)
|
||||
{
|
||||
_CONST char *last = NULL;
|
||||
|
||||
if (i)
|
||||
{
|
||||
while ((s=strchr(s, i)))
|
||||
{
|
||||
last = s;
|
||||
s++;
|
||||
}
|
||||
{
|
||||
last = s;
|
||||
s++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
last = strchr(s, i);
|
||||
}
|
||||
|
||||
|
||||
return (char *) last;
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
|
||||
files aren't affected). */
|
||||
|
||||
#ifndef _ANSIDECL_H_
|
||||
#define _ANSIDECL_H_
|
||||
#ifndef _ANSIDECL_H_
|
||||
#define _ANSIDECL_H_
|
||||
|
||||
/* First try to figure out whether we really are in an ANSI C environment. */
|
||||
/* FIXME: This probably needs some work. Perhaps sys/config.h can be
|
||||
|
@ -21,46 +21,46 @@
|
|||
#endif
|
||||
|
||||
#ifdef _HAVE_STDC
|
||||
#define _PTR void *
|
||||
#define _AND ,
|
||||
#define _NOARGS void
|
||||
#define _CONST const
|
||||
#define _VOLATILE volatile
|
||||
#define _SIGNED signed
|
||||
#define _DOTS , ...
|
||||
#define _PTR void *
|
||||
#define _AND ,
|
||||
#define _NOARGS void
|
||||
#define _CONST const
|
||||
#define _VOLATILE volatile
|
||||
#define _SIGNED signed
|
||||
#define _DOTS , ...
|
||||
#define _VOID void
|
||||
#ifdef __CYGWIN__
|
||||
#define _EXFUN(name, proto) __cdecl name proto
|
||||
#define _EXPARM(name, proto) (* __cdecl name) proto
|
||||
#define _EXFUN(name, proto) __cdecl name proto
|
||||
#define _EXPARM(name, proto) (* __cdecl name) proto
|
||||
#else
|
||||
#define _EXFUN(name, proto) name proto
|
||||
#define _EXPARM(name, proto) (* name) proto
|
||||
#define _EXFUN(name, proto) name proto
|
||||
#define _EXPARM(name, proto) (* name) proto
|
||||
#endif
|
||||
#define _DEFUN(name, arglist, args) name(args)
|
||||
#define _DEFUN_VOID(name) name(_NOARGS)
|
||||
#define _DEFUN(name, arglist, args) name(args)
|
||||
#define _DEFUN_VOID(name) name(_NOARGS)
|
||||
#define _CAST_VOID (void)
|
||||
#ifndef _LONG_DOUBLE
|
||||
#define _LONG_DOUBLE long double
|
||||
#endif
|
||||
#ifndef _PARAMS
|
||||
#define _PARAMS(paramlist) paramlist
|
||||
#define _PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
#else
|
||||
#define _PTR char *
|
||||
#define _AND ;
|
||||
#define _NOARGS
|
||||
#define _CONST
|
||||
#define _VOLATILE
|
||||
#define _SIGNED
|
||||
#define _DOTS
|
||||
#else
|
||||
#define _PTR char *
|
||||
#define _AND ;
|
||||
#define _NOARGS
|
||||
#define _CONST
|
||||
#define _VOLATILE
|
||||
#define _SIGNED
|
||||
#define _DOTS
|
||||
#define _VOID void
|
||||
#define _EXFUN(name, proto) name()
|
||||
#define _DEFUN(name, arglist, args) name arglist args;
|
||||
#define _DEFUN_VOID(name) name()
|
||||
#define _EXFUN(name, proto) name()
|
||||
#define _DEFUN(name, arglist, args) name arglist args;
|
||||
#define _DEFUN_VOID(name) name()
|
||||
#define _CAST_VOID
|
||||
#define _LONG_DOUBLE double
|
||||
#ifndef _PARAMS
|
||||
#define _PARAMS(paramlist) ()
|
||||
#define _PARAMS(paramlist) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
assert.h
|
||||
assert.h
|
||||
*/
|
||||
|
||||
#undef assert
|
||||
|
||||
#ifdef NDEBUG /* required by ANSI standard */
|
||||
#define assert(p) ((void)0)
|
||||
#define assert(p) ((void)0)
|
||||
#else
|
||||
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -27,14 +27,14 @@ int _EXFUN(_tolower, (int __c));
|
|||
int _EXFUN(_toupper, (int __c));
|
||||
#endif
|
||||
|
||||
#define _U 01
|
||||
#define _L 02
|
||||
#define _N 04
|
||||
#define _S 010
|
||||
#define _P 020
|
||||
#define _C 040
|
||||
#define _X 0100
|
||||
#define _B 0200
|
||||
#define _U 01
|
||||
#define _L 02
|
||||
#define _N 04
|
||||
#define _S 010
|
||||
#define _P 020
|
||||
#define _C 040
|
||||
#define _X 0100
|
||||
#define _B 0200
|
||||
|
||||
#ifdef PLUGIN
|
||||
#define _ctype_ (rb->_rbctype_)
|
||||
|
@ -43,30 +43,30 @@ extern const unsigned char _ctype_[257];
|
|||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define isalpha(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L))
|
||||
#define isupper(c) ((_ctype_+1)[(unsigned char)(c)]&_U)
|
||||
#define islower(c) ((_ctype_+1)[(unsigned char)(c)]&_L)
|
||||
#define isdigit(c) ((_ctype_+1)[(unsigned char)(c)]&_N)
|
||||
#define isxdigit(c) ((_ctype_+1)[(unsigned char)(c)]&(_X|_N))
|
||||
#define isspace(c) ((_ctype_+1)[(unsigned char)(c)]&_S)
|
||||
#define ispunct(c) ((_ctype_+1)[(unsigned char)(c)]&_P)
|
||||
#define isalnum(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L|_N))
|
||||
#define isprint(c) ((_ctype_+1)[(unsigned char)(c)]&(_P|_U|_L|_N|_B))
|
||||
#define isgraph(c) ((_ctype_+1)[(unsigned char)(c)]&(_P|_U|_L|_N))
|
||||
#define iscntrl(c) ((_ctype_+1)[(unsigned char)(c)]&_C)
|
||||
#define isalpha(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L))
|
||||
#define isupper(c) ((_ctype_+1)[(unsigned char)(c)]&_U)
|
||||
#define islower(c) ((_ctype_+1)[(unsigned char)(c)]&_L)
|
||||
#define isdigit(c) ((_ctype_+1)[(unsigned char)(c)]&_N)
|
||||
#define isxdigit(c) ((_ctype_+1)[(unsigned char)(c)]&(_X|_N))
|
||||
#define isspace(c) ((_ctype_+1)[(unsigned char)(c)]&_S)
|
||||
#define ispunct(c) ((_ctype_+1)[(unsigned char)(c)]&_P)
|
||||
#define isalnum(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L|_N))
|
||||
#define isprint(c) ((_ctype_+1)[(unsigned char)(c)]&(_P|_U|_L|_N|_B))
|
||||
#define isgraph(c) ((_ctype_+1)[(unsigned char)(c)]&(_P|_U|_L|_N))
|
||||
#define iscntrl(c) ((_ctype_+1)[(unsigned char)(c)]&_C)
|
||||
/* Non-gcc versions will get the library versions, and will be
|
||||
slightly slower */
|
||||
#ifdef __GNUC__
|
||||
# define toupper(c) \
|
||||
__extension__ ({ int __x = (unsigned char) (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
|
||||
__extension__ ({ int __x = (unsigned char) (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
|
||||
# define tolower(c) \
|
||||
__extension__ ({ int __x = (unsigned char) (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
|
||||
__extension__ ({ int __x = (unsigned char) (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
|
||||
#endif
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define isascii(c) ((unsigned char)(c)<=0177)
|
||||
#define toascii(c) ((c)&0177)
|
||||
#define isascii(c) ((unsigned char)(c)<=0177)
|
||||
#define toascii(c) ((c)&0177)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -16,130 +16,130 @@
|
|||
extern int errno;
|
||||
#endif
|
||||
|
||||
#define EPERM 1 /* Not super-user */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define ENXIO 6 /* No such device or address */
|
||||
#define E2BIG 7 /* Arg list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file number */
|
||||
#define ECHILD 10 /* No children */
|
||||
#define EAGAIN 11 /* No more processes */
|
||||
#define ENOMEM 12 /* Not enough core */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Mount device busy */
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* No such device */
|
||||
#define ENOTDIR 20 /* Not a directory */
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* Too many open files in system */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Not a typewriter */
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
#define EDOM 33 /* Math arg out of domain of func */
|
||||
#define ERANGE 34 /* Math result not representable */
|
||||
#define ENOMSG 35 /* No message of desired type */
|
||||
#define EIDRM 36 /* Identifier removed */
|
||||
#define ECHRNG 37 /* Channel number out of range */
|
||||
#define EL2NSYNC 38 /* Level 2 not synchronized */
|
||||
#define EL3HLT 39 /* Level 3 halted */
|
||||
#define EL3RST 40 /* Level 3 reset */
|
||||
#define ELNRNG 41 /* Link number out of range */
|
||||
#define EUNATCH 42 /* Protocol driver not attached */
|
||||
#define ENOCSI 43 /* No CSI structure available */
|
||||
#define EL2HLT 44 /* Level 2 halted */
|
||||
#define EDEADLK 45 /* Deadlock condition */
|
||||
#define ENOLCK 46 /* No record locks available */
|
||||
#define EBADE 50 /* Invalid exchange */
|
||||
#define EBADR 51 /* Invalid request descriptor */
|
||||
#define EXFULL 52 /* Exchange full */
|
||||
#define ENOANO 53 /* No anode */
|
||||
#define EBADRQC 54 /* Invalid request code */
|
||||
#define EBADSLT 55 /* Invalid slot */
|
||||
#define EDEADLOCK 56 /* File locking deadlock error */
|
||||
#define EBFONT 57 /* Bad font file fmt */
|
||||
#define ENOSTR 60 /* Device not a stream */
|
||||
#define ENODATA 61 /* No data (for no delay io) */
|
||||
#define ETIME 62 /* Timer expired */
|
||||
#define ENOSR 63 /* Out of streams resources */
|
||||
#define ENONET 64 /* Machine is not on the network */
|
||||
#define ENOPKG 65 /* Package not installed */
|
||||
#define EREMOTE 66 /* The object is remote */
|
||||
#define ENOLINK 67 /* The link has been severed */
|
||||
#define EADV 68 /* Advertise error */
|
||||
#define ESRMNT 69 /* Srmount error */
|
||||
#define ECOMM 70 /* Communication error on send */
|
||||
#define EPROTO 71 /* Protocol error */
|
||||
#define EMULTIHOP 74 /* Multihop attempted */
|
||||
#define ELBIN 75 /* Inode is remote (not really error) */
|
||||
#define EDOTDOT 76 /* Cross mount point (not really error) */
|
||||
#define EBADMSG 77 /* Trying to read unreadable message */
|
||||
#define ENOTUNIQ 80 /* Given log. name not unique */
|
||||
#define EBADFD 81 /* f.d. invalid for this operation */
|
||||
#define EREMCHG 82 /* Remote address changed */
|
||||
#define ELIBACC 83 /* Can't access a needed shared lib */
|
||||
#define ELIBBAD 84 /* Accessing a corrupted shared lib */
|
||||
#define ELIBSCN 85 /* .lib section in a.out corrupted */
|
||||
#define ELIBMAX 86 /* Attempting to link in too many libs */
|
||||
#define ELIBEXEC 87 /* Attempting to exec a shared library */
|
||||
#define ENOSYS 88 /* Function not implemented */
|
||||
#define EPERM 1 /* Not super-user */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define ENXIO 6 /* No such device or address */
|
||||
#define E2BIG 7 /* Arg list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file number */
|
||||
#define ECHILD 10 /* No children */
|
||||
#define EAGAIN 11 /* No more processes */
|
||||
#define ENOMEM 12 /* Not enough core */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Mount device busy */
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* No such device */
|
||||
#define ENOTDIR 20 /* Not a directory */
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* Too many open files in system */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Not a typewriter */
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
#define EDOM 33 /* Math arg out of domain of func */
|
||||
#define ERANGE 34 /* Math result not representable */
|
||||
#define ENOMSG 35 /* No message of desired type */
|
||||
#define EIDRM 36 /* Identifier removed */
|
||||
#define ECHRNG 37 /* Channel number out of range */
|
||||
#define EL2NSYNC 38 /* Level 2 not synchronized */
|
||||
#define EL3HLT 39 /* Level 3 halted */
|
||||
#define EL3RST 40 /* Level 3 reset */
|
||||
#define ELNRNG 41 /* Link number out of range */
|
||||
#define EUNATCH 42 /* Protocol driver not attached */
|
||||
#define ENOCSI 43 /* No CSI structure available */
|
||||
#define EL2HLT 44 /* Level 2 halted */
|
||||
#define EDEADLK 45 /* Deadlock condition */
|
||||
#define ENOLCK 46 /* No record locks available */
|
||||
#define EBADE 50 /* Invalid exchange */
|
||||
#define EBADR 51 /* Invalid request descriptor */
|
||||
#define EXFULL 52 /* Exchange full */
|
||||
#define ENOANO 53 /* No anode */
|
||||
#define EBADRQC 54 /* Invalid request code */
|
||||
#define EBADSLT 55 /* Invalid slot */
|
||||
#define EDEADLOCK 56 /* File locking deadlock error */
|
||||
#define EBFONT 57 /* Bad font file fmt */
|
||||
#define ENOSTR 60 /* Device not a stream */
|
||||
#define ENODATA 61 /* No data (for no delay io) */
|
||||
#define ETIME 62 /* Timer expired */
|
||||
#define ENOSR 63 /* Out of streams resources */
|
||||
#define ENONET 64 /* Machine is not on the network */
|
||||
#define ENOPKG 65 /* Package not installed */
|
||||
#define EREMOTE 66 /* The object is remote */
|
||||
#define ENOLINK 67 /* The link has been severed */
|
||||
#define EADV 68 /* Advertise error */
|
||||
#define ESRMNT 69 /* Srmount error */
|
||||
#define ECOMM 70 /* Communication error on send */
|
||||
#define EPROTO 71 /* Protocol error */
|
||||
#define EMULTIHOP 74 /* Multihop attempted */
|
||||
#define ELBIN 75 /* Inode is remote (not really error) */
|
||||
#define EDOTDOT 76 /* Cross mount point (not really error) */
|
||||
#define EBADMSG 77 /* Trying to read unreadable message */
|
||||
#define ENOTUNIQ 80 /* Given log. name not unique */
|
||||
#define EBADFD 81 /* f.d. invalid for this operation */
|
||||
#define EREMCHG 82 /* Remote address changed */
|
||||
#define ELIBACC 83 /* Can't access a needed shared lib */
|
||||
#define ELIBBAD 84 /* Accessing a corrupted shared lib */
|
||||
#define ELIBSCN 85 /* .lib section in a.out corrupted */
|
||||
#define ELIBMAX 86 /* Attempting to link in too many libs */
|
||||
#define ELIBEXEC 87 /* Attempting to exec a shared library */
|
||||
#define ENOSYS 88 /* Function not implemented */
|
||||
#define ENMFILE 89 /* No more files */
|
||||
#define ENOTEMPTY 90 /* Directory not empty */
|
||||
#define ENAMETOOLONG 91 /* File or path name too long */
|
||||
#define ELOOP 92 /* Too many symbolic links */
|
||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||
#define ENOTEMPTY 90 /* Directory not empty */
|
||||
#define ENAMETOOLONG 91 /* File or path name too long */
|
||||
#define ELOOP 92 /* Too many symbolic links */
|
||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||
#define ECONNRESET 104 /* Connection reset by peer */
|
||||
#define ENOBUFS 105 /* No buffer space available */
|
||||
#define ENOBUFS 105 /* No buffer space available */
|
||||
#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
|
||||
#define EPROTOTYPE 107 /* Protocol wrong type for socket */
|
||||
#define ENOTSOCK 108 /* Socket operation on non-socket */
|
||||
#define ENOPROTOOPT 109 /* Protocol not available */
|
||||
#define ESHUTDOWN 110 /* Can't send after socket shutdown */
|
||||
#define ECONNREFUSED 111 /* Connection refused */
|
||||
#define EADDRINUSE 112 /* Address already in use */
|
||||
#define ECONNABORTED 113 /* Connection aborted */
|
||||
#define ENETUNREACH 114 /* Network is unreachable */
|
||||
#define ENETDOWN 115 /* Network interface is not configured */
|
||||
#define ETIMEDOUT 116 /* Connection timed out */
|
||||
#define EHOSTDOWN 117 /* Host is down */
|
||||
#define EHOSTUNREACH 118 /* Host is unreachable */
|
||||
#define EINPROGRESS 119 /* Connection already in progress */
|
||||
#define EALREADY 120 /* Socket already connected */
|
||||
#define EDESTADDRREQ 121 /* Destination address required */
|
||||
#define EMSGSIZE 122 /* Message too long */
|
||||
#define EPROTONOSUPPORT 123 /* Unknown protocol */
|
||||
#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
|
||||
#define EADDRNOTAVAIL 125 /* Address not available */
|
||||
#define EPROTOTYPE 107 /* Protocol wrong type for socket */
|
||||
#define ENOTSOCK 108 /* Socket operation on non-socket */
|
||||
#define ENOPROTOOPT 109 /* Protocol not available */
|
||||
#define ESHUTDOWN 110 /* Can't send after socket shutdown */
|
||||
#define ECONNREFUSED 111 /* Connection refused */
|
||||
#define EADDRINUSE 112 /* Address already in use */
|
||||
#define ECONNABORTED 113 /* Connection aborted */
|
||||
#define ENETUNREACH 114 /* Network is unreachable */
|
||||
#define ENETDOWN 115 /* Network interface is not configured */
|
||||
#define ETIMEDOUT 116 /* Connection timed out */
|
||||
#define EHOSTDOWN 117 /* Host is down */
|
||||
#define EHOSTUNREACH 118 /* Host is unreachable */
|
||||
#define EINPROGRESS 119 /* Connection already in progress */
|
||||
#define EALREADY 120 /* Socket already connected */
|
||||
#define EDESTADDRREQ 121 /* Destination address required */
|
||||
#define EMSGSIZE 122 /* Message too long */
|
||||
#define EPROTONOSUPPORT 123 /* Unknown protocol */
|
||||
#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
|
||||
#define EADDRNOTAVAIL 125 /* Address not available */
|
||||
#define ENETRESET 126
|
||||
#define EISCONN 127 /* Socket is already connected */
|
||||
#define ENOTCONN 128 /* Socket is not connected */
|
||||
#define EISCONN 127 /* Socket is already connected */
|
||||
#define ENOTCONN 128 /* Socket is not connected */
|
||||
#define ETOOMANYREFS 129
|
||||
#define EPROCLIM 130
|
||||
#define EUSERS 131
|
||||
#define EDQUOT 132
|
||||
#define ESTALE 133
|
||||
#define ENOTSUP 134 /* Not supported */
|
||||
#define ENOTSUP 134 /* Not supported */
|
||||
#define ENOMEDIUM 135 /* No medium (in tape drive) */
|
||||
#define ENOSHARE 136 /* No such host or network path */
|
||||
#define ECASECLASH 137 /* Filename exists with different case */
|
||||
|
||||
/* From cygwin32. */
|
||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
||||
|
||||
#define __ELASTERROR 2000 /* Users can add values starting here */
|
||||
#define __ELASTERROR 2000 /* Users can add values starting here */
|
||||
|
||||
#endif /* _SYS_ERRNO_H */
|
||||
#endif /* !SIMULATOR */
|
||||
|
|
|
@ -23,25 +23,25 @@ extern "C" {
|
|||
|
||||
/* Useful constants. */
|
||||
|
||||
#define M_E 2.7182818284590452354
|
||||
#define M_LOG2E 1.4426950408889634074
|
||||
#define M_LOG10E 0.43429448190325182765
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#define M_LN10 2.30258509299404568402
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_E 2.7182818284590452354
|
||||
#define M_LOG2E 1.4426950408889634074
|
||||
#define M_LOG10E 0.43429448190325182765
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#define M_LN10 2.30258509299404568402
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_TWOPI (M_PI * 2.0)
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
#define M_PI_4 0.78539816339744830962
|
||||
#define M_3PI_4 2.3561944901923448370E0
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
#define M_PI_4 0.78539816339744830962
|
||||
#define M_3PI_4 2.3561944901923448370E0
|
||||
#define M_SQRTPI 1.77245385090551602792981
|
||||
#define M_1_PI 0.31830988618379067154
|
||||
#define M_2_PI 0.63661977236758134308
|
||||
#define M_2_SQRTPI 1.12837916709551257390
|
||||
#define M_SQRT2 1.41421356237309504880
|
||||
#define M_SQRT1_2 0.70710678118654752440
|
||||
#define M_1_PI 0.31830988618379067154
|
||||
#define M_2_PI 0.63661977236758134308
|
||||
#define M_2_SQRTPI 1.12837916709551257390
|
||||
#define M_SQRT2 1.41421356237309504880
|
||||
#define M_SQRT1_2 0.70710678118654752440
|
||||
#define M_LN2LO 1.9082149292705877000E-10
|
||||
#define M_LN2HI 6.9314718036912381649E-1
|
||||
#define M_SQRT3 1.73205080756887719000
|
||||
#define M_SQRT3 1.73205080756887719000
|
||||
#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */
|
||||
#define M_LOG2_E 0.693147180559945309417
|
||||
#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef _STDIO_H_
|
||||
#define _STDIO_H_
|
||||
#define _STDIO_H_
|
||||
|
||||
#include <_ansi.h>
|
||||
|
||||
|
@ -10,22 +10,22 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define EOF (-1)
|
||||
#define EOF (-1)
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0 /* set file offset to offset */
|
||||
#define SEEK_SET 0 /* set file offset to offset */
|
||||
#endif
|
||||
#ifndef SEEK_CUR
|
||||
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
||||
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
||||
#endif
|
||||
#ifndef SEEK_END
|
||||
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
||||
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
||||
#endif
|
||||
|
||||
#define TMP_MAX 26
|
||||
#define TMP_MAX 26
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define __VALIST __gnuc_va_list
|
||||
|
|
|
@ -23,7 +23,7 @@ extern "C" {
|
|||
#define EXIT_FAILURE 1
|
||||
#define EXIT_SUCCESS 0
|
||||
|
||||
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
|
||||
_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
|
||||
|
||||
void *malloc(size_t);
|
||||
void *calloc (size_t nmemb, size_t size);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#ifndef _STRING_H_
|
||||
#define _STRING_H_
|
||||
#define _STRING_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -20,45 +20,45 @@ extern "C" {
|
|||
#define NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
_PTR _EXFUN(memchr,(const _PTR, int, size_t));
|
||||
int _EXFUN(memcmp,(const _PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memset,(_PTR, int, size_t));
|
||||
char *_EXFUN(strcat,(char *, const char *));
|
||||
char *_EXFUN(strchr,(const char *, int));
|
||||
int _EXFUN(strcmp,(const char *, const char *));
|
||||
int _EXFUN(strcoll,(const char *, const char *));
|
||||
char *_EXFUN(strcpy,(char *, const char *));
|
||||
size_t _EXFUN(strcspn,(const char *, const char *));
|
||||
char *_EXFUN(strerror,(int));
|
||||
size_t _EXFUN(strlen,(const char *));
|
||||
char *_EXFUN(strncat,(char *, const char *, size_t));
|
||||
int _EXFUN(strncmp,(const char *, const char *, size_t));
|
||||
char *_EXFUN(strpbrk,(const char *, const char *));
|
||||
char *_EXFUN(strrchr,(const char *, int));
|
||||
size_t _EXFUN(strspn,(const char *, const char *));
|
||||
char *_EXFUN(strstr,(const char *, const char *));
|
||||
char *_EXFUN(strcasestr,(const char *, const char *));
|
||||
_PTR _EXFUN(memchr,(const _PTR, int, size_t));
|
||||
int _EXFUN(memcmp,(const _PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t));
|
||||
_PTR _EXFUN(memset,(_PTR, int, size_t));
|
||||
char *_EXFUN(strcat,(char *, const char *));
|
||||
char *_EXFUN(strchr,(const char *, int));
|
||||
int _EXFUN(strcmp,(const char *, const char *));
|
||||
int _EXFUN(strcoll,(const char *, const char *));
|
||||
char *_EXFUN(strcpy,(char *, const char *));
|
||||
size_t _EXFUN(strcspn,(const char *, const char *));
|
||||
char *_EXFUN(strerror,(int));
|
||||
size_t _EXFUN(strlen,(const char *));
|
||||
char *_EXFUN(strncat,(char *, const char *, size_t));
|
||||
int _EXFUN(strncmp,(const char *, const char *, size_t));
|
||||
char *_EXFUN(strpbrk,(const char *, const char *));
|
||||
char *_EXFUN(strrchr,(const char *, int));
|
||||
size_t _EXFUN(strspn,(const char *, const char *));
|
||||
char *_EXFUN(strstr,(const char *, const char *));
|
||||
char *_EXFUN(strcasestr,(const char *, const char *));
|
||||
|
||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
char *_EXFUN(strtok,(char *, const char *));
|
||||
char *_EXFUN(strtok,(char *, const char *));
|
||||
#endif
|
||||
|
||||
size_t _EXFUN(strxfrm,(char *, const char *, size_t));
|
||||
size_t _EXFUN(strxfrm,(char *, const char *, size_t));
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
char *_EXFUN(strtok_r,(char *, const char *, char **));
|
||||
char *_EXFUN(strtok_r,(char *, const char *, char **));
|
||||
|
||||
_PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t));
|
||||
int _EXFUN(strcasecmp,(const char *, const char *));
|
||||
int _EXFUN(strncasecmp,(const char *, const char *, size_t));
|
||||
_PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t));
|
||||
int _EXFUN(strcasecmp,(const char *, const char *));
|
||||
int _EXFUN(strncasecmp,(const char *, const char *, size_t));
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#ifndef DEFS_H /* Kludge to work around problem compiling in gdb */
|
||||
#ifndef DEFS_H /* Kludge to work around problem compiling in gdb */
|
||||
const char *_EXFUN(strsignal, (int __signo));
|
||||
#endif
|
||||
int _EXFUN(strtosigno, (const char *__name));
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
|
||||
struct tm
|
||||
{
|
||||
int tm_sec;
|
||||
int tm_min;
|
||||
int tm_hour;
|
||||
int tm_mday;
|
||||
int tm_mon;
|
||||
int tm_year;
|
||||
int tm_wday;
|
||||
int tm_yday;
|
||||
int tm_isdst;
|
||||
int tm_sec;
|
||||
int tm_min;
|
||||
int tm_hour;
|
||||
int tm_mday;
|
||||
int tm_mon;
|
||||
int tm_year;
|
||||
int tm_wday;
|
||||
int tm_yday;
|
||||
int tm_isdst;
|
||||
};
|
||||
|
||||
#if !defined(_TIME_T_DEFINED) && !defined(_TIME_T_DECLARED)
|
||||
|
|
Loading…
Reference in New Issue