Changeset 793


Ignore:
Timestamp:
Oct 2, 2003, 3:26:57 AM (22 years ago)
Author:
bird
Message:

#427: Migrated to FreeBSD 5.1 headers.

Location:
trunk/src/emx/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/memory.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r792 r793  
    1 /* memory.h (emx+gcc) */
     1/*
     2 * Copyright (c) 1988, 1993
     3 *      The Regents of the University of California.  All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. All advertising materials mentioning features or use of this software
     14 *    must display the following acknowledgement:
     15 *      This product includes software developed by the University of
     16 *      California, Berkeley and its contributors.
     17 * 4. Neither the name of the University nor the names of its contributors
     18 *    may be used to endorse or promote products derived from this software
     19 *    without specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31 * SUCH DAMAGE.
     32 *
     33 *      @(#)memory.h    8.1 (Berkeley) 6/2/93
     34 */
    235
    3 #ifndef _MEMORY_H
    4 #define _MEMORY_H
     36/** @file
     37 * FreeBSD 5.1
     38 */
    539
    6 #if defined (__cplusplus)
    7 extern "C" {
    8 #endif
     40#include <string.h>
    941
    10 #if !defined (_SIZE_T)
    11 #define _SIZE_T
    12 typedef unsigned long size_t;
    13 #endif
    14 
    15 #if !defined (NULL)
    16 #if defined (__cplusplus)
    17 #define NULL 0
    18 #else
    19 #define NULL ((void *)0)
    20 #endif
    21 #endif
    22 
    23 #if !defined (_MEMDIF_EQ)
    24 #define _MEMDIF_EQ 0xffffffff
    25 #endif
    26 
    27 void *memccpy (void *, __const__ void *, int, size_t);
    28 void *memchr (__const__ void *, int, size_t);
    29 int memcmp (__const__ void *, __const__ void *, size_t);
    30 void *memcpy (void *, __const__ void *, size_t);
    31 int memicmp (__const__ void *, __const__ void *, size_t);
    32 void *memmove (void *, __const__ void *, size_t);
    33 void *memset (void *s, int, size_t);
    34 
    35 size_t _memcount (__const__ void *, int, size_t);
    36 size_t _memdif (__const__ void *, __const__ void *, size_t);
    37 void *_memrchr (__const__ void *, int, size_t);
    38 void _memswap (void *, void *, size_t);
    39 
    40 #if defined (__cplusplus)
    41 }
    42 #endif
    43 
    44 #endif /* not _MEMORY_H */
  • trunk/src/emx/include/stdlib.h

    • Property cvs2svn:cvs-rev changed from 1.13 to 1.14
    r792 r793  
    1 /* stdlib.h (emx+gcc) */
    2 
    3 #ifndef _STDLIB_H
    4 #define _STDLIB_H
    5 
    6 #if defined (__cplusplus)
    7 extern "C" {
    8 #endif
    9 
     1/*-
     2 * Copyright (c) 1990, 1993
     3 *      The Regents of the University of California.  All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. All advertising materials mentioning features or use of this software
     14 *    must display the following acknowledgement:
     15 *      This product includes software developed by the University of
     16 *      California, Berkeley and its contributors.
     17 * 4. Neither the name of the University nor the names of its contributors
     18 *    may be used to endorse or promote products derived from this software
     19 *    without specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31 * SUCH DAMAGE.
     32 *
     33 *      @(#)stdlib.h    8.5 (Berkeley) 5/19/95
     34 * $FreeBSD: src/include/stdlib.h,v 1.48 2003/03/12 20:29:58 das Exp $
     35 */
     36
     37/** @file
     38 * FreeBSD 5.1
     39 * @changed bird: EMXifications and OS2ifications.
     40 */
     41
     42#ifndef _STDLIB_H_
     43#define _STDLIB_H_
     44
     45#include <sys/cdefs.h>
    1046#include <sys/_types.h>
    1147
    12 #if !defined (_SIZE_T)
    13 #define _SIZE_T
    14 typedef unsigned long size_t;
    15 #endif
    16 
    17 #if !defined (_WCHAR_T) && !defined (__cplusplus)
    18 #define _WCHAR_T
    19 typedef unsigned short wchar_t;
    20 #endif
    21 
    22 #ifndef _INTPTR_T_DECLARED
    23 typedef __intptr_t      intptr_t;
    24 typedef __uintptr_t     uintptr_t;
    25 #define _INTPTR_T_DECLARED
    26 #endif
    27 
    28 #if !defined(_MODE_T_DECLARED) && !defined(_MODE_T) /* bird: emx */
    29 typedef __mode_t        mode_t;
    30 #define _MODE_T_DECLARED
    31 #define _MODE_T                         /* bird: emx */
    32 #endif
    33 
    34 #if !defined (NULL)
    35 #if defined (__cplusplus)
    36 #define NULL 0
    37 #else
    38 #define NULL ((void *)0)
    39 #endif
    40 #endif
    41 
    42 #if !defined (_DIV_T)
    43 #define _DIV_T
    44 typedef struct _div_t
    45 {
    46   int quot;
    47   int rem;
     48#if __BSD_VISIBLE
     49#ifndef _RUNE_T_DECLARED
     50typedef __rune_t        rune_t;
     51#define _RUNE_T_DECLARED
     52#endif
     53#endif
     54
     55#if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird: emx */
     56typedef __size_t        size_t;
     57#define _SIZE_T_DECLARED
     58#define _SIZE_T                         /* bird: emx */
     59#endif
     60
     61#ifndef __cplusplus
     62#if !defined(_WCHAR_T_DECLARED) && !defined(_WCHAR_T) /* bird: emx */
     63typedef __wchar_t       wchar_t;
     64#define _WCHAR_T_DECLARED
     65#define _WCHAR_T                        /* bird: emx */
     66#endif
     67#endif
     68
     69typedef struct _div_t {                 /* bird: emx (tag) */
     70        int     quot;           /* quotient */
     71        int     rem;            /* remainder */
    4872} div_t;
    49 typedef struct _ldiv_t
    50 {
    51   long quot;
    52   long rem;
     73
     74typedef struct _ldiv_t {                /* bird: emx (tag) */
     75        long    quot;
     76        long    rem;
    5377} ldiv_t;
    54 #endif
    55 
    56 #if !defined (RAND_MAX)
    57 #define RAND_MAX 0x7fff
    58 #endif
    59 
    60 #if !defined (EXIT_SUCCESS)
    61 #define EXIT_SUCCESS 0
    62 #define EXIT_FAILURE 1
    63 #endif
    64 
    65 #if !defined (MB_CUR_MAX)
    66 extern int _mb_cur_max;
    67 #define MB_CUR_MAX _mb_cur_max
    68 #endif
     78
     79#ifndef NULL
     80#define NULL    0
     81#endif
     82
     83#define EXIT_FAILURE    1
     84#define EXIT_SUCCESS    0
     85
     86#define RAND_MAX        0x7fff /* bird: emx, old value 0x7fffffff */
     87
     88extern int _mb_cur_max;                 /* bird: one underscore, not two for us. */
     89#define MB_CUR_MAX      _mb_cur_max     /* bird: one underscore, not two for us. */
     90
     91__BEGIN_DECLS
     92void     abort(void) __dead2;
     93#ifndef _ABS_DECLARED                   /* bird: emx, also math.h */
     94int      abs(int) __pure2;
     95#if !defined (__GNUC__) || __GNUC__ >= 2
     96extern __inline__ int abs(int _n) { return (_n < 0 ? -_n : _n); }
     97#endif
     98#define _ABS_DECLARED
     99#endif
     100int      atexit(void (*)(void));
     101double   atof(const char *);
     102int      atoi(const char *);
     103long     atol(const char *);
     104void    *bsearch(const void *, const void *, size_t,
     105            size_t, int (*)(const void *, const void *));
     106void    *calloc(size_t, size_t);
     107div_t    div(int, int) __pure2;
     108void     exit(int) __dead2;
     109void     free(void *);
     110char    *getenv(const char *);
     111#ifndef _LABS_DECLARED                  /* bird: emx, also math.h */
     112long     labs(long) __pure2;
     113#if !defined (__GNUC__) || __GNUC__ >= 2
     114extern __inline__ long labs(long _n) { return (_n < 0 ? -_n : _n); }
     115#endif
     116#define _LABS_DECLARED
     117#endif
     118ldiv_t   ldiv(long, long) __pure2;
     119void    *malloc(size_t);
     120int      mblen(const char *, size_t);
     121size_t   mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
     122int      mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
     123void     qsort(void *, size_t, size_t,
     124            int (*)(const void *, const void *));
     125int      rand(void);
     126void    *realloc(void *, size_t);
     127void     srand(unsigned);
     128double   strtod(const char * __restrict, char ** __restrict);
     129float    strtof(const char * __restrict, char ** __restrict);
     130long     strtol(const char * __restrict, char ** __restrict, int);
     131long double
     132         strtold(const char * __restrict, char ** __restrict);
     133unsigned long
     134         strtoul(const char * __restrict, char ** __restrict, int);
     135int      system(const char *);
     136int      wctomb(char *, wchar_t);
     137size_t   wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
     138
     139/*
     140 * Functions added in C99 which we make conditionally available in the
     141 * BSD^C89 namespace if the compiler supports `long long'.
     142 * The #if test is more complicated than it ought to be because
     143 * __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long'
     144 * is not supported in the compilation environment (which therefore means
     145 * that it can't really be ISO C99).
     146 *
     147 * (The only other extension made by C99 in thie header is _Exit().)
     148 */
     149#if __ISO_C_VISIBLE >= 1999
     150#ifdef __LONG_LONG_SUPPORTED
     151/* LONGLONG */
     152typedef struct _lldiv_t {               /* bird: emx (tag) */
     153        long long quot;
     154        long long rem;
     155} lldiv_t;
     156
     157/* LONGLONG */
     158long long
     159         atoll(const char *);
     160/* LONGLONG */
     161long long
     162         llabs(long long) __pure2;
     163/* LONGLONG */
     164/** @todo lldiv_t        lldiv(long long, long long) __pure2; */
     165/* LONGLONG */
     166long long
     167         strtoll(const char * __restrict, char ** __restrict, int);
     168/* LONGLONG */
     169unsigned long long
     170         strtoull(const char * __restrict, char ** __restrict, int);
     171#endif /* __LONG_LONG_SUPPORTED */
     172
     173void     _Exit(int) __dead2;
     174#endif /* __ISO_C_VISIBLE >= 1999 */
     175
     176/*
     177 * Extensions made by POSIX relative to C.  We don't know yet which edition
     178 * of POSIX made these extensions, so assume they've always been there until
     179 * research can be done.
     180 */
     181#if __POSIX_VISIBLE /* >= ??? */
     182/* int   posix_memalign(void **, size_t, size_t); (ADV) */
     183/** @todo int    rand_r(unsigned *);    */              /* (TSF) */
     184int      setenv(const char *, const char *, int);
     185int      unsetenv(const char *);        /* bird: standard saith shall return int. */
     186#endif
     187
     188/*
     189 * The only changes to the XSI namespace in revision 6 were the deletion
     190 * of the ttyslot() and valloc() functions, which FreeBSD never declared
     191 * in this header.  For revision 7, ecvt(), fcvt(), and gcvt(), which
     192 * FreeBSD also does not have, and mktemp(), are to be deleted.
     193 */
     194#if __XSI_VISIBLE
     195/* XXX XSI requires pollution from <sys/wait.h> here.  We'd rather not. */
     196/* long  a64l(const char *); */
     197double   drand48(void);
     198/* char *ecvt(double, int, int * __restrict, int * __restrict); */
     199double   erand48(unsigned short[3]);
     200/* char *fcvt(double, int, int * __restrict, int * __restrict); */
     201/* char *gcvt(double, int, int * __restrict, int * __restrict); */
     202#ifndef _GETSUBOPT_DECLARED
     203/** @todo int    getsubopt(char **, char *const *, char **); */
     204#define _GETSUBOPT_DECLARED
     205#endif
     206/** @todo int    grantpt(int); */
     207char    *initstate(unsigned long /* XSI requires u_int */, char *, long);
     208long     jrand48(unsigned short[3]);
     209/* char *l64a(long); */
     210void     lcong48(unsigned short[7]);
     211long     lrand48(void);
     212#ifndef _MKSTEMP_DECLARED
     213int      mkstemp(char *);
     214#define _MKSTEMP_DECLARED
     215#endif
     216#ifndef _MKTEMP_DECLARED
     217char    *mktemp(char *);
     218#define _MKTEMP_DECLARED
     219#endif
     220long     mrand48(void);
     221long     nrand48(unsigned short[3]);
     222/** @todo int    posix_openpt(int); */
     223/** @todo char  *ptsname(int); */
     224int      putenv(const char *);
     225long     random(void);
     226/** @todo char  *realpath(const char *, char resolved_path[]); */
     227unsigned short
     228        *seed48(unsigned short[3]);
     229#ifndef _SETKEY_DECLARED
     230/** @todo int    setkey(const char *); */
     231#define _SETKEY_DECLARED
     232#endif
     233char    *setstate(/* const */ char *);
     234void     srand48(long);
     235void     srandom(unsigned long);
     236/** @todo int    unlockpt(int); */
     237#endif /* __XSI_VISIBLE */
     238
     239#if __BSD_VISIBLE
     240extern const char *_malloc_options;
     241extern void (*_malloc_message)(const char *, const char *, const char *,
     242            const char *);
     243
     244void    *alloca(size_t);                /* built-in for gcc */
     245/** @todo __uint32_t
     246         arc4random(void); */
     247/** @todo void   arc4random_addrandom(unsigned char *dat, int datlen); */
     248/** @todo void   arc4random_stir(void); */
     249char    *getbsize(int *, long *);
     250                                        /* getcap(3) functions */
     251/** @todo char  *cgetcap(char *, const char *, int); */
     252/** @todo int    cgetclose(void); */
     253/** @todo int    cgetent(char **, char **, const char *); */
     254/** @todo int    cgetfirst(char **, char **); */
     255/** @todo int    cgetmatch(const char *, const char *); */
     256/** @todo int    cgetnext(char **, char **); */
     257/** @todo int    cgetnum(char *, const char *, long *); */
     258/** @todo int    cgetset(const char *); */
     259/** @todo int    cgetstr(char *, const char *, char **); */
     260/** @todo int    cgetustr(char *, const char *, char **); */
     261
     262/** @todo int    daemon(int, int); */
     263/** @todo char  *devname(int, int); */
     264/** @todo int    getloadavg(double [], int); */
     265/** @todo __const char *
     266         getprogname(void); */
     267
     268int      heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
     269int      mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
     270void     qsort_r(void *, size_t, size_t, void *,
     271            int (*)(void *, const void *, const void *));
     272int      radixsort(const unsigned char **, int, const unsigned char *,
     273            unsigned);
     274/** @todo void    *reallocf(void *, size_t); */
     275/** @todo void   setprogname(const char *); */
     276int      sradixsort(const unsigned char **, int, const unsigned char *,
     277            unsigned);
     278/** @todo void   sranddev(void); */
     279void     srandomdev(void);
     280
     281/* Deprecated interfaces, to be removed in FreeBSD 6.0. */
     282/** @todo __int64_t
     283         strtoq(const char *, char **, int); */
     284/** @todo __uint64_t
     285         strtouq(const char *, char **, int); */
     286#endif /* __BSD_VISIBLE */
     287
     288
     289
     290/* bird: EMX/PC stuff - start  */
     291
     292#include <malloc.h>
    69293
    70294#if !defined (_MAX_PATH)
     
    76300#endif
    77301
    78 
    79 void abort (void) __attribute__ ((__noreturn__));
    80 int atexit (void (*)(void));
    81 double atof (__const__ char *);
    82 int atoi (__const__ char *);
    83 long atol (__const__ char *);
    84 void *bsearch (__const__ void *, __const__ void *, size_t, size_t,
    85     int (*)(__const__ void *, __const__ void *));
    86 div_t div (int, int);
    87 ldiv_t ldiv (long, long);
    88 void exit (int) __attribute__ ((__noreturn__));
    89 char *getenv (__const__ char *);
    90 int mblen (__const__ char *, size_t);
    91 size_t mbstowcs (wchar_t *, __const__ char *, size_t);
    92 int mbtowc (wchar_t *, __const__ char *, size_t);
    93 void qsort (void *, size_t, size_t,
    94     int (*)(__const__ void *, __const__ void *));
    95 int rand (void);
    96 void srand (unsigned);
    97 double strtod (__const__ char *, char **);
    98 long strtol (__const__ char *, char **, int);
    99 unsigned long strtoul (__const__ char *, char **, int);
    100 int system (__const__ char *);
    101 size_t wcstombs (char *, __const__ wchar_t *, size_t);
    102 int wctomb (char *, wchar_t);
    103 
    104 #if !defined (_ABS)                                      /* see also math.h */
    105 #define _ABS
    106 #if !defined (__GNUC__) || __GNUC__ >= 2
    107 extern int abs (int);
    108 extern long labs (long);
    109 #else
    110 extern __inline__ int abs (int _n) { return (_n < 0 ? -_n : _n); }
    111 extern __inline__ long labs (long _n) { return (_n < 0 ? -_n : _n); }
    112 #endif
    113 #endif
    114 
    115 #if !defined (__NO_C9X)
    116 
    117 float strtof (__const__ char *, char **);
    118 long double strtold (__const__ char *, char **);
    119 
    120 #endif
    121 
    122 
    123302#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
    124303
     
    128307#endif
    129308
     309#ifndef _INTPTR_T_DECLARED
     310typedef __intptr_t      intptr_t;
     311typedef __uintptr_t     uintptr_t;
     312#define _INTPTR_T_DECLARED
     313#endif
     314
     315#if !defined(_MODE_T_DECLARED) && !defined(_MODE_T) /* bird: emx */
     316typedef __mode_t        mode_t;
     317#define _MODE_T_DECLARED
     318#define _MODE_T                         /* bird: emx */
     319#endif
     320
     321/* declare _errno to be compatible with MS/VAC/WATCOM */
    130322#if !defined (_ERRNO)
    131323#define _ERRNO
    132 extern int *_errno (void);
    133 #define errno (*_errno ())
    134 #endif
     324extern int * _errno(void);
     325#define errno (* _errno())
     326#endif /* bird: emx */
    135327
    136328#if !defined (_ULDIV_T)
     
    155347extern char **environ;
    156348
    157 /* This shouldn't be here, but in stdio.h or errno.h
    158 extern __const int sys_nerr;
    159 extern __const char *__const sys_errlist[];
    160 */
    161 
    162349extern __const__ unsigned char _osminor;
    163350extern __const__ unsigned char _osmajor;
     
    169356int brk(const void *);
    170357int chdir (__const__ char *);
    171 char *gcvt (double, int, char *);
     358char *gcvt (double, int, char *); /* this is rubbish standardwise */
    172359char *getcwd (char *, size_t);
    173360int getpagesize (void);
     
    175362int     mkdir(const char *, mode_t);
    176363void perror (__const__ char *);
    177 int putenv (__const__ char *);
    178364int rmdir (__const__ char *);
    179365void *sbrk(intptr_t);
     
    182368long ulimit (int, ...);
    183369
    184 /* BSD - start */
    185 int heapsort (void *, size_t, size_t,
    186     int (*)(__const__ void *, __const__ void *));       /* BSD */
    187 char    *initstate(unsigned long /* XSI requires u_int */, char *, long);
    188 char    *setstate(/* const */ char *);
    189 long     random(void);
    190 void     srandom(unsigned long);
    191 void     srandomdev(void);
    192 /* BSD - end */
    193 
    194370char *itoa (int, char *, int);
    195371char *ltoa (long, char *, int);
     
    197373char *lltoa (long long, char *, int);
    198374char *ulltoa (unsigned long long, char *, int);
    199 
    200 int unsetenv(const char *name);
    201 int setenv(const char *envname, const char *envval, int overwrite);
    202375
    203376#endif
     
    289462void **_threadstore (void);
    290463
     464int _setenv(const char *envname, const char *envval, int overwrite);
    291465int _unsetenv(const char *name);
    292 int _setenv(const char *envname, const char *envval, int overwrite);
    293 
    294 #endif
    295 
    296 
    297 #if defined (__cplusplus)
    298 }
    299 #endif
    300 
    301 #include <malloc.h>
    302 
    303 #endif /* not _STDLIB_H */
     466
     467#endif
     468
     469__END_DECLS
     470
     471/* bird: EMX/PC stuff - start  */
     472
     473#endif /* !_STDLIB_H_ */
     474
  • trunk/src/emx/include/string.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r792 r793  
    1 /* string.h (emx+gcc) */
     1/*-
     2 * Copyright (c) 1990, 1993
     3 *      The Regents of the University of California.  All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. All advertising materials mentioning features or use of this software
     14 *    must display the following acknowledgement:
     15 *      This product includes software developed by the University of
     16 *      California, Berkeley and its contributors.
     17 * 4. Neither the name of the University nor the names of its contributors
     18 *    may be used to endorse or promote products derived from this software
     19 *    without specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     31 * SUCH DAMAGE.
     32 *
     33 *      @(#)string.h    8.1 (Berkeley) 6/2/93
     34 * $FreeBSD: src/include/string.h,v 1.18 2002/10/14 20:38:40 mike Exp $
     35 */
    236
    3 #ifndef _STRING_H
    4 #define _STRING_H
     37/** @file
     38 * FreeBSD 5.1
     39 * @changed bird: EMXifications.
     40 */
    541
    6 #if defined (__cplusplus)
    7 extern "C" {
     42#ifndef _STRING_H_
     43#define _STRING_H_
     44
     45#include <sys/cdefs.h>
     46#include <sys/_types.h>
     47
     48/*
     49 * Prototype functions which were historically defined in <string.h>, but
     50 * are required by POSIX to be prototyped in <strings.h>.
     51 */
     52#if __BSD_VISIBLE
     53#include <strings.h>
    854#endif
    955
    10 #if !defined (_SIZE_T)
    11 #define _SIZE_T
    12 typedef unsigned long size_t;
     56#if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T)  /* bird: EMX */
     57typedef __size_t        size_t;
     58#define _SIZE_T_DECLARED
     59#define _SIZE_T                         /* bird: EMX */
    1360#endif
    1461
    15 #if !defined (NULL)
    16 #if defined (__cplusplus)
    17 #define NULL 0
    18 #else
    19 #define NULL ((void *)0)
    20 #endif
     62#ifndef NULL
     63#define NULL    0
    2164#endif
    2265
    23 void *memchr (__const__ void *, int, size_t);
    24 int memcmp (__const__ void *, __const__ void *, size_t);
    25 void *memcpy (void *, __const__ void *, size_t);
    26 void *memmove (void *, __const__ void *, size_t);
    27 void *memset (void *, int, size_t);
    28 
    29 char *strcat (char *, __const__ char *);
    30 char *strchr (__const__ char *, int);
    31 int strcmp (__const__ char *, __const__ char *);
    32 int strcoll (__const__ char *, __const__ char *);
    33 char *strcpy (char *, __const__ char *);
    34 size_t strcspn (__const__ char *, __const__ char *);
    35 char *strerror (int);
    36 size_t strlen (__const__ char *);
    37 char *strncat (char *, __const__ char *, size_t);
    38 int strncmp (__const__ char *, __const__ char *, size_t);
    39 char *strncpy (char *, __const__ char *, size_t);
    40 char *strpbrk (__const__ char *, __const__ char *);
    41 char *strrchr (__const__ char *, int);
    42 size_t strspn (__const__ char *, __const__ char *);
    43 char *strstr (__const__ char *, __const__ char *);
    44 char *strtok (char *, __const__ char *);
    45 size_t strxfrm (char *, __const__ char *, size_t);
     66__BEGIN_DECLS
     67#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
     68void    *memccpy(void * __restrict, const void * __restrict, int, size_t);
     69#endif
     70void    *memchr(const void *, int, size_t);
     71int      memcmp(const void *, const void *, size_t);
     72void    *memcpy(void * __restrict, const void * __restrict, size_t);
     73void    *memmove(void *, const void *, size_t);
     74void    *memset(void *, int, size_t);
     75#if __BSD_VISIBLE
     76char    *stpcpy(char *, const char *);
     77char    *strcasestr(const char *, const char *);
     78#endif
     79char    *strcat(char * __restrict, const char * __restrict);
     80char    *strchr(const char *, int);
     81int      strcmp(const char *, const char *);
     82int      strcoll(const char *, const char *);
     83char    *strcpy(char * __restrict, const char * __restrict);
     84size_t   strcspn(const char *, const char *);
     85#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
     86char    *strdup(const char *);
     87#endif
     88char    *strerror(int);
     89#if __POSIX_VISIBLE >= 200112
     90/** @todo int    strerror_r(int, char *, size_t);*/
     91#endif
     92#if __BSD_VISIBLE
     93size_t   strlcat(char *, const char *, size_t);
     94size_t   strlcpy(char *, const char *, size_t);
     95#endif
     96size_t   strlen(const char *);
     97#if __BSD_VISIBLE
     98/** @todo void   strmode(int, char *); */
     99#endif
     100char    *strncat(char * __restrict, const char * __restrict, size_t);
     101int      strncmp(const char *, const char *, size_t);
     102char    *strncpy(char * __restrict, const char * __restrict, size_t);
     103#if __BSD_VISIBLE
     104char    *strnstr(const char *, const char *, size_t);
     105#endif
     106char    *strpbrk(const char *, const char *);
     107char    *strrchr(const char *, int);
     108#if __BSD_VISIBLE
     109char    *strsep(char **, const char *);
     110/** @todo char  *strsignal(int); */
     111#endif
     112size_t   strspn(const char *, const char *);
     113char    *strstr(const char *, const char *);
     114char    *strtok(char * __restrict, const char * __restrict);
     115#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
     116/**@todo char   *strtok_r(char *, const char *, char **); */
     117#endif
     118size_t   strxfrm(char * __restrict, const char * __restrict, size_t);
     119#if __BSD_VISIBLE
     120void     swab(const void *, void *, size_t);
     121#endif
    46122
    47123
     124/* bird: EMX stuff - start */
     125
    48126#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
    49 
    50127#if !defined (_MEMDIF_EQ)
    51128#define _MEMDIF_EQ 0xffffffff
    52129#endif
    53 
    54 void *memccpy (void *, __const__ void *, int, size_t);
    55 int memicmp (__const__ void *, __const__ void *, size_t);
    56 
    57 char *strdup (__const__ char *);
    58 int stricmp (__const__ char *, __const__ char *);
    59 int strcasecmp (__const__ char *, __const__ char *);
    60 char *strlwr (char *);
    61 int strnicmp (__const__ char *, __const__ char *, size_t);
    62 int strncasecmp (__const__ char *, __const__ char *, size_t);
    63 char *strnset (char *, int, size_t);
    64 char *strrev (char *);
    65 char *strset (char *, int);
    66 char *strupr (char *);
    67 
    68 char *strsep (char **, __const__ char *); /* BSD */
    69 
     130int     memicmp(__const__ void *, __const__ void *, size_t);
     131int     stricmp(__const__ char *, __const__ char *);
     132char *  strlwr(char *);
     133int     strnicmp(__const__ char *, __const__ char *, size_t);
     134char *  strnset(char *, int, size_t);
     135char *  strrev(char *);
     136char *  strset(char *, int);
     137char *  strupr(char *);
     138/* bird: Are we sure we actually want this stuff _here_ ? */
    70139extern char *__gnu_basename (const char *);
    71140#ifndef _LIBGEN_H
    72141#define basename __gnu_basename
    73142#endif
    74 
    75143#endif
    76 
    77144
    78145#if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \
    79146    || defined (_WITH_UNDERSCORE)
    80 
    81147size_t _memcount (__const__ void *, int, size_t);
    82148size_t _memdif (__const__ void *, __const__ void *, size_t);
     
    84150void _memswap (void *, void *, size_t);
    85151char *_strncpy (char *, __const__ char *, size_t);
    86 
    87152void *_memccpy (void *, __const__ void *, int, size_t);
    88153int _memicmp (__const__ void *, __const__ void *, size_t);
     
    96161char *_strupr (char *);
    97162char *_strsep (char **, __const__ char *);
    98 
    99163#endif
    100164
     165/* bird: EMX stuff - end */
    101166
    102 #if defined (__cplusplus)
    103 }
    104 #endif
     167__END_DECLS
    105168
    106 #endif /* not _STRING_H */
     169#endif /* _STRING_H_ */
     170
  • trunk/src/emx/include/strings.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r792 r793  
    1 /* strings.h (emx+gcc) */
     1/*-
     2 * Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
     3 * All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 *
     14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     24 * SUCH DAMAGE.
     25 *
     26 * $FreeBSD: src/include/strings.h,v 1.3 2002/08/21 16:19:55 mike Exp $
     27 */
    228
    3 #ifndef _STRINGS_H
    4 #define _STRINGS_H
     29/** @file
     30 * FreeBSD 5.1
     31 * @changed bird: EMXifications.
     32 */
    533
    6 #include <string.h>
     34#ifndef _STRINGS_H_
     35#define _STRINGS_H_
    736
    8 #if defined (__cplusplus)
    9 extern "C" {
     37#include <sys/cdefs.h>
     38#include <sys/_types.h>
     39
     40#if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird: EMX */
     41typedef __size_t        size_t;
     42#define _SIZE_T_DECLARED
     43#define _SIZE_T                         /* bird: EMX */
    1044#endif
    1145
    12 int  bcmp (__const__ void *, __const__ void *, size_t);
    13 void bcopy (__const__ void *, void *, size_t);
    14 void bzero (void *, size_t);
    15 int ffs (int i);
    16 char *index (__const__ char *, int);
    17 char *rindex (__const__ char *, int);
     46__BEGIN_DECLS
     47int      bcmp(const void *, const void *, size_t);      /* LEGACY */
     48void     bcopy(const void *, void *, size_t);           /* LEGACY */
     49void     bzero(void *, size_t);                         /* LEGACY */
     50int      ffs(int);
     51char    *index(const char *, int);                      /* LEGACY */
     52char    *rindex(const char *, int);                     /* LEGACY */
     53int      strcasecmp(const char *, const char *);
     54int      strncasecmp(const char *, const char *, size_t);
     55__END_DECLS
    1856
     57#endif /* _STRINGS_H_ */
    1958
    20 #if defined (__cplusplus)
    21 }
    22 #endif
    23 
    24 #endif /* not _STRINGS_H */
Note: See TracChangeset for help on using the changeset viewer.