Changeset 3165
- Timestamp:
- Feb 8, 2005, 3:04:01 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 1 added
- 9 edited
-
src/astronomy/astronomy.i (modified) (1 diff)
-
src/collections/psArray.c (modified) (2 diffs)
-
src/collections/psArray.h (modified) (2 diffs)
-
src/collections/psCollectionsErrors.dat (modified) (1 diff)
-
src/collections/psCollectionsErrors.h (modified) (2 diffs)
-
src/sysUtils/sysUtils.i (modified) (1 diff)
-
src/types/psArray.c (modified) (2 diffs)
-
src/types/psArray.h (modified) (2 diffs)
-
swig/phase2.pl (added)
-
swig/pslib.i (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/astronomy.i
r3114 r3165 3 3 %include "psAstronomyErrors.h" 4 4 %include "psCoord.h" 5 5 6 %include "psMetadata.h" 7 %extend psMetadataItem { 8 const char *get_STR(void) { 9 if (self->type != PS_META_STR) { 10 return NULL; 11 } else { 12 return self->data.V; 13 } 14 } 15 } 16 17 // add a method to add primitives to metadata 18 %inline %{ 19 psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, const char* comment, const char* value) { 20 return psMetadataAdd(md,where,name,PS_TYPE_PTR, PS_META_STR,comment,value); 21 } 22 psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name, const char* comment, psF32 value) { 23 return psMetadataAdd(md,where,name,PS_TYPE_F32, PS_META_PRIMITIVE,comment,value); 24 } 25 psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name, const char* comment, psF64 value) { 26 return psMetadataAdd(md,where,name,PS_TYPE_F64, PS_META_PRIMITIVE,comment,value); 27 } 28 psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name, const char* comment, psS32 value) { 29 return psMetadataAdd(md,where,name,PS_TYPE_S32, PS_META_PRIMITIVE,comment,value); 30 } 31 32 psMetadataItem* psMetadataItemAllocStr(const char* name, const char* comment, const char* value) { 33 return psMetadataItemAlloc(name, PS_TYPE_PTR, PS_META_STR, comment, value); 34 } 35 psMetadataItem* psMetadataItemAllocF32(const char* name, const char* comment, psF32 value) { 36 return psMetadataItemAlloc(name, PS_TYPE_F32, PS_META_PRIMITIVE, comment, value); 37 } 38 psMetadataItem* psMetadataItemAllocF64(const char* name, const char* comment, psF64 value) { 39 return psMetadataItemAlloc(name, PS_TYPE_F64, PS_META_PRIMITIVE, comment, value); 40 } 41 psMetadataItem* psMetadataItemAllocS32(const char* name, const char* comment, psS32 value) { 42 return psMetadataItemAlloc(name, PS_TYPE_S32, PS_META_PRIMITIVE, comment, value); 43 } 44 %} 45 46 %apply uint32_t *OUTPUT { uint32_t *nFail }; /* for psMetadataParseConfig */ 6 47 %include "psMetadataIO.h" 48 %clear uint32_t *nFail; 49 7 50 %include "psPhotometry.h" 8 51 %include "psTime.h" -
trunk/psLib/src/collections/psArray.c
r3115 r3165 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02-0 3 00:54:10$11 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-09 01:04:01 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 157 157 return in; 158 158 } 159 160 /// Set an element in the array. 161 psBool psArraySet(psArray* in, ///< input array to set element in 162 psU32 position, ///< the element position to set 163 void* value) ///< the value to set it to 164 { 165 if (in == NULL) 166 { 167 psError(PS_ERR_BAD_PARAMETER_NULL, true, 168 PS_ERRORTEXT_psArray_ARRAY_NULL); 169 return false; 170 } 171 172 if (position >= in->nalloc) 173 { 174 psError(PS_ERR_BAD_PARAMETER_NULL, true, 175 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC, 176 position, in->nalloc); 177 return false; 178 } 179 180 psFree(in->data[position]); 181 in->data[position] = value; 182 183 return true; 184 } 185 186 /// Get an element in the array. 187 void* psArrayGet(psArray* in, psU32 position ) 188 { 189 if (in == NULL) { 190 psError(PS_ERR_BAD_PARAMETER_NULL, true, 191 PS_ERRORTEXT_psArray_ARRAY_NULL); 192 return NULL; 193 } 194 195 if (position >= in->nalloc) { 196 psError(PS_ERR_BAD_PARAMETER_NULL, true, 197 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC, 198 position, in->nalloc); 199 return NULL; 200 } 201 202 return in->data[position]; 203 } 204 205 206 207 -
trunk/psLib/src/collections/psArray.h
r3115 r3165 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-02-0 3 00:54:10$14 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-02-09 01:04:01 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 126 126 ); 127 127 128 /** Set an element in the array. If the current element is non-NULL, the old 129 * element is freed. 130 * 131 * @return psBool TRUE if the element was set successfully, otherwise FALSE 132 */ 133 psBool psArraySet( 134 psArray* in, ///< input array to set element in 135 psU32 position, ///< the element position to set 136 void* value ///< the value to set it to 137 ); 138 139 /** Get an element from the array. 140 * 141 * @return void* the element at given position. 142 */ 143 void* psArrayGet( 144 psArray* in, ///< input array to get element from 145 psU32 position ///< the element position to get 146 ); 147 128 148 /// @} 129 149 -
trunk/psLib/src/collections/psCollectionsErrors.dat
r3107 r3165 10 10 psArray_REALLOC_NULL psArrayRealloc must be given a non-NULL psArray to resize. 11 11 psArray_ARRAY_NULL Specified psArray can not be NULL. 12 psArray_POSITION_BEYOND_NALLOC Specified position, %d, is greater than the allocated size of the array, %d. 12 13 # 13 14 psVector_REALLOC_NULL psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown. -
trunk/psLib/src/collections/psCollectionsErrors.h
r3107 r3165 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02-0 2 20:21:48$9 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-09 01:04:01 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 #define PS_ERRORTEXT_psArray_REALLOC_NULL "psArrayRealloc must be given a non-NULL psArray to resize." 33 33 #define PS_ERRORTEXT_psArray_ARRAY_NULL "Specified psArray can not be NULL." 34 #define PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC "Specified position, %d, is greater than the allocated size of the array, %d." 34 35 #define PS_ERRORTEXT_psVector_REALLOC_NULL "psVectorRealloc must a given a non-NULL psVector to resize. Desired datatype unknown." 35 36 #define PS_ERRORTEXT_psVector_NOT_A_VECTOR "The input psVector must have a vector dimension type." -
trunk/psLib/src/sysUtils/sysUtils.i
r3150 r3165 40 40 } 41 41 42 psS32 psMemCheckLeaksToStderr(psMemoryId id0, psMemBlock*** arr, psBool persistence) { 43 return psMemCheckLeaks(id0, arr, stderr, persistence); 44 } 45 psS32 psMemCheckLeaksToStdout(psMemoryId id0, psMemBlock*** arr, psBool persistence) { 46 return psMemCheckLeaks(id0, arr, stdout, persistence); 47 } 48 42 49 %} -
trunk/psLib/src/types/psArray.c
r3115 r3165 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-02-0 3 00:54:10$11 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-02-09 01:04:01 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 157 157 return in; 158 158 } 159 160 /// Set an element in the array. 161 psBool psArraySet(psArray* in, ///< input array to set element in 162 psU32 position, ///< the element position to set 163 void* value) ///< the value to set it to 164 { 165 if (in == NULL) 166 { 167 psError(PS_ERR_BAD_PARAMETER_NULL, true, 168 PS_ERRORTEXT_psArray_ARRAY_NULL); 169 return false; 170 } 171 172 if (position >= in->nalloc) 173 { 174 psError(PS_ERR_BAD_PARAMETER_NULL, true, 175 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC, 176 position, in->nalloc); 177 return false; 178 } 179 180 psFree(in->data[position]); 181 in->data[position] = value; 182 183 return true; 184 } 185 186 /// Get an element in the array. 187 void* psArrayGet(psArray* in, psU32 position ) 188 { 189 if (in == NULL) { 190 psError(PS_ERR_BAD_PARAMETER_NULL, true, 191 PS_ERRORTEXT_psArray_ARRAY_NULL); 192 return NULL; 193 } 194 195 if (position >= in->nalloc) { 196 psError(PS_ERR_BAD_PARAMETER_NULL, true, 197 PS_ERRORTEXT_psArray_POSITION_BEYOND_NALLOC, 198 position, in->nalloc); 199 return NULL; 200 } 201 202 return in->data[position]; 203 } 204 205 206 207 -
trunk/psLib/src/types/psArray.h
r3115 r3165 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-02-0 3 00:54:10$14 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-02-09 01:04:01 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 126 126 ); 127 127 128 /** Set an element in the array. If the current element is non-NULL, the old 129 * element is freed. 130 * 131 * @return psBool TRUE if the element was set successfully, otherwise FALSE 132 */ 133 psBool psArraySet( 134 psArray* in, ///< input array to set element in 135 psU32 position, ///< the element position to set 136 void* value ///< the value to set it to 137 ); 138 139 /** Get an element from the array. 140 * 141 * @return void* the element at given position. 142 */ 143 void* psArrayGet( 144 psArray* in, ///< input array to get element from 145 psU32 position ///< the element position to get 146 ); 147 128 148 /// @} 129 149 -
trunk/psLib/swig/pslib.i
r3150 r3165 16 16 17 17 /* XXX: this is temporary -- not portable, but should work with any current OS supported */ 18 typedef char int8_t; 19 typedef unsigned char uint8_t; 20 typedef short int16_t; 18 typedef unsigned char uint8_t; 21 19 typedef unsigned short uint16_t; 22 typedef int int32_t; 23 typedef unsigned int uint32_t; 24 typedef long long int64_t; 25 typedef unsigned long long uint64_t; 26 20 typedef unsigned int uint32_t; 21 typedef unsigned long uint64_t; 22 typedef char int8_t; 23 typedef short int16_t; 24 typedef int int32_t; 25 typedef long long int64_t; 27 26 28 27 /* grab the typedefs used throughout psLib, e.g. psU8, psU16,... */ 29 28 %include "cpointer.i" 29 %include "typemaps.i" 30 30 31 31 /**
Note:
See TracChangeset
for help on using the changeset viewer.
