00001 /* 00002 safe_clib.h - Portable and safe wrapers around some clib functions and some tools 00003 00004 Copyright (C) CinelerraCV 00005 2008, Christian Thaeter <ct@pipapo.org> 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License as 00009 published by the Free Software Foundation; either version 2 of the 00010 License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 00022 #include "error.h" 00023 00024 #include <stdlib.h> 00025 00030 LUMIERA_ERROR_DECLARE(NO_MEMORY); 00031 00040 void 00041 lumiera_safeclib_set_resourcecollector (void* hook); 00042 00043 00050 void* 00051 lumiera_malloc (size_t sz); 00052 00053 00061 void* 00062 lumiera_calloc (size_t n, size_t size); 00063 00064 00071 void* 00072 lumiera_realloc (void* ptr, size_t size); 00073 00074 00079 static inline void 00080 lumiera_free (void* mem) 00081 { 00082 /* for now only a alias, might change in future */ 00083 free (mem); 00084 } 00085 00086 00094 char* 00095 lumiera_strndup (const char* str, size_t len); 00096 00097 00106 int 00107 lumiera_strncmp (const char* a, const char* b, size_t len); 00108 00109 00116 int 00117 lumiera_streq (const char* a, const char* b); 00118 00119 /* 00120 // Local Variables: 00121 // mode: C 00122 // c-file-style: "gnu" 00123 // indent-tabs-mode: nil 00124 // End: 00125 */
1.5.6