head 1.12; access; symbols MM_1_4_2:1.11 MM_1_4_1:1.11 MM_1_4_0:1.10 MM_1_3_1:1.9 MM_1_3_0:1.8 MM_1_2_2:1.8 MM_1_2_1:1.6 MM_1_2_0:1.6 MM_1_1_3:1.4 MM_1_1_2:1.3 MM_1_1_1:1.3 MM_1_1_0:1.3 MM_1_0_12:1.2 MM_1_0_11:1.2 MM_1_0_10:1.2 MM_1_0_9:1.2 MM_1_0_8:1.2 MM_1_0_7:1.2 MM_1_0_6:1.2 MM_1_0_5:1.2 MM_1_0_4:1.2 MM_1_0_3:1.2 MM_1_0_1:1.1.1.1 MM_1_0_0:1.1.1.1 MM_1_0b6:1.1.1.1 MM_1_0b5:1.1.1.1 MM_1_0b4:1.1.1.1 MM_1_0b3:1.1.1.1 MM_1_0b2plus:1.1.1.1 RSE:1.1.1; locks; strict; comment @ * @; 1.12 date 2007.01.01.18.26.34; author rse; state Exp; branches; next 1.11; commitid xbmVq17WhC8zJP0s; 1.11 date 2006.08.10.19.00.33; author rse; state Exp; branches; next 1.10; commitid zS8gipIRuG1bykIr; 1.10 date 2005.09.02.20.00.46; author rse; state Exp; branches; next 1.9; 1.9 date 2004.09.12.18.35.01; author rse; state Exp; branches; next 1.8; 1.8 date 2002.12.19.09.25.24; author rse; state Exp; branches; next 1.7; 1.7 date 2002.12.19.09.14.58; author rse; state Exp; branches; next 1.6; 1.6 date 2002.07.26.09.59.34; author rse; state Exp; branches; next 1.5; 1.5 date 2001.01.29.20.27.22; author rse; state Exp; branches; next 1.4; 1.4 date 2000.07.01.14.17.42; author rse; state Exp; branches; next 1.3; 1.3 date 2000.01.09.20.19.40; author rse; state Exp; branches; next 1.2; 1.2 date 99.05.15.11.21.47; author rse; state Exp; branches; next 1.1; 1.1 date 99.03.15.11.12.50; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.03.15.11.12.50; author rse; state Exp; branches; next ; desc @@ 1.12 log @Updated all copyright messages for year 2007 @ text @/* ==================================================================== * Copyright (c) 1999-2007 Ralf S. Engelschall * Copyright (c) 1999-2007 The OSSP Project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by * Ralf S. Engelschall ." * * 4. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by * Ralf S. Engelschall ." * * THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== */ /* ** ** mm_lib.c -- Internal Library API ** */ #define MM_PRIVATE #include "mm.h" /* * Error Handling */ #define MM_LIB_ERROR_MAXLEN 1024 static char mm_lib_error[MM_LIB_ERROR_MAXLEN+1] = { NUL }; void mm_lib_error_set(unsigned int type, const char *str) { int l, n; char *cp; if (str == NULL) { mm_lib_error[0] = NUL; return; } if (type & MM_ERR_ALLOC) strcpy(mm_lib_error, "mm:alloc: "); else if (type & MM_ERR_CORE) strcpy(mm_lib_error, "mm:core: "); l = strlen(mm_lib_error); n = strlen(str); if (n > MM_LIB_ERROR_MAXLEN-l) n = MM_LIB_ERROR_MAXLEN-l; memcpy(mm_lib_error+l, str, n+1); l += n; if (type & MM_ERR_SYSTEM && errno != 0) { if (MM_LIB_ERROR_MAXLEN-l > 2) { strcpy(mm_lib_error+l, " ("); l += 2; } cp = strerror(errno); n = strlen(cp); if (n > MM_LIB_ERROR_MAXLEN-l) n = MM_LIB_ERROR_MAXLEN-l; memcpy(mm_lib_error+l, cp, n+1); l += n; if (MM_LIB_ERROR_MAXLEN-l > 1) { strcpy(mm_lib_error+l, ")"); l += 1; } } *(mm_lib_error+l) = NUL; return; } char *mm_lib_error_get(void) { if (mm_lib_error[0] == NUL) return NULL; return mm_lib_error; } /* * Version Information */ #define _MM_VERS_C_AS_HEADER_ #include "mm_vers.c" #undef _MM_VERS_C_AS_HEADER_ int mm_lib_version(void) { return MM_VERSION; } @ 1.11 log @bump copyright for year 2006 @ text @d2 2 a3 2 * Copyright (c) 1999-2006 Ralf S. Engelschall * Copyright (c) 1999-2006 The OSSP Project @ 1.10 log @adjust copyright year @ text @d2 2 a3 2 * Copyright (c) 1999-2005 Ralf S. Engelschall * Copyright (c) 1999-2005 The OSSP Project @ 1.9 log @adjust year in copyright messages @ text @d2 2 a3 2 * Copyright (c) 1999-2004 Ralf S. Engelschall * Copyright (c) 1999-2004 The OSSP Project @ 1.8 log @Updated all copyright messages with forthcoming year 2003, added OSSP project as secondary copyright holder, added standard OSSP ASCII-art logo to documents, etc. @ text @d2 2 a3 2 * Copyright (c) 1999-2003 Ralf S. Engelschall * Copyright (c) 1999-2003 The OSSP Project @ 1.7 log @Stripped trailing whitespaces from all files in source tree. @ text @d2 2 a3 1 * Copyright (c) 1999-2002 Ralf S. Engelschall. All rights reserved. @ 1.6 log @bump copyright year @ text @d9 1 a9 1 * notice, this list of conditions and the following disclaimer. @ 1.5 log @*** empty log message *** @ text @d2 1 a2 1 * Copyright (c) 1999-2001 Ralf S. Engelschall. All rights reserved. @ 1.4 log @*** empty log message *** @ text @d2 1 a2 1 * Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved. @ 1.3 log @*** empty log message *** @ text @d107 1 a107 1 #define _AS_HEADER d109 1 d113 1 a113 1 return MM_Version; @ 1.2 log @*** empty log message *** @ text @d2 1 a2 1 * Copyright (c) 1999 Ralf S. Engelschall. All rights reserved. @ 1.1 log @Initial revision @ text @d107 1 a107 1 #define AS_HEADER @ 1.1.1.1 log @Import into CVS @ text @@