Mercurial > ecos
annotate packages/language/c/libc/current/src/clibincl/stdlibsupp.hxx @ 66:bf00f99aec69 ecos-sw-2000-02-02
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
| author | jlarmour |
|---|---|
| date | Wed, 02 Feb 2000 19:57:02 +0000 |
| parents | c38311975d4f |
| children |
| rev | line source |
|---|---|
| 0 | 1 #ifndef CYGONCE_LIBC_CLIBINCL_STDLIBSUPP_HXX |
| 2 #define CYGONCE_LIBC_CLIBINCL_STDLIBSUPP_HXX | |
| 3 //======================================================================== | |
| 4 // | |
| 5 // stdlibsupp.hxx | |
| 6 // | |
| 7 // Support for <stdlib.h> ANSI standard utility functions | |
| 8 // | |
| 9 //======================================================================== | |
| 10 //####COPYRIGHTBEGIN#### | |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
11 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
12 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
13 // The contents of this file are subject to the Red Hat eCos Public License |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
14 // Version 1.1 (the "License"); you may not use this file except in |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
15 // compliance with the License. You may obtain a copy of the License at |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
16 // http://www.redhat.com/ |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
17 // |
|
66
bf00f99aec69
Merge from eCos master repository on 2000-02-02-19:16:44-GMT
jlarmour
parents:
64
diff
changeset
|
18 // Software distributed under the License is distributed on an "AS IS" |
|
64
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
20 // License for the specific language governing rights and limitations under |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
21 // the License. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
22 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
23 // The Original Code is eCos - Embedded Configurable Operating System, |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
24 // released September 30, 1998. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
25 // |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
26 // The Initial Developer of the Original Code is Red Hat. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
27 // Portions created by Red Hat are |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
29 // All Rights Reserved. |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
30 // ------------------------------------------- |
|
c38311975d4f
Merge from eCos master repository on 2000-01-28-04:28:11-GMT
jlarmour
parents:
2
diff
changeset
|
31 // |
| 0 | 32 //####COPYRIGHTEND#### |
| 33 //======================================================================== | |
| 34 //#####DESCRIPTIONBEGIN#### | |
| 35 // | |
| 36 // Author(s): jlarmour | |
| 2 | 37 // Contributors: jlarmour |
| 0 | 38 // Date: 1998-02-13 |
| 39 // Purpose: | |
| 40 // Description: | |
| 41 // Usage: #include "clibincl/stdlibsupp.hxx" | |
| 42 // | |
| 43 //####DESCRIPTIONEND#### | |
| 44 // | |
| 45 //======================================================================== | |
| 46 | |
| 47 // CONFIGURATION | |
| 48 | |
| 49 #include <pkgconf/libc.h> // Configuration header | |
| 50 | |
| 51 // Include the C library? | |
| 52 #ifdef CYGPKG_LIBC | |
| 53 | |
| 54 // INCLUDES | |
| 55 | |
| 56 #include <cyg/infra/cyg_type.h>// Common project-wide type definitions | |
| 57 #include <stdlib.h> // Header for the standard utility functions | |
| 58 // including definition of | |
| 59 // Cyg_comparison_fn_t and Cyg_atexit_fn_t | |
| 60 | |
| 61 // FUNCTION PROTOTYPES | |
| 62 | |
| 63 // Allow the atexit handlers to be invoked | |
| 64 externC void | |
| 65 cyg_libc_invoke_atexit_handlers( void ); | |
| 66 | |
| 67 // These are function prototypes for the aliased functions that actually | |
| 68 // implement the stdlib functions | |
| 69 | |
| 70 //======================================================================== | |
| 71 | |
| 72 // 7.10.1 String conversion functions | |
| 73 | |
| 74 externC double | |
| 75 _atof( const char * /* double_str */ ); | |
| 76 | |
| 77 externC int | |
| 78 _atoi( const char * /* int_str */ ); | |
| 79 | |
| 80 externC long | |
| 81 _atol( const char * /* long_str */ ); | |
| 82 | |
| 83 externC double | |
| 84 _strtod( const char * /* double_str */, char ** /* endptr */ ); | |
| 85 | |
| 86 externC long | |
| 87 _strtol( const char * /* long_str */, char ** /* endptr */, | |
| 88 int /* base */ ); | |
| 89 | |
| 90 externC unsigned long | |
| 91 _strtoul( const char * /* ulong_str */, char ** /* endptr */, | |
| 92 int /* base */ ); | |
| 93 | |
| 94 //======================================================================== | |
| 95 | |
| 96 // 7.10.2 Pseudo-random sequence generation functions | |
| 97 | |
| 98 externC int | |
| 99 _rand( void ); | |
| 100 | |
| 101 externC void | |
| 102 _srand( unsigned int /* seed */ ); | |
| 103 | |
| 104 // POSIX 1003.1 section 8.3.8 rand_r() | |
| 105 externC int | |
| 106 _rand_r( unsigned int * /* seed */ ); | |
| 107 | |
| 108 //======================================================================== | |
| 109 | |
| 110 // 7.10.3 Memory management functions | |
| 111 | |
| 112 #ifdef CYGPKG_LIBC_MALLOC | |
| 113 | |
| 114 externC void * | |
| 115 _calloc( size_t /* num_objects */, size_t /* object_size */ ); | |
| 116 | |
| 117 externC void | |
| 118 _free( void * /* ptr */ ); | |
| 119 | |
| 120 externC void * | |
| 121 _malloc( size_t /* size */ ); | |
| 122 | |
| 123 externC void * | |
| 124 _realloc( void * /* ptr */, size_t /* size */ ); | |
| 125 | |
| 126 #endif // ifdef CYGPKG_LIBC_MALLOC | |
| 127 | |
| 128 //======================================================================== | |
| 129 | |
| 130 // 7.10.4 Communication with the environment | |
| 131 | |
| 132 externC void | |
| 2 | 133 _abort( void ) CYGBLD_ATTRIB_NORET; |
| 0 | 134 |
| 135 externC int | |
| 2 | 136 _atexit( Cyg_libc_atexit_fn_t /* func_to_register */ ); |
| 0 | 137 |
| 138 // The "real" names for exit() and _exit() are different for obvious name | |
| 139 // clash issues | |
| 140 | |
| 141 externC void | |
| 2 | 142 __libc_exit( int /* status */ ) CYGBLD_ATTRIB_NORET; |
| 0 | 143 |
| 144 // POSIX 1003.1 section 3.2.2 "Terminate a process" | |
| 145 | |
| 146 externC void | |
| 2 | 147 __libc__exit( int /* status */ ) CYGBLD_ATTRIB_NORET; |
| 0 | 148 |
| 149 externC char * | |
| 150 _getenv( const char * /* name */ ); | |
| 151 | |
| 152 //======================================================================== | |
| 153 | |
| 154 // 7.10.5 Searching and sorting utilities | |
| 155 | |
| 156 externC void * | |
| 157 _bsearch( const void * /* search_key */, const void * /* first_object */, | |
| 158 size_t /* num_objects */, size_t /* object_size */, | |
| 159 Cyg_comparison_fn_t /* comparison_fn */ ); | |
| 160 | |
| 161 externC void | |
| 162 _qsort( void * /* first_object */, size_t /* num_objects */, | |
| 163 size_t /* object_size */, | |
| 164 Cyg_comparison_fn_t /* comparison_fn */ ); | |
| 165 | |
| 166 | |
| 167 //======================================================================== | |
| 168 | |
| 169 // 7.10.6 Integer arithmetic functions | |
| 170 | |
| 171 externC int | |
| 172 _abs( int /* val */ ); | |
| 173 | |
| 174 externC long | |
| 175 _labs( long /* val */ ); | |
| 176 | |
| 177 //======================================================================== | |
| 178 | |
| 179 | |
| 180 #endif // ifdef CYGPKG_LIBC | |
| 181 | |
| 182 #endif // CYGONCE_LIBC_CLIBINCL_STDLIBSUPP_HXX multiple inclusion | |
| 183 // protection | |
| 184 | |
| 185 // EOF stdlibsupp.hxx |
