slibc
stdlib.h
Go to the documentation of this file.
00001 /* Copyright (C) 2011-2012 SBA Research gGmbh
00002 
00003    This file is part of the Slibc Library.
00004 
00005    The Slibc Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The Slibc library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the Slibc Library; if not, see
00017    <http://www.gnu.org/licenses/>.  
00018 */
00023 #include_next <stdlib.h>
00024 
00025 #ifndef SLIBC_STDLIB_H
00026 #define SLIBC_STDLIB_H
00027 
00028 // TR 24731-1 is not available if __STDC_WANT_LIB_EXT1__ equals 0
00029 #if (!defined(__STDC_WANT_LIB_EXT1__) || (__STDC_WANT_LIB_EXT1__ != 0))
00030 
00031 #include "./base_.h"
00032 #include "./errno.h"
00033 #include "./stddef.h"
00034 
00035 SLIBC_BEGIN_DECLS
00036 
00037 //TR 24731-1 addition to stdlib.h
00038 
00041 typedef void (*constraint_handler_t)(const char * restrict msg,
00042                                                                          void * restrict ptr,
00043                                                                          errno_t error);
00044 
00045 
00065 constraint_handler_t set_constraint_handler_s(constraint_handler_t handler);
00066 
00067 
00070 void abort_handler_s(const char * restrict msg,
00071                                          void * restrict ptr,
00072                                          errno_t error);
00073 
00076 void ignore_handler_s(const char * restrict msg,
00077                                           void * restrict ptr,
00078                                           errno_t error);
00079 
00080 
00114 errno_t getenv_s(size_t * restrict len,
00115                                  char * restrict value, rsize_t maxsize,
00116                                  const char * restrict name);
00117 
00118 
00143 
00144 errno_t qsort_s(void *base, rsize_t nmemb, rsize_t size, 
00145                                 int (*compar) (const void *x, const void *y,
00146                                                                 void *context),
00147                                 void *context
00148                         );
00149 
00150 
00174 
00175 void *bsearch_s (const void *key, const void *base, rsize_t nmemb, rsize_t size,
00176                                 int (*compar) (const void *, const void *, void *context),
00177                                 void *context);
00178 
00179 
00180 // wctomb_s currently not implemented
00181 // mbstowcs_s currently not implemented
00182 // wcstombs_s currently not implemented 
00183 
00184 SLIBC_END_DECLS
00185 
00186 #endif //#if (!defined(__STDC_WANT_LIB_EXT1__) || (__STDC_WANT_LIB_EXT1__ != 0))
00187 
00188 #endif