⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdlib.h

📁 eCos操作系统源码
💻 H
字号:
#ifndef CYGONCE_ISO_STDLIB_H#define CYGONCE_ISO_STDLIB_H/*========================================================================////      stdlib.h////      ISO standard library functions////========================================================================//####ECOSGPLCOPYRIGHTBEGIN####// -------------------------------------------// This file is part of eCos, the Embedded Configurable Operating System.// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.//// eCos is free software; you can redistribute it and/or modify it under// the terms of the GNU General Public License as published by the Free// Software Foundation; either version 2 or (at your option) any later version.//// eCos is distributed in the hope that it will be useful, but WITHOUT ANY// WARRANTY; without even the implied warranty of MERCHANTABILITY or// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License// for more details.//// You should have received a copy of the GNU General Public License along// with eCos; if not, write to the Free Software Foundation, Inc.,// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.//// As a special exception, if other files instantiate templates or use macros// or inline functions from this file, or you compile this file and link it// with other works to produce a work based on this file, this file does not// by itself cause the resulting work to be covered by the GNU General Public// License. However the source code for this file must still be made available// in accordance with section (3) of the GNU General Public License.//// This exception does not invalidate any other reasons why a work based on// this file might be covered by the GNU General Public License.//// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.// at http://sources.redhat.com/ecos/ecos-license/// -------------------------------------------//####ECOSGPLCOPYRIGHTEND####//========================================================================//#####DESCRIPTIONBEGIN####//// Author(s):     jlarmour// Contributors:  // Date:          2000-04-14// Purpose:       This file provides the stdlib functions required by //                ISO C and POSIX 1003.1.// Description:   The real contents of this file get set from the//                configuration (set by the implementation)// Usage:         #include <stdlib.h>////####DESCRIPTIONEND####////======================================================================*//* CONFIGURATION */#include <pkgconf/isoinfra.h>          /* Configuration header *//* INCLUDES *//* This is the "standard" way to get NULL, wchar_t and size_t from stddef.h, * which is the canonical location of the definitions. */#define __need_NULL#define __need_size_t#define __need_wchar_t#include <stddef.h>#include <cyg/infra/cyg_type.h>     /* For CYGBLD_ATTRIB_NORET etc. *//*==========================================================================*/#if CYGINT_ISO_STDLIB_STRCONV# ifdef CYGBLD_ISO_STDLIB_STRCONV_HEADER#  include CYGBLD_ISO_STDLIB_STRCONV_HEADER# else/* ISO C 7.10.1 - String conversion functions */#ifdef __cplusplusextern "C" {#endifextern intatoi( const char * /* int_str */ );extern longatol( const char * /* long_str */ );extern longstrtol( const char * /* long_str */, char ** /* endptr */,        int /* base */ );extern unsigned longstrtoul( const char * /* ulong_str */, char ** /* endptr */,         int /* base */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_STDLIB_STRCONV_FLOAT# ifdef CYGBLD_ISO_STDLIB_STRCONV_FLOAT_HEADER#  include CYGBLD_ISO_STDLIB_STRCONV_FLOAT_HEADER# else/* ISO C 7.10.1 - String conversion functions */#ifdef __cplusplusextern "C" {#endifextern doubleatof( const char * /* double_str */ );extern doublestrtod( const char * /* double_str */, char ** /* endptr */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_RAND# ifdef CYGBLD_ISO_RAND_HEADER#  include CYGBLD_ISO_RAND_HEADER# else/* ISO C 7.10.2 - Pseudo-random sequence generation functions *//* Maximum value returned by rand().  */#define RAND_MAX  2147483647#ifdef __cplusplusextern "C" {#endifextern intrand( void );extern voidsrand( unsigned int /* seed */ );/* POSIX 1003.1 section 8.3.8 rand_r() */extern intrand_r( unsigned int * /* seed */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_MALLOC# ifdef CYGBLD_ISO_MALLOC_HEADER#  include CYGBLD_ISO_MALLOC_HEADER# else/* ISO C 7.10.3 - Memory management functions */#ifdef __cplusplusextern "C" {#endifextern void *calloc( size_t /* num_objects */, size_t /* object_size */ );extern voidfree( void * /* ptr */ );extern void *malloc( size_t /* size */ );extern void *realloc( void * /* ptr */, size_t /* size */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_MALLINFO# ifdef CYGBLD_ISO_MALLINFO_HEADER#  include CYGBLD_ISO_MALLINFO_HEADER# else#ifdef __cplusplusextern "C" {#endif/* SVID2/XPG mallinfo structure */struct mallinfo {    int arena;    /* total size of memory arena */    int ordblks;  /* number of ordinary memory blocks */    int smblks;   /* number of small memory blocks */    int hblks;    /* number of mmapped regions */    int hblkhd;   /* total space in mmapped regions */    int usmblks;  /* space used by small memory blocks */    int fsmblks;  /* space available for small memory blocks */    int uordblks; /* space used by ordinary memory blocks */    int fordblks; /* space free for ordinary blocks */    int keepcost; /* top-most, releasable (via malloc_trim) space */    int maxfree;  /* (NON-STANDARD EXTENSION) size of largest free block */};extern struct mallinfomallinfo( void );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_EXIT# ifdef CYGBLD_ISO_EXIT_HEADER#  include CYGBLD_ISO_EXIT_HEADER# else/* ISO C 7.10.4 - Communication with the environment *//* codes to pass to exit() *//* Successful exit status - must be zero (POSIX 1003.1 8.1) */#define EXIT_SUCCESS  0/* Failing exit status - must be non-zero (POSIX 1003.1 8.1) */#define EXIT_FAILURE  1#ifdef __cplusplusextern "C" {#endif/* Type of function used by atexit() */typedef void (*__atexit_fn_t)( void );extern voidabort( void ) CYGBLD_ATTRIB_NORET;extern intatexit( __atexit_fn_t /* func_to_register */ );extern voidexit( int /* status */ ) CYGBLD_ATTRIB_NORET;/* POSIX 1003.1 section 3.2.2 "Terminate a process" *///@@@ FIXME unistd.hextern void_exit( int /* status */ ) CYGBLD_ATTRIB_NORET;#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_STDLIB_ENVIRON# ifdef CYGBLD_ISO_STDLIB_ENVIRON_HEADER#  include CYGBLD_ISO_STDLIB_ENVIRON_HEADER# else/* ISO C 7.10.4 - Communication with the environment */#ifdef __cplusplusextern "C" {#endif#ifndef _POSIX_SOURCEextern char **environ;   /* standard definition of environ */#endif    extern char *getenv( const char * /* name */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_STDLIB_SYSTEM# ifdef CYGBLD_ISO_STDLIB_SYSTEM_HEADER#  include CYGBLD_ISO_STDLIB_SYSTEM_HEADER# else/* ISO C 7.10.4 - Communication with the environment */#ifdef __cplusplusextern "C" {#endifextern intsystem( const char * /* command */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_BSEARCH# ifdef CYGBLD_ISO_BSEARCH_HEADER#  include CYGBLD_ISO_BSEARCH_HEADER# else/* ISO C 7.10.5 - Searching and sorting utilities */#ifdef __cplusplusextern "C" {#endiftypedef int (*__bsearch_comparison_fn_t)(const void * /* object1 */,                                         const void * /* object2 */);extern void *bsearch( const void * /* search_key */, const void * /* first_object */,         size_t /* num_objects */, size_t /* object_size */,         __bsearch_comparison_fn_t /* comparison_fn */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#if CYGINT_ISO_QSORT# ifdef CYGBLD_ISO_QSORT_HEADER#  include CYGBLD_ISO_QSORT_HEADER# else/* ISO C 7.10.5 - Searching and sorting utilities */#ifdef __cplusplusextern "C" {#endiftypedef int (*__qsort_comparison_fn_t)(const void * /* object1 */,                                       const void * /* object2 */);extern voidqsort( void * /* first_object */, size_t /* num_objects */,       size_t /* object_size */, __qsort_comparison_fn_t /* comparison_fn */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*======================================================================*/#if CYGINT_ISO_ABS# ifdef CYGBLD_ISO_STDLIB_ABS_HEADER#  include CYGBLD_ISO_STDLIB_ABS_HEADER# else/* TYPE DEFINITIONS *//* ISO C 7.10 and 7.10.6 - Integer Arithmetic Functions */#ifdef __cplusplusextern "C" {#endifextern intabs( int /* val */ ) __attribute__((__const__));extern longlabs( long /* val */ ) __attribute__((__const__));#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*======================================================================*/#if CYGINT_ISO_DIV# ifdef CYGBLD_ISO_STDLIB_DIV_HEADER#  include CYGBLD_ISO_STDLIB_DIV_HEADER# else/* ISO C 7.10 and 7.10.6 - Integer Arithmetic Functions *//* return type of the div() function */typedef struct {    int quot;      /* quotient  */    int rem;       /* remainder */} div_t;/* return type of the ldiv() function */typedef struct {    long quot;     /* quotient  */    long rem;      /* remainder */} ldiv_t;#ifdef __cplusplusextern "C" {#endifextern div_tdiv( int /* numerator */, int /* denominator */ ) __attribute__((__const__));extern ldiv_tldiv( long /* numerator */, long /* denominator */ ) __attribute__((__const__));#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*//* Maximum number of bytes in a multibyte character for the current locale */#ifdef CYGBLD_ISO_STDLIB_MB_CUR_MAX_HEADER# include CYGBLD_ISO_STDLIB_MB_CUR_MAX_HEADER#else# define MB_CUR_MAX 1#endif#if CYGINT_ISO_STDLIB_MULTIBYTE# ifdef CYGBLD_ISO_STDLIB_MULTIBYTE_HEADER#  include CYGBLD_ISO_STDLIB_MULTIBYTE_HEADER# else/* ISO C 7.10.7 - Multibyte character functions */#ifdef __cplusplusextern "C" {#endifextern intmblen( const char * /* s */, size_t /* n */ );extern intmbtowc( wchar_t * /* pwc */, const char * /* s */, size_t /* n */ );extern intwctomb( char * /* s */, wchar_t /* wchar */ );extern size_tmbstowcs( wchar_t * /* pwcs */, const char * /* s */, size_t /* n */ );extern size_twcstombs( char * /* s */, const wchar_t * /* pwcs */, size_t /* n */ );#ifdef __cplusplus} /* extern "C" */#endif # endif#endif/*==========================================================================*/#endif /* CYGONCE_ISO_STDLIB_H multiple inclusion protection *//* EOF stdlib.h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -