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:
Andree Buschmann 2010-02-22 21:24:09 +00:00
parent 3f5f3524d4
commit 0b7dcd69c8
24 changed files with 653 additions and 653 deletions

View File

@ -1,28 +1,28 @@
/* /*
FUNCTION FUNCTION
<<memchr>>---search for character in memory <<memchr>>---search for character in memory
INDEX INDEX
memchr memchr
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
void * memchr(const void *<[s1]>, int <[c]>, size_t <[n]>); void * memchr(const void *<[s1]>, int <[c]>, size_t <[n]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
void * memchr(<[s1]>, <[c]>, <[n]>); void * memchr(<[s1]>, <[c]>, <[n]>);
void *<[string]>; void *<[string]>;
int *<[c]>; int *<[c]>;
size_t *<[n]>; size_t *<[n]>;
DESCRIPTION DESCRIPTION
This function scans the first <[n]> bytes of the memory pointed This function scans the first <[n]> bytes of the memory pointed
to by <[s1]> for the character <[c]> (converted to a char). to by <[s1]> for the character <[c]> (converted to a char).
RETURNS RETURNS
Returns a pointer to the matching byte, or a null pointer if Returns a pointer to the matching byte, or a null pointer if
<[c]> does not occur in <[s1]>. <[c]> does not occur in <[s1]>.
PORTABILITY PORTABILITY
<<memchr>> is ANSI C. <<memchr>> is ANSI C.
@ -30,7 +30,7 @@ PORTABILITY
<<memchr>> requires no supporting OS subroutines. <<memchr>> requires no supporting OS subroutines.
QUICKREF QUICKREF
memchr ansi pure memchr ansi pure
*/ */
#include <string.h> #include <string.h>
@ -59,8 +59,8 @@ QUICKREF
void * void *
_DEFUN (memchr, (s1, i, n), _DEFUN (memchr, (s1, i, n),
_CONST void *s1 _AND _CONST void *s1 _AND
int i _AND size_t n) int i _AND size_t n)
{ {
_CONST unsigned char *s = (_CONST unsigned char *)s1; _CONST unsigned char *s = (_CONST unsigned char *)s1;
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
@ -69,9 +69,9 @@ _DEFUN (memchr, (s1, i, n),
while (n-- > 0) while (n-- > 0)
{ {
if (*s == c) if (*s == c)
{ {
return (void *)s; return (void *)s;
} }
s++; s++;
} }
@ -89,15 +89,15 @@ _DEFUN (memchr, (s1, i, n),
aligned_addr = (unsigned long*)s; aligned_addr = (unsigned long*)s;
while ((!DETECTCHAR (*aligned_addr, mask)) && (n>LBLOCKSIZE)) while ((!DETECTCHAR (*aligned_addr, mask)) && (n>LBLOCKSIZE))
{ {
aligned_addr++; aligned_addr++;
n -= LBLOCKSIZE; n -= LBLOCKSIZE;
} }
/* The block of bytes currently pointed to by aligned_addr /* The block of bytes currently pointed to by aligned_addr
may contain the target character or there may be less than may contain the target character or there may be less than
LBLOCKSIZE bytes left to search. We check the last few LBLOCKSIZE bytes left to search. We check the last few
bytes using the bytewise search. */ bytes using the bytewise search. */
s = (unsigned char*)aligned_addr; s = (unsigned char*)aligned_addr;
} }
@ -105,9 +105,9 @@ _DEFUN (memchr, (s1, i, n),
while (n-- > 0) while (n-- > 0)
{ {
if (*s == c) if (*s == c)
{ {
return (void *)s; return (void *)s;
} }
s++; s++;
} }

View File

@ -1,31 +1,31 @@
/* /*
FUNCTION FUNCTION
<<memcmp>>---compare two memory areas <<memcmp>>---compare two memory areas
INDEX INDEX
memcmp memcmp
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>); int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
int memcmp(<[s1]>, <[s2]>, <[n]>) int memcmp(<[s1]>, <[s2]>, <[n]>)
void *<[s1]>; void *<[s1]>;
void *<[s2]>; void *<[s2]>;
size_t <[n]>; size_t <[n]>;
DESCRIPTION DESCRIPTION
This function compares not more than <[n]> characters of the This function compares not more than <[n]> characters of the
object pointed to by <[s1]> with the object pointed to by <[s2]>. object pointed to by <[s1]> with the object pointed to by <[s2]>.
RETURNS RETURNS
The function returns an integer greater than, equal to or The function returns an integer greater than, equal to or
less than zero according to whether the object pointed to by less than zero according to whether the object pointed to by
<[s1]> is greater than, equal to or less than the object <[s1]> is greater than, equal to or less than the object
pointed to by <[s2]>. pointed to by <[s2]>.
PORTABILITY PORTABILITY
<<memcmp>> is ANSI C. <<memcmp>> is ANSI C.
@ -33,7 +33,7 @@ PORTABILITY
<<memcmp>> requires no supporting OS subroutines. <<memcmp>> requires no supporting OS subroutines.
QUICKREF QUICKREF
memcmp ansi pure memcmp ansi pure
*/ */
#include <string.h> #include <string.h>
@ -51,9 +51,9 @@ QUICKREF
int int
_DEFUN (memcmp, (m1, m2, n), _DEFUN (memcmp, (m1, m2, n),
_CONST _PTR m1 _AND _CONST _PTR m1 _AND
_CONST _PTR m2 _AND _CONST _PTR m2 _AND
size_t n) size_t n)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
unsigned char *s1 = (unsigned char *) m1; unsigned char *s1 = (unsigned char *) m1;
@ -62,9 +62,9 @@ _DEFUN (memcmp, (m1, m2, n),
while (n--) while (n--)
{ {
if (*s1 != *s2) if (*s1 != *s2)
{ {
return *s1 - *s2; return *s1 - *s2;
} }
s1++; s1++;
s2++; s2++;
} }
@ -87,7 +87,7 @@ _DEFUN (memcmp, (m1, m2, n),
while (n >= LBLOCKSIZE) while (n >= LBLOCKSIZE)
{ {
if (*a1 != *a2) if (*a1 != *a2)
break; break;
a1++; a1++;
a2++; a2++;
n -= LBLOCKSIZE; n -= LBLOCKSIZE;
@ -102,7 +102,7 @@ _DEFUN (memcmp, (m1, m2, n),
while (n--) while (n--)
{ {
if (*s1 != *s2) if (*s1 != *s2)
return *s1 - *s2; return *s1 - *s2;
s1++; s1++;
s2++; s2++;
} }

View File

@ -30,7 +30,7 @@ PORTABILITY
QUICKREF QUICKREF
memcpy ansi pure memcpy ansi pure
*/ */
#include "config.h" #include "config.h"
#include <_ansi.h> #include <_ansi.h>
@ -51,15 +51,15 @@ QUICKREF
_PTR _PTR
_DEFUN (memcpy, (dst0, src0, len0), _DEFUN (memcpy, (dst0, src0, len0),
_PTR dst0 _AND _PTR dst0 _AND
_CONST _PTR src0 _AND _CONST _PTR src0 _AND
size_t len0) ICODE_ATTR; size_t len0) ICODE_ATTR;
_PTR _PTR
_DEFUN (memcpy, (dst0, src0, len0), _DEFUN (memcpy, (dst0, src0, len0),
_PTR dst0 _AND _PTR dst0 _AND
_CONST _PTR src0 _AND _CONST _PTR src0 _AND
size_t len0) size_t len0)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
char *dst = (char *) dst0; char *dst = (char *) dst0;

View File

@ -1,30 +1,30 @@
/* /*
FUNCTION FUNCTION
<<memmove>>---move possibly overlapping memory <<memmove>>---move possibly overlapping memory
INDEX INDEX
memmove memmove
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>); void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
void *memmove(<[dst]>, <[src]>, <[length]>) void *memmove(<[dst]>, <[src]>, <[length]>)
void *<[dst]>; void *<[dst]>;
void *<[src]>; void *<[src]>;
size_t <[length]>; size_t <[length]>;
DESCRIPTION DESCRIPTION
This function moves <[length]> characters from the block of This function moves <[length]> characters from the block of
memory starting at <<*<[src]>>> to the memory starting at memory starting at <<*<[src]>>> to the memory starting at
<<*<[dst]>>>. <<memmove>> reproduces the characters correctly <<*<[dst]>>>. <<memmove>> reproduces the characters correctly
at <<*<[dst]>>> even if the two areas overlap. at <<*<[dst]>>> even if the two areas overlap.
RETURNS RETURNS
The function returns <[dst]> as passed. The function returns <[dst]> as passed.
PORTABILITY PORTABILITY
<<memmove>> is ANSI C. <<memmove>> is ANSI C.
@ -32,7 +32,7 @@ PORTABILITY
<<memmove>> requires no supporting OS subroutines. <<memmove>> requires no supporting OS subroutines.
QUICKREF QUICKREF
memmove ansi pure memmove ansi pure
*/ */
#include "config.h" #include "config.h"
@ -54,15 +54,15 @@ QUICKREF
_PTR _PTR
_DEFUN (memmove, (dst_void, src_void, length), _DEFUN (memmove, (dst_void, src_void, length),
_PTR dst_void _AND _PTR dst_void _AND
_CONST _PTR src_void _AND _CONST _PTR src_void _AND
size_t length) ICODE_ATTR; size_t length) ICODE_ATTR;
_PTR _PTR
_DEFUN (memmove, (dst_void, src_void, length), _DEFUN (memmove, (dst_void, src_void, length),
_PTR dst_void _AND _PTR dst_void _AND
_CONST _PTR src_void _AND _CONST _PTR src_void _AND
size_t length) size_t length)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
char *dst = dst_void; char *dst = dst_void;
@ -74,16 +74,16 @@ _DEFUN (memmove, (dst_void, src_void, length),
src += length; src += length;
dst += length; dst += length;
while (length--) while (length--)
{ {
*--dst = *--src; *--dst = *--src;
} }
} }
else else
{ {
while (length--) while (length--)
{ {
*dst++ = *src++; *dst++ = *src++;
} }
} }
return dst_void; return dst_void;
@ -100,9 +100,9 @@ _DEFUN (memmove, (dst_void, src_void, length),
src += len; src += len;
dst += len; dst += len;
while (len--) while (len--)
{ {
*--dst = *--src; *--dst = *--src;
} }
} }
else else
{ {

View File

@ -1,28 +1,28 @@
/* /*
FUNCTION FUNCTION
<<memset>>---set an area of memory <<memset>>---set an area of memory
INDEX INDEX
memset memset
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
void *memset(const void *<[dst]>, int <[c]>, size_t <[length]>); void *memset(const void *<[dst]>, int <[c]>, size_t <[length]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
void *memset(<[dst]>, <[c]>, <[length]>) void *memset(<[dst]>, <[c]>, <[length]>)
void *<[dst]>; void *<[dst]>;
int <[c]>; int <[c]>;
size_t <[length]>; size_t <[length]>;
DESCRIPTION DESCRIPTION
This function converts the argument <[c]> into an unsigned This function converts the argument <[c]> into an unsigned
char and fills the first <[length]> characters of the array char and fills the first <[length]> characters of the array
pointed to by <[dst]> to the value. pointed to by <[dst]> to the value.
RETURNS RETURNS
<<memset>> returns the value of <[m]>. <<memset>> returns the value of <[m]>.
PORTABILITY PORTABILITY
<<memset>> is ANSI C. <<memset>> is ANSI C.
@ -30,7 +30,7 @@ PORTABILITY
<<memset>> requires no supporting OS subroutines. <<memset>> requires no supporting OS subroutines.
QUICKREF QUICKREF
memset ansi pure memset ansi pure
*/ */
#include <string.h> #include <string.h>
@ -41,9 +41,9 @@ QUICKREF
_PTR _PTR
_DEFUN (memset, (m, c, n), _DEFUN (memset, (m, c, n),
_PTR m _AND _PTR m _AND
int c _AND int c _AND
size_t n) size_t n)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
char *s = (char *) m; char *s = (char *) m;
@ -78,7 +78,7 @@ _DEFUN (memset, (m, c, n),
{ {
buffer = 0; buffer = 0;
for (i = 0; i < LBLOCKSIZE; i++) for (i = 0; i < LBLOCKSIZE; i++)
buffer = (buffer << 8) | c; buffer = (buffer << 8) | c;
} }
while (n >= LBLOCKSIZE*4) while (n >= LBLOCKSIZE*4)

View File

@ -3,20 +3,20 @@ FUNCTION
<<qsort>>---sort an array <<qsort>>---sort an array
INDEX INDEX
qsort qsort
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <stdlib.h> #include <stdlib.h>
void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>, void qsort(void *<[base]>, size_t <[nmemb]>, size_t <[size]>,
int (*<[compar]>)(const void *, const void *) ); int (*<[compar]>)(const void *, const void *) );
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <stdlib.h> #include <stdlib.h>
qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> ) qsort(<[base]>, <[nmemb]>, <[size]>, <[compar]> )
char *<[base]>; char *<[base]>;
size_t <[nmemb]>; size_t <[nmemb]>;
size_t <[size]>; size_t <[size]>;
int (*<[compar]>)(); int (*<[compar]>)();
DESCRIPTION DESCRIPTION
<<qsort>> sorts an array (beginning at <[base]>) of <[nmemb]> objects. <<qsort>> sorts an array (beginning at <[base]>) of <[nmemb]> objects.
@ -43,7 +43,7 @@ PORTABILITY
/*- /*-
* Copyright (c) 1992, 1993 * 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 * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -55,8 +55,8 @@ PORTABILITY
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software * 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement: * must display the following acknowledgement:
* This product includes software developed by the University of * This product includes software developed by the University of
* California, Berkeley and its contributors. * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
@ -81,142 +81,142 @@ PORTABILITY
#define inline #define inline
#endif #endif
static inline char *med3 _PARAMS((char *, char *, char *, int (*cmp)(const _PTR,const _PTR))); 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 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". * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
*/ */
#define swapcode(TYPE, parmi, parmj, n) { \ #define swapcode(TYPE, parmi, parmj, n) { \
long i = (n) / sizeof (TYPE); \ long i = (n) / sizeof (TYPE); \
register TYPE *pi = (TYPE *) (parmi); \ register TYPE *pi = (TYPE *) (parmi); \
register TYPE *pj = (TYPE *) (parmj); \ register TYPE *pj = (TYPE *) (parmj); \
do { \ do { \
register TYPE t = *pi; \ register TYPE t = *pi; \
*pi++ = *pj; \ *pi++ = *pj; \
*pj++ = t; \ *pj++ = t; \
} while (--i > 0); \ } while (--i > 0); \
} }
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ #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 static inline void
_DEFUN(swapfunc, (a, b, n, swaptype), _DEFUN(swapfunc, (a, b, n, swaptype),
char *a _AND char *a _AND
char *b _AND char *b _AND
int n _AND int n _AND
int swaptype) int swaptype)
{ {
if(swaptype <= 1) if(swaptype <= 1)
swapcode(long, a, b, n) swapcode(long, a, b, n)
else else
swapcode(char, a, b, n) swapcode(char, a, b, n)
} }
#define swap(a, b) \ #define swap(a, b) \
if (swaptype == 0) { \ if (swaptype == 0) { \
long t = *(long *)(a); \ long t = *(long *)(a); \
*(long *)(a) = *(long *)(b); \ *(long *)(a) = *(long *)(b); \
*(long *)(b) = t; \ *(long *)(b) = t; \
} else \ } else \
swapfunc(a, b, es, swaptype) 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 * static inline char *
_DEFUN(med3, (a, b, c, cmp), _DEFUN(med3, (a, b, c, cmp),
char *a _AND char *a _AND
char *b _AND char *b _AND
char *c _AND char *c _AND
int (*cmp)(const _PTR,const _PTR)) int (*cmp)(const _PTR,const _PTR))
{ {
return cmp(a, b) < 0 ? 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 ? c : a ))
:(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c )); :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
} }
void void
_DEFUN(qsort, (a, n, es, cmp), _DEFUN(qsort, (a, n, es, cmp),
void *a _AND void *a _AND
size_t n _AND size_t n _AND
size_t es _AND size_t es _AND
int (*cmp)(const _PTR,const _PTR)) int (*cmp)(const _PTR,const _PTR))
{ {
char *pa, *pb, *pc, *pd, *pl, *pm, *pn; char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
int d, r, swaptype, swap_cnt; int d, r, swaptype, swap_cnt;
loop: SWAPINIT(a, es); loop: SWAPINIT(a, es);
swap_cnt = 0; swap_cnt = 0;
if (n < 7) { if (n < 7) {
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es) for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
pl -= es) pl -= es)
swap(pl, pl - es); swap(pl, pl - es);
return; return;
} }
pm = (char *) a + (n / 2) * es; pm = (char *) a + (n / 2) * es;
if (n > 7) { if (n > 7) {
pl = a; pl = a;
pn = (char *) a + (n - 1) * es; pn = (char *) a + (n - 1) * es;
if (n > 40) { if (n > 40) {
d = (n / 8) * es; d = (n / 8) * es;
pl = med3(pl, pl + d, pl + 2 * d, cmp); pl = med3(pl, pl + d, pl + 2 * d, cmp);
pm = med3(pm - d, pm, pm + d, cmp); pm = med3(pm - d, pm, pm + d, cmp);
pn = med3(pn - 2 * d, pn - d, pn, cmp); pn = med3(pn - 2 * d, pn - d, pn, cmp);
} }
pm = med3(pl, pm, pn, cmp); pm = med3(pl, pm, pn, cmp);
} }
swap(a, pm); swap(a, pm);
pa = pb = (char *) a + es; pa = pb = (char *) a + es;
pc = pd = (char *) a + (n - 1) * es; pc = pd = (char *) a + (n - 1) * es;
for (;;) { for (;;) {
while (pb <= pc && (r = cmp(pb, a)) <= 0) { while (pb <= pc && (r = cmp(pb, a)) <= 0) {
if (r == 0) { if (r == 0) {
swap_cnt = 1; swap_cnt = 1;
swap(pa, pb); swap(pa, pb);
pa += es; pa += es;
} }
pb += es; pb += es;
} }
while (pb <= pc && (r = cmp(pc, a)) >= 0) { while (pb <= pc && (r = cmp(pc, a)) >= 0) {
if (r == 0) { if (r == 0) {
swap_cnt = 1; swap_cnt = 1;
swap(pc, pd); swap(pc, pd);
pd -= es; pd -= es;
} }
pc -= es; pc -= es;
} }
if (pb > pc) if (pb > pc)
break; break;
swap(pb, pc); swap(pb, pc);
swap_cnt = 1; swap_cnt = 1;
pb += es; pb += es;
pc -= es; pc -= es;
} }
if (swap_cnt == 0) { /* Switch to insertion sort */ if (swap_cnt == 0) { /* Switch to insertion sort */
for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es) for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
pl -= es) pl -= es)
swap(pl, pl - es); swap(pl, pl - es);
return; return;
} }
pn = (char *) a + n * es; pn = (char *) a + n * es;
r = min(pa - (char *)a, pb - pa); r = min(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r); vecswap(a, pb - r, r);
r = min((unsigned int)(pd - pc), pn - pd - es); r = min((unsigned int)(pd - pc), pn - pd - es);
vecswap(pb, pn - r, r); vecswap(pb, pn - r, r);
if ((unsigned int)(r = pb - pa) > es) if ((unsigned int)(r = pb - pa) > es)
qsort(a, r / es, es, cmp); qsort(a, r / es, es, cmp);
if ((unsigned int)(r = pd - pc) > es) { if ((unsigned int)(r = pd - pc) > es) {
/* Iterate rather than recurse to save stack space */ /* Iterate rather than recurse to save stack space */
a = pn - r; a = pn - r;
n = r / es; n = r / es;
goto loop; goto loop;
} }
/* qsort(pn - r, r / es, es, cmp);*/ /* qsort(pn - r, r / es, es, cmp);*/
} }

View File

@ -1,28 +1,28 @@
/* /*
FUNCTION FUNCTION
<<strchr>>---search for character in string <<strchr>>---search for character in string
INDEX INDEX
strchr strchr
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
char * strchr(const char *<[string]>, int <[c]>); char * strchr(const char *<[string]>, int <[c]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
char * strchr(<[string]>, <[c]>); char * strchr(<[string]>, <[c]>);
char *<[string]>; char *<[string]>;
int *<[c]>; int *<[c]>;
DESCRIPTION DESCRIPTION
This function finds the first occurence of <[c]> (converted to This function finds the first occurence of <[c]> (converted to
a char) in the string pointed to by <[string]> (including the a char) in the string pointed to by <[string]> (including the
terminating null character). terminating null character).
RETURNS RETURNS
Returns a pointer to the located character, or a null pointer Returns a pointer to the located character, or a null pointer
if <[c]> does not occur in <[string]>. if <[c]> does not occur in <[string]>.
PORTABILITY PORTABILITY
<<strchr>> is ANSI C. <<strchr>> is ANSI C.
@ -30,7 +30,7 @@ PORTABILITY
<<strchr>> requires no supporting OS subroutines. <<strchr>> requires no supporting OS subroutines.
QUICKREF QUICKREF
strchr ansi pure strchr ansi pure
*/ */
#include <string.h> #include <string.h>
@ -59,8 +59,8 @@ QUICKREF
char * char *
_DEFUN (strchr, (s1, i), _DEFUN (strchr, (s1, i),
_CONST char *s1 _AND _CONST char *s1 _AND
int i) int i)
{ {
_CONST unsigned char *s = (_CONST unsigned char *)s1; _CONST unsigned char *s = (_CONST unsigned char *)s1;
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)

View File

@ -1,30 +1,30 @@
/* /*
FUNCTION FUNCTION
<<strcmp>>---character string compare <<strcmp>>---character string compare
INDEX INDEX
strcmp strcmp
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
int strcmp(const char *<[a]>, const char *<[b]>); int strcmp(const char *<[a]>, const char *<[b]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
int strcmp(<[a]>, <[b]>) int strcmp(<[a]>, <[b]>)
char *<[a]>; char *<[a]>;
char *<[b]>; char *<[b]>;
DESCRIPTION DESCRIPTION
<<strcmp>> compares the string at <[a]> to <<strcmp>> compares the string at <[a]> to
the string at <[b]>. the string at <[b]>.
RETURNS RETURNS
If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>, If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
<<strcmp>> returns a number greater than zero. If the two <<strcmp>> returns a number greater than zero. If the two
strings match, <<strcmp>> returns zero. If <<*<[a]>>> strings match, <<strcmp>> returns zero. If <<*<[a]>>>
sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a
number less than zero. number less than zero.
PORTABILITY PORTABILITY
<<strcmp>> is ANSI C. <<strcmp>> is ANSI C.
@ -32,7 +32,7 @@ PORTABILITY
<<strcmp>> requires no supporting OS subroutines. <<strcmp>> requires no supporting OS subroutines.
QUICKREF QUICKREF
strcmp ansi pure strcmp ansi pure
*/ */
#include <string.h> #include <string.h>
@ -59,8 +59,8 @@ QUICKREF
int int
_DEFUN (strcmp, (s1, s2), _DEFUN (strcmp, (s1, s2),
_CONST char *s1 _AND _CONST char *s1 _AND
_CONST char *s2) _CONST char *s2)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
while (*s1 != '\0' && *s1 == *s2) while (*s1 != '\0' && *s1 == *s2)
@ -83,9 +83,9 @@ _DEFUN (strcmp, (s1, s2),
while (*a1 == *a2) while (*a1 == *a2)
{ {
/* To get here, *a1 == *a2, thus if we find a null in *a1, /* 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)) if (DETECTNULL (*a1))
return 0; return 0;
a1++; a1++;
a2++; a2++;

View File

@ -1,27 +1,27 @@
/* /*
FUNCTION FUNCTION
<<strcpy>>---copy string <<strcpy>>---copy string
INDEX INDEX
strcpy strcpy
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
char *strcpy(char *<[dst]>, const char *<[src]>); char *strcpy(char *<[dst]>, const char *<[src]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
char *strcpy(<[dst]>, <[src]>) char *strcpy(<[dst]>, <[src]>)
char *<[dst]>; char *<[dst]>;
char *<[src]>; char *<[src]>;
DESCRIPTION DESCRIPTION
<<strcpy>> copies the string pointed to by <[src]> <<strcpy>> copies the string pointed to by <[src]>
(including the terminating null character) to the array (including the terminating null character) to the array
pointed to by <[dst]>. pointed to by <[dst]>.
RETURNS RETURNS
This function returns the initial value of <[dst]>. This function returns the initial value of <[dst]>.
PORTABILITY PORTABILITY
<<strcpy>> is ANSI C. <<strcpy>> is ANSI C.
@ -29,7 +29,7 @@ PORTABILITY
<<strcpy>> requires no supporting OS subroutines. <<strcpy>> requires no supporting OS subroutines.
QUICKREF QUICKREF
strcpy ansi pure strcpy ansi pure
*/ */
#include <string.h> #include <string.h>
@ -59,8 +59,8 @@ QUICKREF
char* char*
_DEFUN (strcpy, (dst0, src0), _DEFUN (strcpy, (dst0, src0),
char *dst0 _AND char *dst0 _AND
_CONST char *src0) _CONST char *src0)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
char *s = dst0; char *s = dst0;

View File

@ -29,28 +29,28 @@
size_t size_t
strlcat(char *dst, const char *src, size_t siz) strlcat(char *dst, const char *src, size_t siz)
{ {
char *d = dst; char *d = dst;
const char *s = src; const char *s = src;
size_t n = siz; size_t n = siz;
size_t dlen; size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */ /* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0') while (n-- != 0 && *d != '\0')
d++; d++;
dlen = d - dst; dlen = d - dst;
n = siz - dlen; n = siz - dlen;
if (n == 0) if (n == 0)
return(dlen + strlen(s)); return(dlen + strlen(s));
while (*s != '\0') { while (*s != '\0') {
if (n != 1) { if (n != 1) {
*d++ = *s; *d++ = *s;
n--; n--;
} }
s++; s++;
} }
*d = '\0'; *d = '\0';
return(dlen + (s - src)); /* count does not include NUL */ return(dlen + (s - src)); /* count does not include NUL */
} }

View File

@ -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> * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@ -27,26 +27,26 @@
size_t size_t
strlcpy(char *dst, const char *src, size_t siz) strlcpy(char *dst, const char *src, size_t siz)
{ {
char *d = dst; char *d = dst;
const char *s = src; const char *s = src;
size_t n = siz; size_t n = siz;
/* Copy as many bytes as will fit */ /* Copy as many bytes as will fit */
if (n != 0) { if (n != 0) {
while (--n != 0) { while (--n != 0) {
if ((*d++ = *s++) == '\0') if ((*d++ = *s++) == '\0')
break; break;
} }
} }
/* Not enough room in dst, add NUL and traverse rest of src */ /* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) { if (n == 0) {
if (siz != 0) if (siz != 0)
*d = '\0'; /* NUL-terminate dst */ *d = '\0'; /* NUL-terminate dst */
while (*s++) while (*s++)
; ;
} }
return(s - src - 1); /* count does not include NUL */ return(s - src - 1); /* count does not include NUL */
} }

View File

@ -1,26 +1,26 @@
/* /*
FUNCTION FUNCTION
<<strlen>>---character string length <<strlen>>---character string length
INDEX INDEX
strlen strlen
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
size_t strlen(const char *<[str]>); size_t strlen(const char *<[str]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
size_t strlen(<[str]>) size_t strlen(<[str]>)
char *<[src]>; char *<[src]>;
DESCRIPTION DESCRIPTION
The <<strlen>> function works out the length of the string The <<strlen>> function works out the length of the string
starting at <<*<[str]>>> by counting chararacters until it starting at <<*<[str]>>> by counting chararacters until it
reaches a <<NULL>> character. reaches a <<NULL>> character.
RETURNS RETURNS
<<strlen>> returns the character count. <<strlen>> returns the character count.
PORTABILITY PORTABILITY
<<strlen>> is ANSI C. <<strlen>> is ANSI C.
@ -28,7 +28,7 @@ PORTABILITY
<<strlen>> requires no supporting OS subroutines. <<strlen>> requires no supporting OS subroutines.
QUICKREF QUICKREF
strlen ansi pure strlen ansi pure
*/ */
#include "config.h" #include "config.h"
@ -56,11 +56,11 @@ QUICKREF
size_t size_t
_DEFUN (strlen, (str), _DEFUN (strlen, (str),
_CONST char *str) ICODE_ATTR; _CONST char *str) ICODE_ATTR;
size_t size_t
_DEFUN (strlen, (str), _DEFUN (strlen, (str),
_CONST char *str) _CONST char *str)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
_CONST char *start = str; _CONST char *start = str;

View File

@ -75,26 +75,26 @@ compare_right(char const *a, char const *b)
int ca, cb; int ca, cb;
/* The longest run of digits wins. That aside, the greatest /* The longest run of digits wins. That aside, the greatest
value wins, but we can't know that it will until we've scanned 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 both numbers to know that they have the same magnitude, so we
remember it in BIAS. */ remember it in BIAS. */
for (;; a++, b++) { for (;; a++, b++) {
ca = to_int(*a); ca = to_int(*a);
cb = to_int(*b); cb = to_int(*b);
if (!nat_isdigit(ca) && !nat_isdigit(cb)) if (!nat_isdigit(ca) && !nat_isdigit(cb))
return bias; return bias;
else if (!nat_isdigit(ca)) else if (!nat_isdigit(ca))
return -1; return -1;
else if (!nat_isdigit(cb)) else if (!nat_isdigit(cb))
return +1; return +1;
else if (ca < cb) { else if (ca < cb) {
if (!bias) if (!bias)
bias = -1; bias = -1;
} else if (ca > cb) { } else if (ca > cb) {
if (!bias) if (!bias)
bias = +1; bias = +1;
} else if (!ca && !cb) } else if (!ca && !cb)
return bias; return bias;
} }
return 0; return 0;
@ -107,18 +107,18 @@ compare_left(char const *a, char const *b)
/* Compare two left-aligned numbers: the first to have a /* Compare two left-aligned numbers: the first to have a
different value wins. */ different value wins. */
for (;; a++, b++) { for (;; a++, b++) {
if (!nat_isdigit(*a) && !nat_isdigit(*b)) if (!nat_isdigit(*a) && !nat_isdigit(*b))
return 0; return 0;
else if (!nat_isdigit(*a)) else if (!nat_isdigit(*a))
return -1; return -1;
else if (!nat_isdigit(*b)) else if (!nat_isdigit(*b))
return +1; return +1;
else if (*a < *b) else if (*a < *b)
return -1; return -1;
else if (*a > *b) else if (*a > *b)
return +1; return +1;
} }
return 0; return 0;
} }
@ -134,39 +134,39 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
ca = to_int(a[ai]); ca = to_int(a[ai]);
cb = to_int(b[bi]); cb = to_int(b[bi]);
/* process run of digits */ /* process run of digits */
if (nat_isdigit(ca) && nat_isdigit(cb)) { if (nat_isdigit(ca) && nat_isdigit(cb)) {
fractional = (ca == '0' || cb == '0'); fractional = (ca == '0' || cb == '0');
if (fractional) { if (fractional) {
if ((result = compare_left(a+ai, b+bi)) != 0) if ((result = compare_left(a+ai, b+bi)) != 0)
return result; return result;
} else { } else {
if ((result = compare_right(a+ai, b+bi)) != 0) if ((result = compare_right(a+ai, b+bi)) != 0)
return result; return result;
} }
} }
if (!ca && !cb) { if (!ca && !cb) {
/* The strings compare the same. Call str[case]cmp() to ensure /* The strings compare the same. Call str[case]cmp() to ensure
consistent results. */ consistent results. */
if(fold_case) if(fold_case)
return strcasecmp(a,b); return strcasecmp(a,b);
else else
return strcmp(a,b); return strcmp(a,b);
} }
if (fold_case) { if (fold_case) {
ca = nat_unify_case(ca); ca = nat_unify_case(ca);
cb = nat_unify_case(cb); cb = nat_unify_case(cb);
} }
if (ca < cb) if (ca < cb)
return -1; return -1;
else if (ca > cb) else if (ca > cb)
return +1; return +1;
++ai; ++bi; ++ai; ++bi;
} }
} }

View File

@ -1,31 +1,31 @@
/* /*
FUNCTION FUNCTION
<<strncmp>>---character string compare <<strncmp>>---character string compare
INDEX INDEX
strncmp strncmp
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>); int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
int strncmp(<[a]>, <[b]>, <[length]>) int strncmp(<[a]>, <[b]>, <[length]>)
char *<[a]>; char *<[a]>;
char *<[b]>; char *<[b]>;
size_t <[length]> size_t <[length]>
DESCRIPTION DESCRIPTION
<<strncmp>> compares up to <[length]> characters <<strncmp>> compares up to <[length]> characters
from the string at <[a]> to the string at <[b]>. from the string at <[a]> to the string at <[b]>.
RETURNS RETURNS
If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>, If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
<<strncmp>> returns a number greater than zero. If the two <<strncmp>> returns a number greater than zero. If the two
strings are equivalent, <<strncmp>> returns zero. If <<*<[a]>>> strings are equivalent, <<strncmp>> returns zero. If <<*<[a]>>>
sorts lexicographically before <<*<[b]>>>, <<strncmp>> returns a sorts lexicographically before <<*<[b]>>>, <<strncmp>> returns a
number less than zero. number less than zero.
PORTABILITY PORTABILITY
<<strncmp>> is ANSI C. <<strncmp>> is ANSI C.
@ -33,7 +33,7 @@ PORTABILITY
<<strncmp>> requires no supporting OS subroutines. <<strncmp>> requires no supporting OS subroutines.
QUICKREF QUICKREF
strncmp ansi pure strncmp ansi pure
*/ */
#include <string.h> #include <string.h>
@ -60,9 +60,9 @@ QUICKREF
int int
_DEFUN (strncmp, (s1, s2, n), _DEFUN (strncmp, (s1, s2, n),
_CONST char *s1 _AND _CONST char *s1 _AND
_CONST char *s2 _AND _CONST char *s2 _AND
size_t n) size_t n)
{ {
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
if (n == 0) if (n == 0)
@ -71,7 +71,7 @@ _DEFUN (strncmp, (s1, s2, n),
while (n-- != 0 && *s1 == *s2) while (n-- != 0 && *s1 == *s2)
{ {
if (n == 0 || *s1 == '\0') if (n == 0 || *s1 == '\0')
break; break;
s1++; s1++;
s2++; s2++;
} }
@ -95,9 +95,9 @@ _DEFUN (strncmp, (s1, s2, n),
n -= sizeof (long); n -= sizeof (long);
/* If we've run out of bytes or hit a null, return zero /* 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)) if (n == 0 || DETECTNULL (*a1))
return 0; return 0;
a1++; a1++;
a2++; a2++;
@ -111,9 +111,9 @@ _DEFUN (strncmp, (s1, s2, n),
while (n-- > 0 && *s1 == *s2) while (n-- > 0 && *s1 == *s2)
{ {
/* If we've run out of bytes or hit a null, return zero /* 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') if (n == 0 || *s1 == '\0')
return 0; return 0;
s1++; s1++;
s2++; s2++;
} }

View File

@ -1,28 +1,28 @@
/* /*
FUNCTION FUNCTION
<<strrchr>>---reverse search for character in string <<strrchr>>---reverse search for character in string
INDEX INDEX
strrchr strrchr
ANSI_SYNOPSIS ANSI_SYNOPSIS
#include <string.h> #include <string.h>
char * strrchr(const char *<[string]>, int <[c]>); char * strrchr(const char *<[string]>, int <[c]>);
TRAD_SYNOPSIS TRAD_SYNOPSIS
#include <string.h> #include <string.h>
char * strrchr(<[string]>, <[c]>); char * strrchr(<[string]>, <[c]>);
char *<[string]>; char *<[string]>;
int *<[c]>; int *<[c]>;
DESCRIPTION DESCRIPTION
This function finds the last occurence of <[c]> (converted to This function finds the last occurence of <[c]> (converted to
a char) in the string pointed to by <[string]> (including the a char) in the string pointed to by <[string]> (including the
terminating null character). terminating null character).
RETURNS RETURNS
Returns a pointer to the located character, or a null pointer Returns a pointer to the located character, or a null pointer
if <[c]> does not occur in <[string]>. if <[c]> does not occur in <[string]>.
PORTABILITY PORTABILITY
<<strrchr>> is ANSI C. <<strrchr>> is ANSI C.
@ -30,30 +30,30 @@ PORTABILITY
<<strrchr>> requires no supporting OS subroutines. <<strrchr>> requires no supporting OS subroutines.
QUICKREF QUICKREF
strrchr ansi pure strrchr ansi pure
*/ */
#include <string.h> #include <string.h>
char * char *
_DEFUN (strrchr, (s, i), _DEFUN (strrchr, (s, i),
_CONST char *s _AND _CONST char *s _AND
int i) int i)
{ {
_CONST char *last = NULL; _CONST char *last = NULL;
if (i) if (i)
{ {
while ((s=strchr(s, i))) while ((s=strchr(s, i)))
{ {
last = s; last = s;
s++; s++;
} }
} }
else else
{ {
last = strchr(s, i); last = strchr(s, i);
} }
return (char *) last; return (char *) last;
} }

View File

@ -9,8 +9,8 @@
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
files aren't affected). */ files aren't affected). */
#ifndef _ANSIDECL_H_ #ifndef _ANSIDECL_H_
#define _ANSIDECL_H_ #define _ANSIDECL_H_
/* First try to figure out whether we really are in an ANSI C environment. */ /* 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 /* FIXME: This probably needs some work. Perhaps sys/config.h can be
@ -21,46 +21,46 @@
#endif #endif
#ifdef _HAVE_STDC #ifdef _HAVE_STDC
#define _PTR void * #define _PTR void *
#define _AND , #define _AND ,
#define _NOARGS void #define _NOARGS void
#define _CONST const #define _CONST const
#define _VOLATILE volatile #define _VOLATILE volatile
#define _SIGNED signed #define _SIGNED signed
#define _DOTS , ... #define _DOTS , ...
#define _VOID void #define _VOID void
#ifdef __CYGWIN__ #ifdef __CYGWIN__
#define _EXFUN(name, proto) __cdecl name proto #define _EXFUN(name, proto) __cdecl name proto
#define _EXPARM(name, proto) (* __cdecl name) proto #define _EXPARM(name, proto) (* __cdecl name) proto
#else #else
#define _EXFUN(name, proto) name proto #define _EXFUN(name, proto) name proto
#define _EXPARM(name, proto) (* name) proto #define _EXPARM(name, proto) (* name) proto
#endif #endif
#define _DEFUN(name, arglist, args) name(args) #define _DEFUN(name, arglist, args) name(args)
#define _DEFUN_VOID(name) name(_NOARGS) #define _DEFUN_VOID(name) name(_NOARGS)
#define _CAST_VOID (void) #define _CAST_VOID (void)
#ifndef _LONG_DOUBLE #ifndef _LONG_DOUBLE
#define _LONG_DOUBLE long double #define _LONG_DOUBLE long double
#endif #endif
#ifndef _PARAMS #ifndef _PARAMS
#define _PARAMS(paramlist) paramlist #define _PARAMS(paramlist) paramlist
#endif #endif
#else #else
#define _PTR char * #define _PTR char *
#define _AND ; #define _AND ;
#define _NOARGS #define _NOARGS
#define _CONST #define _CONST
#define _VOLATILE #define _VOLATILE
#define _SIGNED #define _SIGNED
#define _DOTS #define _DOTS
#define _VOID void #define _VOID void
#define _EXFUN(name, proto) name() #define _EXFUN(name, proto) name()
#define _DEFUN(name, arglist, args) name arglist args; #define _DEFUN(name, arglist, args) name arglist args;
#define _DEFUN_VOID(name) name() #define _DEFUN_VOID(name) name()
#define _CAST_VOID #define _CAST_VOID
#define _LONG_DOUBLE double #define _LONG_DOUBLE double
#ifndef _PARAMS #ifndef _PARAMS
#define _PARAMS(paramlist) () #define _PARAMS(paramlist) ()
#endif #endif
#endif #endif

View File

@ -1,11 +1,11 @@
/* /*
assert.h assert.h
*/ */
#undef assert #undef assert
#ifdef NDEBUG /* required by ANSI standard */ #ifdef NDEBUG /* required by ANSI standard */
#define assert(p) ((void)0) #define assert(p) ((void)0)
#else #else
#ifdef __STDC__ #ifdef __STDC__

View File

@ -27,14 +27,14 @@ int _EXFUN(_tolower, (int __c));
int _EXFUN(_toupper, (int __c)); int _EXFUN(_toupper, (int __c));
#endif #endif
#define _U 01 #define _U 01
#define _L 02 #define _L 02
#define _N 04 #define _N 04
#define _S 010 #define _S 010
#define _P 020 #define _P 020
#define _C 040 #define _C 040
#define _X 0100 #define _X 0100
#define _B 0200 #define _B 0200
#ifdef PLUGIN #ifdef PLUGIN
#define _ctype_ (rb->_rbctype_) #define _ctype_ (rb->_rbctype_)
@ -43,30 +43,30 @@ extern const unsigned char _ctype_[257];
#endif #endif
#ifndef __cplusplus #ifndef __cplusplus
#define isalpha(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L)) #define isalpha(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L))
#define isupper(c) ((_ctype_+1)[(unsigned char)(c)]&_U) #define isupper(c) ((_ctype_+1)[(unsigned char)(c)]&_U)
#define islower(c) ((_ctype_+1)[(unsigned char)(c)]&_L) #define islower(c) ((_ctype_+1)[(unsigned char)(c)]&_L)
#define isdigit(c) ((_ctype_+1)[(unsigned char)(c)]&_N) #define isdigit(c) ((_ctype_+1)[(unsigned char)(c)]&_N)
#define isxdigit(c) ((_ctype_+1)[(unsigned char)(c)]&(_X|_N)) #define isxdigit(c) ((_ctype_+1)[(unsigned char)(c)]&(_X|_N))
#define isspace(c) ((_ctype_+1)[(unsigned char)(c)]&_S) #define isspace(c) ((_ctype_+1)[(unsigned char)(c)]&_S)
#define ispunct(c) ((_ctype_+1)[(unsigned char)(c)]&_P) #define ispunct(c) ((_ctype_+1)[(unsigned char)(c)]&_P)
#define isalnum(c) ((_ctype_+1)[(unsigned char)(c)]&(_U|_L|_N)) #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 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 isgraph(c) ((_ctype_+1)[(unsigned char)(c)]&(_P|_U|_L|_N))
#define iscntrl(c) ((_ctype_+1)[(unsigned char)(c)]&_C) #define iscntrl(c) ((_ctype_+1)[(unsigned char)(c)]&_C)
/* Non-gcc versions will get the library versions, and will be /* Non-gcc versions will get the library versions, and will be
slightly slower */ slightly slower */
#ifdef __GNUC__ #ifdef __GNUC__
# define toupper(c) \ # 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) \ # 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
#endif /* !__cplusplus */ #endif /* !__cplusplus */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#define isascii(c) ((unsigned char)(c)<=0177) #define isascii(c) ((unsigned char)(c)<=0177)
#define toascii(c) ((c)&0177) #define toascii(c) ((c)&0177)
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -16,130 +16,130 @@
extern int errno; extern int errno;
#endif #endif
#define EPERM 1 /* Not super-user */ #define EPERM 1 /* Not super-user */
#define ENOENT 2 /* No such file or directory */ #define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */ #define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */ #define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */ #define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */ #define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Arg list too long */ #define E2BIG 7 /* Arg list too long */
#define ENOEXEC 8 /* Exec format error */ #define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */ #define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No children */ #define ECHILD 10 /* No children */
#define EAGAIN 11 /* No more processes */ #define EAGAIN 11 /* No more processes */
#define ENOMEM 12 /* Not enough core */ #define ENOMEM 12 /* Not enough core */
#define EACCES 13 /* Permission denied */ #define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */ #define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */ #define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Mount device busy */ #define EBUSY 16 /* Mount device busy */
#define EEXIST 17 /* File exists */ #define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */ #define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */ #define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */ #define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */ #define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */ #define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* Too many open files in system */ #define ENFILE 23 /* Too many open files in system */
#define EMFILE 24 /* Too many open files */ #define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */ #define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */ #define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */ #define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */ #define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */ #define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read only file system */ #define EROFS 30 /* Read only file system */
#define EMLINK 31 /* Too many links */ #define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */ #define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math arg out of domain of func */ #define EDOM 33 /* Math arg out of domain of func */
#define ERANGE 34 /* Math result not representable */ #define ERANGE 34 /* Math result not representable */
#define ENOMSG 35 /* No message of desired type */ #define ENOMSG 35 /* No message of desired type */
#define EIDRM 36 /* Identifier removed */ #define EIDRM 36 /* Identifier removed */
#define ECHRNG 37 /* Channel number out of range */ #define ECHRNG 37 /* Channel number out of range */
#define EL2NSYNC 38 /* Level 2 not synchronized */ #define EL2NSYNC 38 /* Level 2 not synchronized */
#define EL3HLT 39 /* Level 3 halted */ #define EL3HLT 39 /* Level 3 halted */
#define EL3RST 40 /* Level 3 reset */ #define EL3RST 40 /* Level 3 reset */
#define ELNRNG 41 /* Link number out of range */ #define ELNRNG 41 /* Link number out of range */
#define EUNATCH 42 /* Protocol driver not attached */ #define EUNATCH 42 /* Protocol driver not attached */
#define ENOCSI 43 /* No CSI structure available */ #define ENOCSI 43 /* No CSI structure available */
#define EL2HLT 44 /* Level 2 halted */ #define EL2HLT 44 /* Level 2 halted */
#define EDEADLK 45 /* Deadlock condition */ #define EDEADLK 45 /* Deadlock condition */
#define ENOLCK 46 /* No record locks available */ #define ENOLCK 46 /* No record locks available */
#define EBADE 50 /* Invalid exchange */ #define EBADE 50 /* Invalid exchange */
#define EBADR 51 /* Invalid request descriptor */ #define EBADR 51 /* Invalid request descriptor */
#define EXFULL 52 /* Exchange full */ #define EXFULL 52 /* Exchange full */
#define ENOANO 53 /* No anode */ #define ENOANO 53 /* No anode */
#define EBADRQC 54 /* Invalid request code */ #define EBADRQC 54 /* Invalid request code */
#define EBADSLT 55 /* Invalid slot */ #define EBADSLT 55 /* Invalid slot */
#define EDEADLOCK 56 /* File locking deadlock error */ #define EDEADLOCK 56 /* File locking deadlock error */
#define EBFONT 57 /* Bad font file fmt */ #define EBFONT 57 /* Bad font file fmt */
#define ENOSTR 60 /* Device not a stream */ #define ENOSTR 60 /* Device not a stream */
#define ENODATA 61 /* No data (for no delay io) */ #define ENODATA 61 /* No data (for no delay io) */
#define ETIME 62 /* Timer expired */ #define ETIME 62 /* Timer expired */
#define ENOSR 63 /* Out of streams resources */ #define ENOSR 63 /* Out of streams resources */
#define ENONET 64 /* Machine is not on the network */ #define ENONET 64 /* Machine is not on the network */
#define ENOPKG 65 /* Package not installed */ #define ENOPKG 65 /* Package not installed */
#define EREMOTE 66 /* The object is remote */ #define EREMOTE 66 /* The object is remote */
#define ENOLINK 67 /* The link has been severed */ #define ENOLINK 67 /* The link has been severed */
#define EADV 68 /* Advertise error */ #define EADV 68 /* Advertise error */
#define ESRMNT 69 /* Srmount error */ #define ESRMNT 69 /* Srmount error */
#define ECOMM 70 /* Communication error on send */ #define ECOMM 70 /* Communication error on send */
#define EPROTO 71 /* Protocol error */ #define EPROTO 71 /* Protocol error */
#define EMULTIHOP 74 /* Multihop attempted */ #define EMULTIHOP 74 /* Multihop attempted */
#define ELBIN 75 /* Inode is remote (not really error) */ #define ELBIN 75 /* Inode is remote (not really error) */
#define EDOTDOT 76 /* Cross mount point (not really error) */ #define EDOTDOT 76 /* Cross mount point (not really error) */
#define EBADMSG 77 /* Trying to read unreadable message */ #define EBADMSG 77 /* Trying to read unreadable message */
#define ENOTUNIQ 80 /* Given log. name not unique */ #define ENOTUNIQ 80 /* Given log. name not unique */
#define EBADFD 81 /* f.d. invalid for this operation */ #define EBADFD 81 /* f.d. invalid for this operation */
#define EREMCHG 82 /* Remote address changed */ #define EREMCHG 82 /* Remote address changed */
#define ELIBACC 83 /* Can't access a needed shared lib */ #define ELIBACC 83 /* Can't access a needed shared lib */
#define ELIBBAD 84 /* Accessing a corrupted shared lib */ #define ELIBBAD 84 /* Accessing a corrupted shared lib */
#define ELIBSCN 85 /* .lib section in a.out corrupted */ #define ELIBSCN 85 /* .lib section in a.out corrupted */
#define ELIBMAX 86 /* Attempting to link in too many libs */ #define ELIBMAX 86 /* Attempting to link in too many libs */
#define ELIBEXEC 87 /* Attempting to exec a shared library */ #define ELIBEXEC 87 /* Attempting to exec a shared library */
#define ENOSYS 88 /* Function not implemented */ #define ENOSYS 88 /* Function not implemented */
#define ENMFILE 89 /* No more files */ #define ENMFILE 89 /* No more files */
#define ENOTEMPTY 90 /* Directory not empty */ #define ENOTEMPTY 90 /* Directory not empty */
#define ENAMETOOLONG 91 /* File or path name too long */ #define ENAMETOOLONG 91 /* File or path name too long */
#define ELOOP 92 /* Too many symbolic links */ #define ELOOP 92 /* Too many symbolic links */
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define EPFNOSUPPORT 96 /* Protocol family not supported */ #define EPFNOSUPPORT 96 /* Protocol family not supported */
#define ECONNRESET 104 /* Connection reset by peer */ #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 EAFNOSUPPORT 106 /* Address family not supported by protocol family */
#define EPROTOTYPE 107 /* Protocol wrong type for socket */ #define EPROTOTYPE 107 /* Protocol wrong type for socket */
#define ENOTSOCK 108 /* Socket operation on non-socket */ #define ENOTSOCK 108 /* Socket operation on non-socket */
#define ENOPROTOOPT 109 /* Protocol not available */ #define ENOPROTOOPT 109 /* Protocol not available */
#define ESHUTDOWN 110 /* Can't send after socket shutdown */ #define ESHUTDOWN 110 /* Can't send after socket shutdown */
#define ECONNREFUSED 111 /* Connection refused */ #define ECONNREFUSED 111 /* Connection refused */
#define EADDRINUSE 112 /* Address already in use */ #define EADDRINUSE 112 /* Address already in use */
#define ECONNABORTED 113 /* Connection aborted */ #define ECONNABORTED 113 /* Connection aborted */
#define ENETUNREACH 114 /* Network is unreachable */ #define ENETUNREACH 114 /* Network is unreachable */
#define ENETDOWN 115 /* Network interface is not configured */ #define ENETDOWN 115 /* Network interface is not configured */
#define ETIMEDOUT 116 /* Connection timed out */ #define ETIMEDOUT 116 /* Connection timed out */
#define EHOSTDOWN 117 /* Host is down */ #define EHOSTDOWN 117 /* Host is down */
#define EHOSTUNREACH 118 /* Host is unreachable */ #define EHOSTUNREACH 118 /* Host is unreachable */
#define EINPROGRESS 119 /* Connection already in progress */ #define EINPROGRESS 119 /* Connection already in progress */
#define EALREADY 120 /* Socket already connected */ #define EALREADY 120 /* Socket already connected */
#define EDESTADDRREQ 121 /* Destination address required */ #define EDESTADDRREQ 121 /* Destination address required */
#define EMSGSIZE 122 /* Message too long */ #define EMSGSIZE 122 /* Message too long */
#define EPROTONOSUPPORT 123 /* Unknown protocol */ #define EPROTONOSUPPORT 123 /* Unknown protocol */
#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ #define ESOCKTNOSUPPORT 124 /* Socket type not supported */
#define EADDRNOTAVAIL 125 /* Address not available */ #define EADDRNOTAVAIL 125 /* Address not available */
#define ENETRESET 126 #define ENETRESET 126
#define EISCONN 127 /* Socket is already connected */ #define EISCONN 127 /* Socket is already connected */
#define ENOTCONN 128 /* Socket is not connected */ #define ENOTCONN 128 /* Socket is not connected */
#define ETOOMANYREFS 129 #define ETOOMANYREFS 129
#define EPROCLIM 130 #define EPROCLIM 130
#define EUSERS 131 #define EUSERS 131
#define EDQUOT 132 #define EDQUOT 132
#define ESTALE 133 #define ESTALE 133
#define ENOTSUP 134 /* Not supported */ #define ENOTSUP 134 /* Not supported */
#define ENOMEDIUM 135 /* No medium (in tape drive) */ #define ENOMEDIUM 135 /* No medium (in tape drive) */
#define ENOSHARE 136 /* No such host or network path */ #define ENOSHARE 136 /* No such host or network path */
#define ECASECLASH 137 /* Filename exists with different case */ #define ECASECLASH 137 /* Filename exists with different case */
/* From cygwin32. */ /* 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 /* _SYS_ERRNO_H */
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */

View File

@ -23,25 +23,25 @@ extern "C" {
/* Useful constants. */ /* Useful constants. */
#define M_E 2.7182818284590452354 #define M_E 2.7182818284590452354
#define M_LOG2E 1.4426950408889634074 #define M_LOG2E 1.4426950408889634074
#define M_LOG10E 0.43429448190325182765 #define M_LOG10E 0.43429448190325182765
#define M_LN2 0.69314718055994530942 #define M_LN2 0.69314718055994530942
#define M_LN10 2.30258509299404568402 #define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#define M_TWOPI (M_PI * 2.0) #define M_TWOPI (M_PI * 2.0)
#define M_PI_2 1.57079632679489661923 #define M_PI_2 1.57079632679489661923
#define M_PI_4 0.78539816339744830962 #define M_PI_4 0.78539816339744830962
#define M_3PI_4 2.3561944901923448370E0 #define M_3PI_4 2.3561944901923448370E0
#define M_SQRTPI 1.77245385090551602792981 #define M_SQRTPI 1.77245385090551602792981
#define M_1_PI 0.31830988618379067154 #define M_1_PI 0.31830988618379067154
#define M_2_PI 0.63661977236758134308 #define M_2_PI 0.63661977236758134308
#define M_2_SQRTPI 1.12837916709551257390 #define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880 #define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.70710678118654752440 #define M_SQRT1_2 0.70710678118654752440
#define M_LN2LO 1.9082149292705877000E-10 #define M_LN2LO 1.9082149292705877000E-10
#define M_LN2HI 6.9314718036912381649E-1 #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_IVLN10 0.43429448190325182765 /* 1 / log(10) */
#define M_LOG2_E 0.693147180559945309417 #define M_LOG2_E 0.693147180559945309417
#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ #define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */

View File

@ -1,5 +1,5 @@
#ifndef _STDIO_H_ #ifndef _STDIO_H_
#define _STDIO_H_ #define _STDIO_H_
#include <_ansi.h> #include <_ansi.h>
@ -10,22 +10,22 @@
#include <stdarg.h> #include <stdarg.h>
#ifndef NULL #ifndef NULL
#define NULL 0 #define NULL 0
#endif #endif
#define EOF (-1) #define EOF (-1)
#ifndef SEEK_SET #ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */ #define SEEK_SET 0 /* set file offset to offset */
#endif #endif
#ifndef SEEK_CUR #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 #endif
#ifndef SEEK_END #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 #endif
#define TMP_MAX 26 #define TMP_MAX 26
#ifdef __GNUC__ #ifdef __GNUC__
#define __VALIST __gnuc_va_list #define __VALIST __gnuc_va_list

View File

@ -23,7 +23,7 @@ extern "C" {
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
#define EXIT_SUCCESS 0 #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 *malloc(size_t);
void *calloc (size_t nmemb, size_t size); void *calloc (size_t nmemb, size_t size);

View File

@ -5,7 +5,7 @@
*/ */
#ifndef _STRING_H_ #ifndef _STRING_H_
#define _STRING_H_ #define _STRING_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -20,45 +20,45 @@ extern "C" {
#define NULL ((void*)0) #define NULL ((void*)0)
#endif #endif
_PTR _EXFUN(memchr,(const _PTR, int, size_t)); _PTR _EXFUN(memchr,(const _PTR, int, size_t));
int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); int _EXFUN(memcmp,(const _PTR, const _PTR, size_t));
_PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t)); _PTR _EXFUN(memcpy,(_PTR, const _PTR, size_t));
_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); _PTR _EXFUN(memmove,(_PTR, const _PTR, size_t));
_PTR _EXFUN(memset,(_PTR, int, size_t)); _PTR _EXFUN(memset,(_PTR, int, size_t));
char *_EXFUN(strcat,(char *, const char *)); char *_EXFUN(strcat,(char *, const char *));
char *_EXFUN(strchr,(const char *, int)); char *_EXFUN(strchr,(const char *, int));
int _EXFUN(strcmp,(const char *, const char *)); int _EXFUN(strcmp,(const char *, const char *));
int _EXFUN(strcoll,(const char *, const char *)); int _EXFUN(strcoll,(const char *, const char *));
char *_EXFUN(strcpy,(char *, const char *)); char *_EXFUN(strcpy,(char *, const char *));
size_t _EXFUN(strcspn,(const char *, const char *)); size_t _EXFUN(strcspn,(const char *, const char *));
char *_EXFUN(strerror,(int)); char *_EXFUN(strerror,(int));
size_t _EXFUN(strlen,(const char *)); size_t _EXFUN(strlen,(const char *));
char *_EXFUN(strncat,(char *, const char *, size_t)); char *_EXFUN(strncat,(char *, const char *, size_t));
int _EXFUN(strncmp,(const char *, const char *, size_t)); int _EXFUN(strncmp,(const char *, const char *, size_t));
char *_EXFUN(strpbrk,(const char *, const char *)); char *_EXFUN(strpbrk,(const char *, const char *));
char *_EXFUN(strrchr,(const char *, int)); char *_EXFUN(strrchr,(const char *, int));
size_t _EXFUN(strspn,(const char *, const char *)); size_t _EXFUN(strspn,(const char *, const char *));
char *_EXFUN(strstr,(const char *, const char *)); char *_EXFUN(strstr,(const char *, const char *));
char *_EXFUN(strcasestr,(const char *, const char *)); char *_EXFUN(strcasestr,(const char *, const char *));
size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz);
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
char *_EXFUN(strtok,(char *, const char *)); char *_EXFUN(strtok,(char *, const char *));
#endif #endif
size_t _EXFUN(strxfrm,(char *, const char *, size_t)); size_t _EXFUN(strxfrm,(char *, const char *, size_t));
#ifndef __STRICT_ANSI__ #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)); _PTR _EXFUN(memccpy,(_PTR, const _PTR, int, size_t));
int _EXFUN(strcasecmp,(const char *, const char *)); int _EXFUN(strcasecmp,(const char *, const char *));
int _EXFUN(strncasecmp,(const char *, const char *, size_t)); int _EXFUN(strncasecmp,(const char *, const char *, size_t));
#ifdef __CYGWIN__ #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)); const char *_EXFUN(strsignal, (int __signo));
#endif #endif
int _EXFUN(strtosigno, (const char *__name)); int _EXFUN(strtosigno, (const char *__name));

View File

@ -14,15 +14,15 @@
struct tm struct tm
{ {
int tm_sec; int tm_sec;
int tm_min; int tm_min;
int tm_hour; int tm_hour;
int tm_mday; int tm_mday;
int tm_mon; int tm_mon;
int tm_year; int tm_year;
int tm_wday; int tm_wday;
int tm_yday; int tm_yday;
int tm_isdst; int tm_isdst;
}; };
#if !defined(_TIME_T_DEFINED) && !defined(_TIME_T_DECLARED) #if !defined(_TIME_T_DEFINED) && !defined(_TIME_T_DECLARED)