Changeset 1696
- Timestamp:
- Sep 7, 2004, 9:05:07 AM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 added
- 15 edited
-
sys/psAbort.c (modified) (1 diff)
-
sys/psError.c (modified) (2 diffs)
-
sys/psErrorCodes.c (modified) (3 diffs)
-
sys/psErrorCodes.h (modified) (3 diffs)
-
sys/psLogMsg.c (modified) (7 diffs)
-
sys/psMemory.c (modified) (5 diffs)
-
sysUtils/Makefile (modified) (4 diffs)
-
sysUtils/parseErrorCodes.pl (modified) (1 diff)
-
sysUtils/psAbort.c (modified) (1 diff)
-
sysUtils/psError.c (modified) (2 diffs)
-
sysUtils/psErrorCodes.c (modified) (3 diffs)
-
sysUtils/psErrorCodes.dat (modified) (1 diff)
-
sysUtils/psErrorCodes.h (modified) (3 diffs)
-
sysUtils/psLogMsg.c (modified) (7 diffs)
-
sysUtils/psMemory.c (modified) (5 diffs)
-
sysUtils/psSysUtilsErrors.dat (added)
-
sysUtils/psSysUtilsErrors.h (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psAbort.c
r1407 r1696 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-07 00:06:06$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-07 19:05:07 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 16 16 */ 17 17 18 /******************************************************************************/19 20 /* INCLUDE FILES */21 22 /******************************************************************************/23 18 #include <stdarg.h> 24 19 #include <stdlib.h> 25 20 #include "psAbort.h" 26 21 #include "psLogMsg.h" 27 28 /******************************************************************************/29 30 /* DEFINE STATEMENTS */31 32 /******************************************************************************/33 34 // None35 36 /******************************************************************************/37 38 /* TYPE DEFINITIONS */39 40 /******************************************************************************/41 42 // None43 44 /*****************************************************************************/45 46 /* GLOBAL VARIABLES */47 48 /*****************************************************************************/49 50 // None51 52 /*****************************************************************************/53 54 /* FILE STATIC VARIABLES */55 56 /*****************************************************************************/57 58 // None59 60 /*****************************************************************************/61 62 /* FUNCTION IMPLEMENTATION - LOCAL */63 64 /*****************************************************************************/65 66 // None67 68 /*****************************************************************************/69 70 /* FUNCTION IMPLEMENTATION - PUBLIC */71 72 /*****************************************************************************/73 22 74 23 void psAbort(const char *name, const char *fmt, ...) -
trunk/psLib/src/sys/psError.c
r1685 r1696 1 2 1 /** @file psError.c 3 2 * … … 11 10 * @author Eric Van Alst, MHPCC 12 11 * 13 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09-0 3 20:39:50$12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-07 19:05:07 $ 15 14 * 16 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psErrorCodes.c
r1683 r1696 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 2 22:23:20$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-07 19:05:07 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 * the other lines by, for each error class in psErrorCodes.dat, the following 22 22 * substitutions are made: 23 * $ ErrorCodeThe error code name (first word in the psErrorCodes.dat lines)24 * $ ErrorDescriptionThe error description (rest of the line in psErrorCodes.dat)25 * $ ErrorNumberThe order of the source line in psErrorCodes.dat (comments excluded)23 * $1 The error code name (first word in the psErrorCodes.dat lines) 24 * $2 The error description (rest of the line in psErrorCodes.dat) 25 * $n The order of the source line in psErrorCodes.dat (comments excluded) 26 26 * 27 27 * DO NOT EDIT THE LINES BETWEEN //~Start and //~End! ANY CHANGES WILL BE OVERWRITTEN. … … 31 31 {PS_ERR_NONE,"not an error"}, 32 32 {PS_ERR_BASE,"base error"}, 33 //~Start {PS_ERR_$ ErrorCode,"$ErrorDescription"},33 //~Start {PS_ERR_$1,"$2"}, 34 34 {PS_ERR_UNKNOWN,"unknown error"}, 35 35 {PS_ERR_IO,"I/O error"}, 36 36 {PS_ERR_MEMORY_CORRUPTION,"memory corruption detected"}, 37 {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"}, 38 {PS_ERR_LOCATION_INVALID,"specified location is unknown"}, 39 {PS_ERR_BAD_VALUE,"value is out-of-range"}, 40 {PS_ERR_BAD_LENGTH,"string value is too lon"}, 37 41 //~End 38 42 {PS_ERR_N_ERR_CLASSES,"error classes end marker"} -
trunk/psLib/src/sys/psErrorCodes.h
r1683 r1696 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 2 22:23:20$9 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-07 19:05:07 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 * the other lines by, for each error class in psErrorCodes.dat, the following 21 21 * substitutions are made: 22 * $ ErrorCodeThe error code name (first word in the psErrorCodes.dat lines)23 * $ ErrorDescriptionThe error description (rest of the line in psErrorCodes.dat)24 * $ ErrorNumberThe order of the source line in psErrorCodes.dat (comments excluded)22 * $1 The error code name (first word in the psErrorCodes.dat lines) 23 * $2 The error description (rest of the line in psErrorCodes.dat) 24 * $n The order of the source line in psErrorCodes.dat (comments excluded) 25 25 * 26 26 * DO NOT EDIT THE LINES BETWEEN //~Start and //~End! ANY CHANGES WILL BE OVERWRITTEN. … … 40 40 */ 41 41 42 //~Start PS_ERR_$ErrorCode, ///< $ErrorDescription 43 PS_ERR_UNKNOWN, ///< unknown error 44 PS_ERR_IO, ///< I/O error 45 PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected 42 //~Start PS_ERR_$1, ///< $2 43 PS_ERR_UNKNOWN, ///< unknown error 44 PS_ERR_IO, ///< I/O error 45 PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected 46 PS_ERR_MEMORY_DEREF_USAGE, ///< dereferenced memory still used 47 PS_ERR_LOCATION_INVALID, ///< specified location is unknown 48 PS_ERR_BAD_VALUE, ///< value is out-of-range 49 PS_ERR_BAD_LENGTH, ///< string value is too lon 46 50 //~End 47 51 PS_ERR_N_ERR_CLASSES ///< end marker - should not be used as a true error -
trunk/psLib/src/sys/psLogMsg.c
r1448 r1696 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 8-10 01:55:34$14 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-07 19:05:07 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 41 41 #include "psTrace.h" 42 42 43 #include "psSysUtilsErrors.h" 44 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psLogMsg." 45 43 46 #define MIN_LOG_LEVEL 0 44 47 #define MAX_LOG_LEVEL 9 45 48 46 49 #define MAX_LOG_LINE_LENGTH 128 50 51 47 52 static FILE *logDest = (FILE *) 1; // flag to initialize to stderr before using. 48 53 static int globalLogLevel = PS_LOG_INFO; // log all messages at this or above … … 108 113 109 114 if (sscanf(dest, "%4s:%256s", protocol, location) < 2) { 110 psError(__func__, "The specified destination, %s, is malformed.", dest); 115 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID, 116 PS_ERRORTEXT_psLogSetDestination_DESTINATION_MALFORMED, 117 dest); 111 118 return false; 112 119 } … … 127 134 return true; 128 135 } 129 psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location); 136 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID, 137 PS_ERRORTEXT_psLogSetDestination_DEST_LOCATION_INVALID, 138 location); 130 139 return 1; 131 140 } else if (strcmp(protocol, "file") == 0) { … … 133 142 134 143 if (file == NULL) { 135 psError(__func__, "Could not open file '%s' for output.", location); 144 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_IO, 145 PS_ERRORTEXT_psLogSetDestination_OPEN_FILE_FAILED, 146 location); 136 147 return false; 137 148 } … … 143 154 } 144 155 145 psError(__func__, "Do not know how to handle the protocol '%s'.", protocol); 156 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID, 157 PS_ERRORTEXT_psLogSetDestination_UNSUPPORTED_PROTOCOL, 158 protocol); 146 159 return false; 147 160 } … … 205 218 break; 206 219 default: 207 psError(__func__, "Unknown logging keyword %c", *ptr); 220 psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_VALUE, 221 PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr); 208 222 break; 209 223 } -
trunk/psLib/src/sys/psMemory.c
r1440 r1696 9 9 * @author Robert Lupton, Princeton University 10 10 * 11 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-09 23:34:58$11 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-07 19:05:07 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psLogMsg.h" 28 28 29 #include "psSysUtilsErrors.h" 30 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psMemory." 31 29 32 #define P_PS_MEMMAGIC (void *)0xdeadbeef // Magic number in psMemBlock header 30 33 … … 100 103 { 101 104 if (ptr->refCounter < 1) { 102 psError (__func__,103 "Block %ld allocated at %s:%d freed more than once at %s:%d\n",104 ptr->id, ptr->file, ptr->lineno, file, lineno);105 psErrorMsg(ERRORNAME_PREFIX "memProblemCallbackDefault", false, PS_ERR_MEMORY_CORRUPTION, 106 PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE, 107 ptr->id, ptr->file, ptr->lineno, file, lineno); 105 108 } 106 109 … … 228 231 229 232 if (m == NULL) { 230 psError(funcName, "Memory Corruption: NULL memory block found."); 233 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 234 PS_ERRORTEXT_checkMemBlock_NULL_BLOCK); 231 235 return 1; 232 236 } … … 234 238 if (m->refCounter == 0) { 235 239 // using an unreferenced block of memory, are you? 236 psError(__func__, "Memory Corruption: memory block %ld was freed but still used.", m->id); 240 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 241 PS_ERRORTEXT_checkMemBlock_DEREF_USE, 242 m->id); 237 243 return 1; 238 244 } 239 245 240 246 if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) { 241 psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)", m->id); 247 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 248 PS_ERRORTEXT_checkMemBlock_UNDERFLOW, 249 m->id); 242 250 return 1; 243 251 } 244 252 if (*(void **)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) { 245 psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)", m->id); 253 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 254 PS_ERRORTEXT_checkMemBlock_OVERFLOW, 255 m->id); 246 256 return 1; 247 257 } -
trunk/psLib/src/sysUtils/Makefile
r1683 r1696 3 3 ## Makefile: sysUtils 4 4 ## 5 ## $Revision: 1. 19$ $Name: not supported by cvs2svn $6 ## $Date: 2004-09-0 2 22:23:20$5 ## $Revision: 1.20 $ $Name: not supported by cvs2svn $ 6 ## $Date: 2004-09-07 19:05:07 $ 7 7 ## 8 8 ## Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 40 40 OBJS = $(addprefix makedir/,$(SRC_OBJS)) 41 41 42 HEADERS = $(SRC_OBJS:.o=.h) psType.h 43 42 44 # Define PHONY target "all" which will make all the necessary items 43 45 … … 49 51 psErrorCodes.c: psErrorCodes.dat 50 52 perl parseErrorCodes.pl --data=$? $@ 53 54 psSysUtilsErrors.h: psSysUtilsErrors.dat 55 perl parseErrorCodes.pl --data=$? $@ 56 51 57 52 58 # Rule to make static library … … 60 66 61 67 install: $(TARGET_STATIC) 62 install *.h$(includedir)68 install $(HEADERS) $(includedir) 63 69 64 70 # Define PHONY target "distclean" which will cleanup the distribution -
trunk/psLib/src/sysUtils/parseErrorCodes.pl
r1683 r1696 63 63 for ( $n = 0 ; $n < $found ; $n++ ) { 64 64 $_ = $line; 65 s/\$ ErrorCode/$ErrorCodes[$n]/g;66 s/\$ ErrorDescription/$ErrorDescriptions[$n]/g;67 s/\$ ErrorNumber/$n/g;65 s/\$1/$ErrorCodes[$n]/g; 66 s/\$2/$ErrorDescriptions[$n]/g; 67 s/\$n/$n/g; 68 68 push( @result, $_ ); 69 69 print "$_\n" if $verbose; -
trunk/psLib/src/sysUtils/psAbort.c
r1407 r1696 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-07 00:06:06$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-07 19:05:07 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 16 16 */ 17 17 18 /******************************************************************************/19 20 /* INCLUDE FILES */21 22 /******************************************************************************/23 18 #include <stdarg.h> 24 19 #include <stdlib.h> 25 20 #include "psAbort.h" 26 21 #include "psLogMsg.h" 27 28 /******************************************************************************/29 30 /* DEFINE STATEMENTS */31 32 /******************************************************************************/33 34 // None35 36 /******************************************************************************/37 38 /* TYPE DEFINITIONS */39 40 /******************************************************************************/41 42 // None43 44 /*****************************************************************************/45 46 /* GLOBAL VARIABLES */47 48 /*****************************************************************************/49 50 // None51 52 /*****************************************************************************/53 54 /* FILE STATIC VARIABLES */55 56 /*****************************************************************************/57 58 // None59 60 /*****************************************************************************/61 62 /* FUNCTION IMPLEMENTATION - LOCAL */63 64 /*****************************************************************************/65 66 // None67 68 /*****************************************************************************/69 70 /* FUNCTION IMPLEMENTATION - PUBLIC */71 72 /*****************************************************************************/73 22 74 23 void psAbort(const char *name, const char *fmt, ...) -
trunk/psLib/src/sysUtils/psError.c
r1685 r1696 1 2 1 /** @file psError.c 3 2 * … … 11 10 * @author Eric Van Alst, MHPCC 12 11 * 13 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-09-0 3 20:39:50$12 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-09-07 19:05:07 $ 15 14 * 16 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psErrorCodes.c
r1683 r1696 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 2 22:23:20$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-07 19:05:07 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 21 21 * the other lines by, for each error class in psErrorCodes.dat, the following 22 22 * substitutions are made: 23 * $ ErrorCodeThe error code name (first word in the psErrorCodes.dat lines)24 * $ ErrorDescriptionThe error description (rest of the line in psErrorCodes.dat)25 * $ ErrorNumberThe order of the source line in psErrorCodes.dat (comments excluded)23 * $1 The error code name (first word in the psErrorCodes.dat lines) 24 * $2 The error description (rest of the line in psErrorCodes.dat) 25 * $n The order of the source line in psErrorCodes.dat (comments excluded) 26 26 * 27 27 * DO NOT EDIT THE LINES BETWEEN //~Start and //~End! ANY CHANGES WILL BE OVERWRITTEN. … … 31 31 {PS_ERR_NONE,"not an error"}, 32 32 {PS_ERR_BASE,"base error"}, 33 //~Start {PS_ERR_$ ErrorCode,"$ErrorDescription"},33 //~Start {PS_ERR_$1,"$2"}, 34 34 {PS_ERR_UNKNOWN,"unknown error"}, 35 35 {PS_ERR_IO,"I/O error"}, 36 36 {PS_ERR_MEMORY_CORRUPTION,"memory corruption detected"}, 37 {PS_ERR_MEMORY_DEREF_USAGE,"dereferenced memory still used"}, 38 {PS_ERR_LOCATION_INVALID,"specified location is unknown"}, 39 {PS_ERR_BAD_VALUE,"value is out-of-range"}, 40 {PS_ERR_BAD_LENGTH,"string value is too lon"}, 37 41 //~End 38 42 {PS_ERR_N_ERR_CLASSES,"error classes end marker"} -
trunk/psLib/src/sysUtils/psErrorCodes.dat
r1683 r1696 2 2 # This file is used to generate psErrorCode.h content 3 3 # 4 UNKNOWN unknown error 5 IO I/O error 6 MEMORY_CORRUPTION memory corruption detected 4 # Format: 5 # ERROR_CLASS_NAME ERROR_CLASS_DESCRIPTION 6 # 7 # Note: the ERROR_CLASS_NAME will appear in the code with a "PS_ERR_" prefix 8 # 9 UNKNOWN unknown error 10 IO I/O error 11 MEMORY_CORRUPTION memory corruption detected 12 MEMORY_DEREF_USAGE dereferenced memory still used 13 LOCATION_INVALID specified location is unknown 14 BAD_VALUE value is out-of-range 15 BAD_LENGTH string value is too long -
trunk/psLib/src/sysUtils/psErrorCodes.h
r1683 r1696 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-09-0 2 22:23:20$9 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-09-07 19:05:07 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 * the other lines by, for each error class in psErrorCodes.dat, the following 21 21 * substitutions are made: 22 * $ ErrorCodeThe error code name (first word in the psErrorCodes.dat lines)23 * $ ErrorDescriptionThe error description (rest of the line in psErrorCodes.dat)24 * $ ErrorNumberThe order of the source line in psErrorCodes.dat (comments excluded)22 * $1 The error code name (first word in the psErrorCodes.dat lines) 23 * $2 The error description (rest of the line in psErrorCodes.dat) 24 * $n The order of the source line in psErrorCodes.dat (comments excluded) 25 25 * 26 26 * DO NOT EDIT THE LINES BETWEEN //~Start and //~End! ANY CHANGES WILL BE OVERWRITTEN. … … 40 40 */ 41 41 42 //~Start PS_ERR_$ErrorCode, ///< $ErrorDescription 43 PS_ERR_UNKNOWN, ///< unknown error 44 PS_ERR_IO, ///< I/O error 45 PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected 42 //~Start PS_ERR_$1, ///< $2 43 PS_ERR_UNKNOWN, ///< unknown error 44 PS_ERR_IO, ///< I/O error 45 PS_ERR_MEMORY_CORRUPTION, ///< memory corruption detected 46 PS_ERR_MEMORY_DEREF_USAGE, ///< dereferenced memory still used 47 PS_ERR_LOCATION_INVALID, ///< specified location is unknown 48 PS_ERR_BAD_VALUE, ///< value is out-of-range 49 PS_ERR_BAD_LENGTH, ///< string value is too lon 46 50 //~End 47 51 PS_ERR_N_ERR_CLASSES ///< end marker - should not be used as a true error -
trunk/psLib/src/sysUtils/psLogMsg.c
r1448 r1696 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 8-10 01:55:34$14 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-07 19:05:07 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 41 41 #include "psTrace.h" 42 42 43 #include "psSysUtilsErrors.h" 44 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psLogMsg." 45 43 46 #define MIN_LOG_LEVEL 0 44 47 #define MAX_LOG_LEVEL 9 45 48 46 49 #define MAX_LOG_LINE_LENGTH 128 50 51 47 52 static FILE *logDest = (FILE *) 1; // flag to initialize to stderr before using. 48 53 static int globalLogLevel = PS_LOG_INFO; // log all messages at this or above … … 108 113 109 114 if (sscanf(dest, "%4s:%256s", protocol, location) < 2) { 110 psError(__func__, "The specified destination, %s, is malformed.", dest); 115 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID, 116 PS_ERRORTEXT_psLogSetDestination_DESTINATION_MALFORMED, 117 dest); 111 118 return false; 112 119 } … … 127 134 return true; 128 135 } 129 psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location); 136 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID, 137 PS_ERRORTEXT_psLogSetDestination_DEST_LOCATION_INVALID, 138 location); 130 139 return 1; 131 140 } else if (strcmp(protocol, "file") == 0) { … … 133 142 134 143 if (file == NULL) { 135 psError(__func__, "Could not open file '%s' for output.", location); 144 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_IO, 145 PS_ERRORTEXT_psLogSetDestination_OPEN_FILE_FAILED, 146 location); 136 147 return false; 137 148 } … … 143 154 } 144 155 145 psError(__func__, "Do not know how to handle the protocol '%s'.", protocol); 156 psErrorMsg(ERRORNAME_PREFIX "psLogSetDestination", true, PS_ERR_LOCATION_INVALID, 157 PS_ERRORTEXT_psLogSetDestination_UNSUPPORTED_PROTOCOL, 158 protocol); 146 159 return false; 147 160 } … … 205 218 break; 206 219 default: 207 psError(__func__, "Unknown logging keyword %c", *ptr); 220 psErrorMsg(ERRORNAME_PREFIX "psLogSetFormat", true, PS_ERR_BAD_VALUE, 221 PS_ERRORTEXT_psLogSetFormat_UNKNOWN_KEY, *ptr); 208 222 break; 209 223 } -
trunk/psLib/src/sysUtils/psMemory.c
r1440 r1696 9 9 * @author Robert Lupton, Princeton University 10 10 * 11 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-09 23:34:58$11 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-07 19:05:07 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psLogMsg.h" 28 28 29 #include "psSysUtilsErrors.h" 30 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psMemory." 31 29 32 #define P_PS_MEMMAGIC (void *)0xdeadbeef // Magic number in psMemBlock header 30 33 … … 100 103 { 101 104 if (ptr->refCounter < 1) { 102 psError (__func__,103 "Block %ld allocated at %s:%d freed more than once at %s:%d\n",104 ptr->id, ptr->file, ptr->lineno, file, lineno);105 psErrorMsg(ERRORNAME_PREFIX "memProblemCallbackDefault", false, PS_ERR_MEMORY_CORRUPTION, 106 PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE, 107 ptr->id, ptr->file, ptr->lineno, file, lineno); 105 108 } 106 109 … … 228 231 229 232 if (m == NULL) { 230 psError(funcName, "Memory Corruption: NULL memory block found."); 233 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 234 PS_ERRORTEXT_checkMemBlock_NULL_BLOCK); 231 235 return 1; 232 236 } … … 234 238 if (m->refCounter == 0) { 235 239 // using an unreferenced block of memory, are you? 236 psError(__func__, "Memory Corruption: memory block %ld was freed but still used.", m->id); 240 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 241 PS_ERRORTEXT_checkMemBlock_DEREF_USE, 242 m->id); 237 243 return 1; 238 244 } 239 245 240 246 if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) { 241 psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)", m->id); 247 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 248 PS_ERRORTEXT_checkMemBlock_UNDERFLOW, 249 m->id); 242 250 return 1; 243 251 } 244 252 if (*(void **)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) { 245 psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)", m->id); 253 psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION, 254 PS_ERRORTEXT_checkMemBlock_OVERFLOW, 255 m->id); 246 256 return 1; 247 257 }
Note:
See TracChangeset
for help on using the changeset viewer.
