Changeset 23352 for branches/cnb_branches/cnb_branch_20090301/psLib/src/sys
- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
psLib/src/sys/Makefile.am (modified) (1 diff)
-
psLib/src/sys/psConfigure.c (modified) (3 diffs)
-
psLib/src/sys/psConfigure.h (modified) (2 diffs)
-
psLib/src/sys/psLogMsg.c (modified) (2 diffs)
-
psLib/src/sys/psMemory.c (modified) (1 diff)
-
psLib/src/sys/psMemory.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/Makefile.am
r19056 r23352 3 3 noinst_LTLIBRARIES = libpslibsys.la 4 4 5 libpslibsys_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(CFITSIO_CFLAGS) 5 # PSLIB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 6 # PSLIB_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 7 # PSLIB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 8 9 # Force recompilation of psConfigure.c, since it gets the version information 10 psConfigure.c: FORCE 11 touch psConfigure.c 12 FORCE: ; 13 14 libpslibsys_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(CFITSIO_CFLAGS) -DPSLIB_VERSION=$(SVN_VERSION) -DPSLIB_BRANCH=$(SVN_BRANCH) -DPSLIB_SOURCE=$(SVN_SOURCE) 6 15 libpslibsys_la_SOURCES = \ 7 16 psAbort.c \ -
branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/psConfigure.c
r18953 r23352 12 12 * @author Ross Harman, MHPCC 13 13 * @author Robert DeSonia, MHPCC 14 * @author Paul Price, IfA 14 15 * 15 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2008-08-08 18:05:08 $ 17 * 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 16 * Copyright 2004-2009 Institute for Astronomy, University of Hawaii 19 17 */ 20 18 … … 26 24 #include <stdlib.h> 27 25 #include <string.h> 26 27 #include <fitsio.h> 28 #include <longnam.h> 29 #include <fftw3.h> 30 #include <gsl/gsl_version.h> 31 #ifdef HAVE_PSDB 32 #include <mysql.h> 33 #endif 28 34 29 35 #include "psAbort.h" … … 41 47 static FILE *memCheckFile = NULL; // File to which to write results of mem check 42 48 43 static const char *cvsTag = "$Name: not supported by cvs2svn $"; // CVS tag name 49 #ifndef PSLIB_VERSION 50 #error "PSLIB_VERSION is not set" 51 #endif 52 #ifndef PSLIB_BRANCH 53 #error "PSLIB_BRANCH is not set" 54 #endif 55 #ifndef PSLIB_SOURCE 56 #error "PSLIB_SOURCE is not set" 57 #endif 58 59 #define xstr(s) str(s) 60 #define str(s) #s 44 61 45 62 psString psLibVersion(void) 46 63 { 47 psString version = NULL; // Version, to return 48 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 49 return version; 64 char *value = NULL; 65 psStringAppend(&value, "%s@%s", xstr(PSLIB_BRANCH), xstr(PSLIB_VERSION)); 66 return value; 67 } 68 69 psString psLibSource(void) 70 { 71 return psStringCopy(xstr(PSLIB_SOURCE)); 72 } 73 74 psString psLibDependencies(void) 75 { 76 psString deps = NULL; // Dependencies, to return 77 float cfitsioVersion; // CFITSIO version number 78 psStringAppend(&deps, "cfitsio-%.3f gsl-%s %s", 79 fits_get_version(&cfitsioVersion), gsl_version, fftwf_version); 80 81 #ifdef HAVE_PSDB 82 psStringAppend(&deps, " mysql-%s", mysql_get_client_info()); 83 #endif 84 85 return deps; 50 86 } 51 87 52 88 psString psLibVersionLong(void) 53 89 { 54 psString version = psLibVersion(); // Version, to return 55 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 90 psString version = psLibVersion(); // Version, to return 91 psString source = psLibSource(); // Source 92 psString deps = psLibDependencies();// Dependencies 56 93 57 #ifdef HAVE_PSDB 58 psStringAppend(&version, " (cvs tag %s), %s, %s with psDB", tag, __DATE__, __TIME__); 94 psStringPrepend(&version, "psLib "); 95 psStringAppend(&version, " from %s, built %s, %s with %s", 96 source, __DATE__, __TIME__, deps); 97 psFree(source); 98 psFree(deps); 99 100 #ifdef __OPTIMIZE__ 101 psStringAppend(&version, " optimised"); 59 102 #else 60 psStringAppend(&version, " (cvs tag %s), %s, %s without psDB", tag, __DATE__, __TIME__);103 psStringAppend(&version, " unoptimised"); 61 104 #endif 62 psFree(tag); 105 106 #ifdef PS_NO_TRACE 107 psStringAppend(&version, " without trace"); 108 #else 109 psStringAppend(&version, " with trace"); 110 #endif 111 63 112 return version; 64 } 113 }; 65 114 66 115 // Check the memory; intended for use on exit, but might be used elsewhere -
branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/psConfigure.h
r13950 r23352 20 20 #define PS_CONFIGURE_H 21 21 22 #include <psString.h> 23 22 24 /// @addtogroup SysUtils System Utilities 23 25 /// @{ … … 29 31 * @return psString: String with version name. 30 32 */ 31 psString psLibVersion( 32 void 33 ); 33 psString psLibVersion(void); 34 34 35 /** Get current psLib source 36 * 37 * Returns the current psLib source name as a string. 38 * 39 * @return psString: String with source name. 40 */ 41 psString psLibSource(void); 42 43 /** Get psLib dependencies' versions 44 * 45 * Returns the psLib dependency versions as a string. 46 * 47 * @return psString: String with dependencies. 48 */ 49 psString psLibDependencies(void); 35 50 36 51 /** Get current psLib version (full identification) -
branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/psLogMsg.c
r20546 r23352 195 195 } 196 196 197 int fileD = creat(dest, 0666);197 int fileD = open(dest, O_WRONLY | O_CREAT, 0666); 198 198 if (fileD == 0) { 199 199 psError(PS_ERR_IO, true, _("Could not open file '%s' for output."), dest); … … 316 316 317 317 if (write(logFD, head, strlen(head))) {;} // ignore return value 318 318 319 319 if (logMsg) { 320 320 psString msg = NULL; // Message to print -
branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/psMemory.c
r21346 r23352 1069 1069 memBlock->func, memBlock->file, memBlock->lineno, (unsigned long)memBlock->tid); 1070 1070 } 1071 1072 bool psMemTypeEqual (void *ptr1, void *ptr2) { 1073 1074 // if ptr is a psAlloc()'d memory, find the actual address of the memBlock 1075 psMemBlock *memBlock1 = ((psMemBlock *)ptr1) - 1; 1076 HANDLE_BAD_BLOCK(memBlock1, __FILE__, __LINE__, __func__); 1077 if (!memBlock1->freeFunc) return false; 1078 1079 // if ptr is a psAlloc()'d memory, find the actual address of the memBlock 1080 psMemBlock *memBlock2 = ((psMemBlock *)ptr2) - 1; 1081 HANDLE_BAD_BLOCK(memBlock2, __FILE__, __LINE__, __func__); 1082 if (!memBlock2->freeFunc) return false; 1083 1084 return (memBlock1->freeFunc == memBlock2->freeFunc); 1085 } -
branches/cnb_branches/cnb_branch_20090301/psLib/src/sys/psMemory.h
r15047 r23352 636 636 ); 637 637 638 /** test for matching types (equal free functions) 639 * 640 * This function returns true if the two pointers have matching, non-NULL free functions. 641 * Supplied pointers must have been allocated within the psLib memory system (ie, with a psAlloc) or the function will abort. (XXX just return false?) 642 * Supplied pointers must have been provided with free function or the function returns false. 643 */ 644 bool psMemTypeEqual (void *ptr1, ///< pointer to first psMemory object 645 void *ptr2 ///< pointer to second psMemory object 646 ); 647 638 648 // Ensure this is a psLib pointer 639 649 #define PS_ASSERT_PTR_HEAVY(PTR, RVAL) \
Note:
See TracChangeset
for help on using the changeset viewer.
