IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1448


Ignore:
Timestamp:
Aug 9, 2004, 3:55:34 PM (22 years ago)
Author:
desonia
Message:

more doxygen-related cleanup

Location:
trunk/psLib/src
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageStats.c

    r1442 r1448  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-10 01:05:53 $
     12*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-10 01:55:34 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    327327 
    328328 *****************************************************************************/
    329 int psImageEvalPolynomial(const psImage* input, const psPolynomial2D* coeffs)
     329psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
    330330{
    331331    int x = 0;
  • trunk/psLib/src/image/psImageStats.h

    r1442 r1448  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-10 01:05:53 $
     11*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-10 01:55:34 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8080 *  @return psImage*    the resulting image
    8181 */
    82 int psImageEvalPolynomial(
    83     const psImage* input,              ///< input image
     82psImage* psImageEvalPolynomial(
     83    psImage* input,                    ///< input image
    8484    const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
    8585);
  • trunk/psLib/src/imageops/psImageStats.c

    r1442 r1448  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-10 01:05:53 $
     12*  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-10 01:55:34 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    327327 
    328328 *****************************************************************************/
    329 int psImageEvalPolynomial(const psImage* input, const psPolynomial2D* coeffs)
     329psImage* psImageEvalPolynomial(psImage* input, const psPolynomial2D* coeffs)
    330330{
    331331    int x = 0;
  • trunk/psLib/src/imageops/psImageStats.h

    r1442 r1448  
    99*  @author George Gusciora, MHPCC
    1010*
    11 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-10 01:05:53 $
     11*  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-10 01:55:34 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8080 *  @return psImage*    the resulting image
    8181 */
    82 int psImageEvalPolynomial(
    83     const psImage* input,              ///< input image
     82psImage* psImageEvalPolynomial(
     83    psImage* input,                    ///< input image
    8484    const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
    8585);
  • trunk/psLib/src/sys/psAbort.h

    r1441 r1448  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3737 *
    3838 */
    39 void psAbort(const char *name,  ///< Source of abort such as file or function detected
    40              const char *fmt,   ///< A printf style formatting statement defining msg
    41              ...
    42             );
     39void psAbort(
     40    const char *name,                  ///< Source of abort such as file or function detected
     41    const char *fmt,                   ///< A printf style formatting statement defining msg
     42    ...
     43);
    4344
    4445/* @} */// Doxygen - End of SystemGroup Functions
  • trunk/psLib/src/sys/psError.h

    r1441 r1448  
    1313 *  @author Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2004-08-09 23:40:55 $
     15 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2004-08-10 01:55:34 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232 *  log message.
    3333 *
    34  *  @return  void No return value
    35  *
    3634 */
    37 void psError(const char *name,  ///< Source of error such as file or function detected
    38              const char *fmt,   ///< A printf style formatting statement defining msg
    39              ...
    40             );
     35void psError(
     36    const char *name,                  ///< Source of error such as file or function detected
     37    const char *fmt,                   ///< A printf style formatting statement defining msg
     38    ...
     39);
    4140
    4241/* @} */// End of SysUtils Functions
  • trunk/psLib/src/sys/psLogMsg.c

    r1441 r1448  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8989 An integer specifying the old log destination.
    9090 *****************************************************************************/
    91 int psLogSetDestination(const char *dest)
     91bool psLogSetDestination(const char *dest)
    9292{
    9393    char protocol[5];
     
    104104        }
    105105        logDest = NULL;
    106         return 0;
     106        return true;
    107107    }
    108108
    109109    if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
    110110        psError(__func__, "The specified destination, %s, is malformed.", dest);
    111         return 1;
     111        return false;
    112112    }
    113113
     
    118118            }
    119119            logDest = stderr;
    120             return 0;
     120            return true;
    121121        }
    122122        if (strcmp(location, "stdout") == 0) {
     
    125125            }
    126126            logDest = stdout;
    127             return 0;
     127            return true;
    128128        }
    129129        psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
     
    134134        if (file == NULL) {
    135135            psError(__func__, "Could not open file '%s' for output.", location);
    136             return 1;
     136            return false;
    137137        }
    138138        if (logDest != NULL && logDest != stderr && logDest != stdout) {
     
    140140        }
    141141        logDest = file;
    142         return 0;
     142        return true;
    143143    }
    144144
    145145    psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
    146     return 1;
     146    return false;
    147147}
    148148
  • trunk/psLib/src/sys/psLogMsg.h

    r1441 r1448  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2020#define PS_LOG_MSG_H
    2121#include <stdarg.h>
     22#include <stdbool.h>
    2223
    2324/** @addtogroup LogTrace
     
    2526 */
    2627
    27 /// This procedure sets the destination for future log messages.  Currently
    28 /// the destination is specified by an integer which can have the following
    29 /// pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
    30 /// In future versions, this procedure will take a character string as an
    31 /// argument which can specify more general log destinations.
    32 int psLogSetDestination(const char *dest        ///< Specifies where to send messages.
    33                        );
     28/** This procedure sets the destination for future log messages.  Currently
     29 *  the destination is specified by an integer which can have the following
     30 *  pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
     31 *  In future versions, this procedure will take a character string as an
     32 *  argument which can specify more general log destinations.
     33 *
     34 *  @return int     true if set successfully, otherwise false.
     35 */
     36bool psLogSetDestination(
     37    const char *dest                   ///< Specifies where to send messages.
     38);
    3439
    35 /// This procedure sets the message level for future log messages.  Subsequent
    36 /// log messages, with a log level of "mylevel", will only be logged if
    37 /// "mylevel" is less than the current log level set by this procedure.
    38 /// Ie. higher values set by this procedure will cause more log messages to
    39 /// be displayed.
    40 int psLogSetLevel(int level     ///< Specifies the system log level
    41                  );
     40/** This procedure sets the message level for future log messages.  Subsequent
     41 *  log messages, with a log level of "mylevel", will only be logged if
     42 *  "mylevel" is less than the current log level set by this procedure.
     43 *  Ie. higher values set by this procedure will cause more log messages to
     44 *  be displayed.
     45 *
     46 *  @return int    old logging level
     47 */
     48int psLogSetLevel(
     49    int level                          ///< Specifies the system log level
     50);
    4251
    43 /// This procedure sets the log format for future log messages.  The argument
    44 /// must be a character string consistsing of the letters H (host), L
    45 /// (level), M (message), N (name), and T (time).  The default is "THLNM".
    46 /// Deleting a letter from the string will cause the associated information
    47 /// to not be logged.
    48 void psLogSetFormat(const char *fmt     ///< Specifies the system log format
    49                    );
     52/** This procedure sets the log format for future log messages.  The argument
     53 *  must be a character string consistsing of the letters H (host), L
     54 *  (level), M (message), N (name), and T (time).  The default is "THLNM".
     55 *  Deleting a letter from the string will cause the associated information
     56 *  to not be logged.
     57 *
     58 */
     59void psLogSetFormat(
     60    const char *fmt                    ///< Specifies the system log format
     61);
    5062
    51 /// This procedure logs a message to the destination set by a prior
    52 /// call to psLogSetDestination(), if myLevel is less than the level
    53 /// specified by a prior call to psLogSetLevel().  The message is specified
    54 /// with a printf-stype string an arguments.
    55 void psLogMsg(const char *name, ///< name of the log source
    56               int myLevel,      ///< severity level of this log message
    57               const char *fmt, ...      ///< printf-style format command
    58              );
     63/** This procedure logs a message to the destination set by a prior
     64 *  call to psLogSetDestination(), if myLevel is less than the level
     65 *  specified by a prior call to psLogSetLevel().  The message is specified
     66 *  with a printf-stype string an arguments.
     67 *
     68 */
     69void psLogMsg(
     70    const char *name,                  ///< name of the log source
     71    int myLevel,                       ///< severity level of this log message
     72    const char *fmt,                   ///< printf-style format command
     73    ...
     74);
    5975
    60 /// This procedure is functionally equivalent to psLogMsg(), except that
    61 /// it takes a va_list as the message parameter, not a printf-style string.
    62 void psLogMsgV(const char *name,        ///< name of the log source
    63                int myLevel,     ///< severity level of this log message
    64                const char *fmt, ///< printf-style format command
    65                va_list ap       ///< varargs argument list
    66               );
     76/** This procedure is functionally equivalent to psLogMsg(), except that
     77 *  it takes a va_list as the message parameter, not a printf-style string.
     78 *
     79 */
     80void psLogMsgV(
     81    const char *name,                  ///< name of the log source
     82    int myLevel,                       ///< severity level of this log message
     83    const char *fmt,                   ///< printf-style format command
     84    va_list ap                         ///< varargs argument list
     85);
    6786
    6887///< Status codes for log messages
    6988enum {
    70     PS_LOG_ABORT = 0,
    71     PS_LOG_ERROR,
    72     PS_LOG_WARN,
    73     PS_LOG_INFO
     89    PS_LOG_ABORT = 0,                  ///< log message is a critical error, perform an abort after printing
     90    PS_LOG_ERROR,                      ///< log message is an error, but don't abort
     91    PS_LOG_WARN,                       ///< log message is a warning
     92    PS_LOG_INFO                        ///< log message is informational only
    7493};
    7594
    7695///< Destinations for log messages
    7796enum {
    78     PS_LOG_NONE,
    79     PS_LOG_TO_STDERR,
    80     PS_LOG_TO_STDOUT
     97    PS_LOG_NONE,                       ///< turn off logging
     98    PS_LOG_TO_STDERR,                  ///< log to system's stderr
     99    PS_LOG_TO_STDOUT                   ///< log to system's stdout
    81100};
    82101
  • trunk/psLib/src/sys/psMemory.h

    r1441 r1448  
    1 #if !defined(PS_MEMORY_H)
    2 #define PS_MEMORY_H
    3 
    41/** @file  psMemory.h
    52 *
     
    1512 *  @ingroup MemoryManagement
    1613 *
    17  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    18  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1916 *
    2017 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    2118 */
     19
     20#if !defined(PS_MEMORY_H)
     21#define PS_MEMORY_H
    2222
    2323#include <stdio.h>                     // needed for FILE
     
    6363typedef struct psMemBlock
    6464{
    65     const void *startblock;     ///< initialised to p_psMEMMAGIC
    66     struct psMemBlock* previousBlock;   ///< previous block in allocation list
    67     struct psMemBlock* nextBlock;       ///< next block allocation list
    68     psFreeFcn freeFcn;          ///< deallocator.  If NULL, use generic deallocation.
    69     size_t userMemorySize;      ///< the size of the user-portion of the memory block
    70     const psMemoryId id;        ///< a unique ID for this allocation
    71     const char *file;           ///< set from __FILE__ in e.g. p_psAlloc
    72     const int lineno;           ///< set from __LINE__ in e.g. p_psAlloc
    73     pthread_mutex_t refCounterMutex;    ///< mutex to ensure exclusive access to reference counter
    74     psReferenceCount refCounter;        ///< how many times pointer is referenced
    75     const void *endblock;       ///< initialised to p_psMEMMAGIC
     65    const void *startblock;            ///< initialised to p_psMEMMAGIC
     66    struct psMemBlock* previousBlock;  ///< previous block in allocation list
     67    struct psMemBlock* nextBlock;      ///< next block allocation list
     68    psFreeFcn freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
     69    size_t userMemorySize;             ///< the size of the user-portion of the memory block
     70    const psMemoryId id;               ///< a unique ID for this allocation
     71    const char *file;                  ///< set from __FILE__ in e.g. p_psAlloc
     72    const int lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
     73    pthread_mutex_t refCounterMutex;   ///< mutex to ensure exclusive access to reference counter
     74    psReferenceCount refCounter;       ///< how many times pointer is referenced
     75    const void *endblock;              ///< initialised to p_psMEMMAGIC
    7676}
    7777psMemBlock;
     
    8282 *  @ingroup memCallback
    8383 */
    84 typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock* ptr      ///< the psMemBlock just allocated
    85                                            );
     84typedef psMemoryId(*psMemAllocateCallback) (
     85    const psMemBlock* ptr              ///< the psMemBlock just allocated
     86);
    8687
    8788/** prototype of memory free callback used by memory functions
     
    9091 *  @ingroup memCallback
    9192 */
    92 typedef psMemoryId(*psMemFreeCallback) (const psMemBlock* ptr  ///< the psMemBlock being freed
    93                                        );
     93typedef psMemoryId(*psMemFreeCallback) (
     94    const psMemBlock* ptr              ///< the psMemBlock being freed
     95);
    9496
    9597/** prototype of a callback used in error conditions
     
    100102 *  @ingroup memCallback
    101103 */
    102 typedef void (*psMemProblemCallback) (const psMemBlock* ptr,   ///< the pointer to the problematic memory
    103                                       // block.
    104                                       const char *file, ///< the file in which the problem originated
    105                                       int lineno        ///< the line number in which the problem originated
    106                                      );
     104typedef void (*psMemProblemCallback) (
     105    const psMemBlock* ptr,             ///< the pointer to the problematic memory block.
     106    const char *file,                  ///< the file in which the problem originated
     107    int lineno                         ///< the line number in which the problem originated
     108);
    107109
    108110/** prototype of a callback function used when memory runs out
     
    114116 *  @ingroup memCallback
    115117 */
    116 typedef void *(*psMemExhaustedCallback) (size_t size    // < the size of buffer required
    117                                         );
     118typedef void *(*psMemExhaustedCallback) (
     119    size_t size                        ///< the size of buffer required
     120);
    118121
    119122/** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
     
    145148 */
    146149#ifdef DOXYGEN
    147 void *psRealloc(void *ptr       ///< Pointer to re-allocate
    148                 size_t size,    ///< Size required
    149                );
    150 #else
    151 
    152 void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
    153                   size_t size,  ///< Size required
    154                   const char *file,     ///< File of call
    155                   int lineno    ///< Line number of call
    156                  );
     150void *psRealloc(
     151    void *ptr                          ///< Pointer to re-allocate
     152    size_t size,                       ///< Size required
     153);
     154#else
     155
     156void *p_psRealloc(
     157    void *ptr,                         ///< Pointer to re-allocate
     158    size_t size,                       ///< Size required
     159    const char *file,                  ///< File of call
     160    int lineno                         ///< Line number of call
     161);
    157162
    158163/// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
     
    166171 */
    167172#ifdef DOXYGEN
    168 void psFree(void *ptr,          ///< Pointer to free, if NULL, function returns immediately.
    169            );
    170 #else
    171 
    172 void p_psFree(void *ptr,        ///< Pointer to free
    173               const char *file, ///< File of call
    174               int lineno        ///< Line number of call
    175              );
     173void psFree(
     174    void *ptr,                         ///< Pointer to free, if NULL, function returns immediately.
     175);
     176#else
     177
     178void p_psFree(
     179    void *ptr,                        ///< Pointer to free
     180    const char *file,                 ///< File of call
     181    int lineno                        ///< Line number of call
     182);
    176183
    177184/// Free memory.  psFree sends file and line number to p_psFree.
     
    194201 *  @ingroup memTracing
    195202 */
    196 int psMemCheckLeaks(psMemoryId id0,     ///< don't list blocks with id < id0
    197                     psMemBlock* ** arr, ///< pointer to array of pointers to leaked blocks, or NULL
    198                     FILE * fd   ///< print list of leaks to fd (or NULL)
    199                    );
     203int psMemCheckLeaks(
     204    psMemoryId id0,                    ///< don't list blocks with id < id0
     205    psMemBlock* ** arr,                ///< pointer to array of pointers to leaked blocks, or NULL
     206    FILE * fd                          ///< print list of leaks to fd (or NULL)
     207);
    200208
    201209/** Check for memory corruption.  Scans all currently allocated memory buffers and checks for corruptions,
     
    204212 *  @ingroup memTracing
    205213 */
    206 int psMemCheckCorruption(bool abort_on_error    ///< Abort on detecting corruption?
    207                         );
     214int psMemCheckCorruption(
     215    bool abort_on_error                ///< Abort on detecting corruption?
     216);
    208217
    209218/** Return reference counter
     
    211220 *  @ingroup memRefCount
    212221 */
    213 psReferenceCount psMemGetRefCounter(void *vptr  ///< Pointer to get refCounter for
    214                                    );
     222psReferenceCount psMemGetRefCounter(
     223    void *vptr                         ///< Pointer to get refCounter for
     224);
    215225
    216226/** Increment reference counter and return the pointer
     
    219229 */
    220230#ifdef DOXYGEN
    221 void *psMemIncrRefCounter(void *vptr    ///< Pointer to increment refCounter, and return
    222                          );
    223 #else
    224 
    225 void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
    226                             const char *file,   ///< File of call
    227                             int lineno  ///< Line number of call
    228                            );
     231void *psMemIncrRefCounter(
     232    void *vptr                         ///< Pointer to increment refCounter, and return
     233);
     234#else
     235
     236void *p_psMemIncrRefCounter(
     237    void *vptr,                        ///< Pointer to increment refCounter, and return
     238    const char *file,                  ///< File of call
     239    int lineno                         ///< Line number of call
     240);
    229241
    230242#define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
     
    234246 *
    235247 *  @ingroup memRefCount
    236  */
    237 #ifdef DOXYGEN
    238 void *psMemDecrRefCounter(void *vptr    ///< Pointer to decrement refCounter, and return
    239                          );
    240 #else
    241 
    242 void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
    243                             const char *file,   ///< File of call
    244                             int lineno  ///< Line number of call
    245                            );
     248 *
     249 *  @return void*    the pointer deremented in refCount, or NULL if pointer is
     250 *                   fully dereferenced.
     251 */
     252#ifdef DOXYGEN
     253void* psMemDecrRefCounter(
     254    void* vptr                         ///< Pointer to decrement refCounter, and return
     255);
     256#else
     257
     258void *p_psMemDecrRefCounter(
     259    void *vptr,                        ///< Pointer to decrement refCounter, and return
     260    const char *file,                  ///< File of call
     261    int lineno                         ///< Line number of call
     262);
    246263
    247264#define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
    248265#endif
    249266
    250 /** Set callback for problems
    251  *  @ingroup memCallback
    252  */
    253 psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  ///< Function to run
    254                                             );
    255 
    256 /** Set callback for out-of-memory
    257  *
    258  *  @ingroup memCallback
    259  */
    260 psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    ///< Function to run
    261                                                 );
     267/** Set callback for problems.
     268 *
     269 *  At various occasions, the memory manager can check the state of the memory
     270 *  stack. If any of these checks discover that the memory stack is corrupted,
     271 *  the psMemProblemCallback is called.
     272 
     273 *  @ingroup memCallback
     274 *
     275 *  @return psMemProblemCallback       old psMemProblemCallback function
     276 */
     277psMemProblemCallback psMemProblemCallbackSet(
     278    psMemProblemCallback func          ///< Function to run at memory problem detection
     279);
     280
     281/** Set callback for out-of-memory.
     282 *
     283 *  If not enough memory is available to satisfy a request by psAlloc or
     284 *  psRealloc, these functions attempt to find an alternative solution by
     285 *  calling the psMemExhaustedCallback, a function which may be set by the
     286 *  programmer in appropriate circumstances, rather than immediately fail.
     287 *  The typical use of such a feature may be when a program needs a large
     288 *  chunk of memory to do an operation, but the exact size is not critical.
     289 *  This feature gives the programmer the opportunity to make a smaller
     290 *  request and try again, limiting the size of the operating buffer.
     291 *
     292 *  @ingroup memCallback
     293 *
     294 *  @return psMemExhaustedCallback     old psMemExhaustedCallback function
     295 */
     296psMemExhaustedCallback psMemExhaustedCallbackSet(
     297    psMemExhaustedCallback func        ///< Function to run at memory exhaustion
     298);
    262299
    263300/** Set call back for when a particular memory block is allocated
    264301 *
    265  *  @ingroup memCallback
    266  */
    267 psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       ///< Function to run
    268                                               );
     302 *  A private variable, p_psMemAllocateID, can be used to trace the allocation
     303 *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a
     304 *  memory block with that ID is allocated, psMemAllocateCallback is called
     305 *  just before memory is returned to the calling function.
     306 *
     307 *  @ingroup memCallback
     308 *
     309 *  @return psMemAllocateCallback      old psMemAllocateCallback function
     310 */
     311psMemAllocateCallback psMemAllocateCallbackSet(
     312    psMemAllocateCallback func       ///< Function to run at memory allocation of specific mem block
     313);
    269314
    270315/** Set call back for when a particular memory block is freed
    271316 *
    272  *  @ingroup memCallback
    273  */
    274 psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   ///< Function to run
    275                                       );
     317 *  A private variable, p_psMemFreeID, can be used to trace the freeing of
     318 *  specific memory blocks. If p_psMemFreeID is set and the memory block with
     319 *  the ID is about to be freed, the psMemFreeCallback callback is called just
     320 *  before the memory block is freed.
     321 *
     322 *  @ingroup memCallback
     323 *
     324 *  @return psMemFreeCallback          old psMemFreeCallback function
     325 */
     326psMemFreeCallback psMemFreeCallbackSet(
     327    psMemFreeCallback func             ///< Function to run at memory free of specific mem block
     328);
    276329
    277330/** get next memory ID
    278331 *
    279332 *  @ingroup memCallback
     333 *
     334 *  @return psMemoryId                 the next memory ID to be used
    280335 */
    281336psMemoryId psMemGetId(void);
    282337
    283 /** set p_psMemAllocateID to id
    284  *
    285  *  @ingroup memCallback
    286  */
    287 psMemoryId psMemAllocateCallbackSetID(psMemoryId id     ///< ID to set
    288                                      );
     338/** set p_psMemAllocateID to specific id
     339 *
     340 *  A private variable, p_psMemAllocateID, can be used to trace the allocation
     341 *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a
     342 *  memory block with that ID is allocated, psMemAllocateCallback is called
     343 *  just before memory is returned to the calling function.
     344 *
     345 *  @ingroup memCallback
     346 *
     347 *  @return psMemoryId       
     348 *
     349 *  @see psMemAllocateCallbackSet   
     350 */
     351psMemoryId psMemAllocateCallbackSetID(
     352    psMemoryId id                      ///< ID to set
     353);
    289354
    290355/** set p_psMemFreeID to id
    291356 *
    292  *  @ingroup memCallback
    293  */
    294 psMemoryId psMemFreeCallbackSetID(psMemoryId id ///< ID to set
    295                                  );
     357 *  A private variable, p_psMemFreeID, can be used to trace the freeing of
     358 *  specific memory blocks. If p_psMemFreeID is set and the memory block with
     359 *  the ID is about to be freed, the psMemFreeCallback callback is called just
     360 *  before the memory block is freed.
     361 *
     362 *  @ingroup memCallback
     363 *
     364 *  @return psMemoryId                 the old p_psMemFreeID
     365 *
     366 *  @see psMemFreeCallbackSet
     367 */
     368psMemoryId psMemFreeCallbackSetID(
     369    psMemoryId id                      ///< ID to set
     370);
    296371
    297372//@} End of Memory Management Functions
     
    306381#pragma GCC poison malloc realloc calloc free
    307382#else
    308 #                define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
    309 #                define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
    310 #                define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
    311 #                define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
    312 #            endif
    313 #        endif
    314 
    315 #    endif
     383#define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
     384#define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
     385#define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
     386#define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
     387#endif
     388#endif
     389
     390#endif
    316391// doxygen skip
    317392
  • trunk/psLib/src/sys/psString.h

    r1441 r1448  
    1 
    21/** @file  psString.h
    32 *
     
    1110 *  @author Eric Van Alst, MHPCC
    1211 *
    13  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-09 23:40:55 $
     12 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-10 01:55:34 $
    1514 *
    1615 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2019#define PS_STRING_H
    2120
    22 /******************************************************************************/
    2321
    24 /*  DEFINE STATEMENTS                                                         */
    25 
    26 /******************************************************************************/
    27 
    28 /** This macro will convert the arguement to a quoted string */
     22/** This macro will convert the argument to a quoted string */
    2923#define PS_STRING(S)  #S
    30 
    31 /******************************************************************************/
    32 
    33 /*  TYPE DEFINITIONS                                                          */
    34 
    35 /******************************************************************************/
    36 
    37 // None
    38 
    39 /*****************************************************************************/
    40 
    41 /* FUNCTION PROTOTYPES                                                       */
    42 
    43 /*****************************************************************************/
    4424
    4525// Doxygen group tags
     
    5434 *  plus one and copy the input string to the newly allocated memory.
    5535 *
    56  *  @return  char* Copy of input string
     36 *  @return char*      Copy of input string
    5737 *
    5838 */
    59 
    60 char *psStringCopy(const char *str
    61                    /**< Input string of characters to copy */
    62                   );
     39char *psStringCopy(
     40    const char *str
     41    /**< Input string of characters to copy */
     42);
    6343
    6444/** Copies the input string up to the specified number of characters
     
    7858/*@null@*/
    7959
    80 char *psStringNCopy(const char *str,
    81                     /**< Input string of characters to copy */
     60char *psStringNCopy(
     61    const char *str,
     62    /**< Input string of characters to copy */
    8263
    83                     int nChar
    84                     /**< Number of bytes to allocate for string copy */
    85                    );
     64    int nChar
     65    /**< Number of bytes to allocate for string copy */
     66);
    8667
    8768/* @} */// Doxygen - End of SystemGroup Functions
  • trunk/psLib/src/sys/psType.h

    r1441 r1448  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:55 $
     13*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-10 01:55:34 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4040 */
    4141
    42 typedef uint8_t psU8;           ///< 8-bit unsigned int
    43 typedef uint16_t psU16;         ///< 16-bit unsigned int
    44 typedef uint32_t psU32;         ///< 32-bit unsigned int
    45 typedef uint64_t psU64;         ///< 64-bit unsigned int
    46 typedef int8_t psS8;            ///< 8-bit signed int
    47 typedef int16_t psS16;          ///< 16-bit signed int
    48 typedef int32_t psS32;          ///< 32-bit signed int
    49 typedef int64_t psS64;          ///< 64-bit signed int
    50 typedef float psF32;            ///< 32-bit floating point
    51 typedef double psF64;           ///< 64-bit floating point
    52 typedef complex float psC32;    ///< complex with 32-bit floating point Real and Imagary numbers
    53 typedef complex double psC64;   ///< complex with 64-bit floating point Real and Imagary numbers
    54 typedef void *psPTR;            ///< void pointer
     42typedef uint8_t psU8;                  ///< 8-bit unsigned int
     43typedef uint16_t psU16;                ///< 16-bit unsigned int
     44typedef uint32_t psU32;                ///< 32-bit unsigned int
     45typedef uint64_t psU64;                ///< 64-bit unsigned int
     46typedef int8_t psS8;                   ///< 8-bit signed int
     47typedef int16_t psS16;                 ///< 16-bit signed int
     48typedef int32_t psS32;                 ///< 32-bit signed int
     49typedef int64_t psS64;                 ///< 64-bit signed int
     50typedef float psF32;                   ///< 32-bit floating point
     51typedef double psF64;                  ///< 64-bit floating point
     52typedef complex float psC32;           ///< complex with 32-bit floating point Real and Imagary numbers
     53typedef complex double psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
     54typedef void *psPTR;                   ///< void pointer
    5555
    5656typedef enum {
    57     PS_TYPE_S8 = 0x0101,        ///< Character.
    58     PS_TYPE_S16 = 0x0102,                  ///< Short integer.
    59     PS_TYPE_S32 = 0x0104,                  ///< Integer.
    60     PS_TYPE_S64 = 0x0108,                  ///< Long integer.
    61     PS_TYPE_U8 = 0x0301,                   ///< Unsigned character.
    62     PS_TYPE_U16 = 0x0302,                  ///< Unsigned short integer.
    63     PS_TYPE_U32 = 0x0304,                  ///< Unsigned integer.
    64     PS_TYPE_U64 = 0x0308,                  ///< Unsigned long integer.
    65     PS_TYPE_F32 = 0x0404,                  ///< Single-precision Floating point.
    66     PS_TYPE_F64 = 0x0408,                  ///< Double-precision floating point.
    67     PS_TYPE_C32 = 0x0808,                  ///< Complex numbers consisting of single-precision floating
    68     // point.
    69     PS_TYPE_C64 = 0x0810,                  ///< Complex numbers consisting of double-precision floating
    70     // point.
    71     PS_TYPE_PTR = 0x0000                   ///< Something else that's not supported for arithmetic.
     57    PS_TYPE_S8 = 0x0101,               ///< Character.
     58    PS_TYPE_S16 = 0x0102,              ///< Short integer.
     59    PS_TYPE_S32 = 0x0104,              ///< Integer.
     60    PS_TYPE_S64 = 0x0108,              ///< Long integer.
     61    PS_TYPE_U8 = 0x0301,               ///< Unsigned character.
     62    PS_TYPE_U16 = 0x0302,              ///< Unsigned short integer.
     63    PS_TYPE_U32 = 0x0304,              ///< Unsigned integer.
     64    PS_TYPE_U64 = 0x0308,              ///< Unsigned long integer.
     65    PS_TYPE_F32 = 0x0404,              ///< Single-precision Floating point.
     66    PS_TYPE_F64 = 0x0408,              ///< Double-precision floating point.
     67    PS_TYPE_C32 = 0x0808,              ///< Complex numbers consisting of single-precision floating point.
     68    PS_TYPE_C64 = 0x0810,              ///< Complex numbers consisting of double-precision floating point.
     69    PS_TYPE_PTR = 0x0000               ///< Something else that's not supported for arithmetic.
    7270} psElemType;
    7371
    74 #define PS_TYPE_MASK PS_TYPE_U8        ///< the psElemType to use for mask image
    75 #define PS_TYPE_MASK_DATA U8           ///< the data member to use for mask image
    76 #define PS_TYPE_MASK_NAME "psU8"
    77 typedef psU8 psMaskType;        ///< the C datatype for a mask image
     72#define PS_TYPE_MASK PS_TYPE_U8        /**< the psElemType to use for mask image */
     73#define PS_TYPE_MASK_DATA U8           /**< the data member to use for mask image */
     74#define PS_TYPE_MASK_NAME "psU8"       /**< the data type for mask as a string */
    7875
    79 #define PS_MIN_S8        INT8_MIN
    80 #define PS_MIN_S16       INT16_MIN
    81 #define PS_MIN_S32       INT32_MIN
    82 #define PS_MIN_S64       INT64_MIN
    83 #define PS_MIN_U8        0
    84 #define PS_MIN_U16       0
    85 #define PS_MIN_U32       0
    86 #define PS_MIN_U64       0
    87 #define PS_MIN_F32       -FLT_MAX
    88 #define PS_MIN_F64       -DBL_MAX
    89 #define PS_MIN_C32       -FLT_MAX
    90 #define PS_MIN_C64       -DBL_MAX
     76typedef psU8 psMaskType;               ///< the C datatype for a mask image
    9177
    92 #define PS_MAX_S8        INT8_MAX
    93 #define PS_MAX_S16       INT16_MAX
    94 #define PS_MAX_S32       INT32_MAX
    95 #define PS_MAX_S64       INT64_MAX
    96 #define PS_MAX_U8        UINT8_MAX
    97 #define PS_MAX_U16       UINT16_MAX
    98 #define PS_MAX_U32       UINT32_MAX
    99 #define PS_MAX_U64       UINT64_MAX
    100 #define PS_MAX_F32       FLT_MAX
    101 #define PS_MAX_F64       DBL_MAX
    102 #define PS_MAX_C32       FLT_MAX
    103 #define PS_MAX_C64       DBL_MAX
     78
     79#define PS_MIN_S8        INT8_MIN      /**< minimum valid psS8 value */
     80#define PS_MIN_S16       INT16_MIN     /**< minimum valid psS16 value */
     81#define PS_MIN_S32       INT32_MIN     /**< minimum valid psS32 value */
     82#define PS_MIN_S64       INT64_MIN     /**< minimum valid psS64 value */
     83#define PS_MIN_U8        0             /**< minimum valid psU8 value */
     84#define PS_MIN_U16       0             /**< minimum valid psU16 value */
     85#define PS_MIN_U32       0             /**< minimum valid psU32 value */
     86#define PS_MIN_U64       0             /**< minimum valid psU64 value */
     87#define PS_MIN_F32       -FLT_MAX      /**< minimum valid psF32 value */
     88#define PS_MIN_F64       -DBL_MAX      /**< minimum valid psF64 value */
     89#define PS_MIN_C32       -FLT_MAX      /**< minimum valid real or imaginary psC32 value */
     90#define PS_MIN_C64       -DBL_MAX      /**< minimum valid real or imaginary psC32 value */
     91
     92#define PS_MAX_S8        INT8_MAX      /**< maximum valid psS8 value */
     93#define PS_MAX_S16       INT16_MAX     /**< maximum valid psS16 value */
     94#define PS_MAX_S32       INT32_MAX     /**< maximum valid psS32 value */
     95#define PS_MAX_S64       INT64_MAX     /**< maximum valid psS64 value */
     96#define PS_MAX_U8        UINT8_MAX     /**< maximum valid psU8 value */
     97#define PS_MAX_U16       UINT16_MAX    /**< maximum valid psU16 value */
     98#define PS_MAX_U32       UINT32_MAX    /**< maximum valid psU32 value */
     99#define PS_MAX_U64       UINT64_MAX    /**< maximum valid psU64 value */
     100#define PS_MAX_F32       FLT_MAX       /**< maximum valid psF32 value */
     101#define PS_MAX_F64       DBL_MAX       /**< maximum valid psF64 value */
     102#define PS_MAX_C32       FLT_MAX       /**< maximum valid real or imaginary psC32 value */
     103#define PS_MAX_C64       DBL_MAX       /**< maximum valid real or imaginary psC32 value */
    104104
    105105/// Macro to get the bad pixel reason code (stored as part of mask value)
  • trunk/psLib/src/sysUtils/psAbort.h

    r1441 r1448  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3737 *
    3838 */
    39 void psAbort(const char *name,  ///< Source of abort such as file or function detected
    40              const char *fmt,   ///< A printf style formatting statement defining msg
    41              ...
    42             );
     39void psAbort(
     40    const char *name,                  ///< Source of abort such as file or function detected
     41    const char *fmt,                   ///< A printf style formatting statement defining msg
     42    ...
     43);
    4344
    4445/* @} */// Doxygen - End of SystemGroup Functions
  • trunk/psLib/src/sysUtils/psError.h

    r1441 r1448  
    1313 *  @author Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2004-08-09 23:40:55 $
     15 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2004-08-10 01:55:34 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232 *  log message.
    3333 *
    34  *  @return  void No return value
    35  *
    3634 */
    37 void psError(const char *name,  ///< Source of error such as file or function detected
    38              const char *fmt,   ///< A printf style formatting statement defining msg
    39              ...
    40             );
     35void psError(
     36    const char *name,                  ///< Source of error such as file or function detected
     37    const char *fmt,                   ///< A printf style formatting statement defining msg
     38    ...
     39);
    4140
    4241/* @} */// End of SysUtils Functions
  • trunk/psLib/src/sysUtils/psLogMsg.c

    r1441 r1448  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8989 An integer specifying the old log destination.
    9090 *****************************************************************************/
    91 int psLogSetDestination(const char *dest)
     91bool psLogSetDestination(const char *dest)
    9292{
    9393    char protocol[5];
     
    104104        }
    105105        logDest = NULL;
    106         return 0;
     106        return true;
    107107    }
    108108
    109109    if (sscanf(dest, "%4s:%256s", protocol, location) < 2) {
    110110        psError(__func__, "The specified destination, %s, is malformed.", dest);
    111         return 1;
     111        return false;
    112112    }
    113113
     
    118118            }
    119119            logDest = stderr;
    120             return 0;
     120            return true;
    121121        }
    122122        if (strcmp(location, "stdout") == 0) {
     
    125125            }
    126126            logDest = stdout;
    127             return 0;
     127            return true;
    128128        }
    129129        psError(__func__, "The location, %s, for protocol 'dest' is invalid.", location);
     
    134134        if (file == NULL) {
    135135            psError(__func__, "Could not open file '%s' for output.", location);
    136             return 1;
     136            return false;
    137137        }
    138138        if (logDest != NULL && logDest != stderr && logDest != stdout) {
     
    140140        }
    141141        logDest = file;
    142         return 0;
     142        return true;
    143143    }
    144144
    145145    psError(__func__, "Do not know how to handle the protocol '%s'.", protocol);
    146     return 1;
     146    return false;
    147147}
    148148
  • trunk/psLib/src/sysUtils/psLogMsg.h

    r1441 r1448  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2020#define PS_LOG_MSG_H
    2121#include <stdarg.h>
     22#include <stdbool.h>
    2223
    2324/** @addtogroup LogTrace
     
    2526 */
    2627
    27 /// This procedure sets the destination for future log messages.  Currently
    28 /// the destination is specified by an integer which can have the following
    29 /// pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
    30 /// In future versions, this procedure will take a character string as an
    31 /// argument which can specify more general log destinations.
    32 int psLogSetDestination(const char *dest        ///< Specifies where to send messages.
    33                        );
     28/** This procedure sets the destination for future log messages.  Currently
     29 *  the destination is specified by an integer which can have the following
     30 *  pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR.
     31 *  In future versions, this procedure will take a character string as an
     32 *  argument which can specify more general log destinations.
     33 *
     34 *  @return int     true if set successfully, otherwise false.
     35 */
     36bool psLogSetDestination(
     37    const char *dest                   ///< Specifies where to send messages.
     38);
    3439
    35 /// This procedure sets the message level for future log messages.  Subsequent
    36 /// log messages, with a log level of "mylevel", will only be logged if
    37 /// "mylevel" is less than the current log level set by this procedure.
    38 /// Ie. higher values set by this procedure will cause more log messages to
    39 /// be displayed.
    40 int psLogSetLevel(int level     ///< Specifies the system log level
    41                  );
     40/** This procedure sets the message level for future log messages.  Subsequent
     41 *  log messages, with a log level of "mylevel", will only be logged if
     42 *  "mylevel" is less than the current log level set by this procedure.
     43 *  Ie. higher values set by this procedure will cause more log messages to
     44 *  be displayed.
     45 *
     46 *  @return int    old logging level
     47 */
     48int psLogSetLevel(
     49    int level                          ///< Specifies the system log level
     50);
    4251
    43 /// This procedure sets the log format for future log messages.  The argument
    44 /// must be a character string consistsing of the letters H (host), L
    45 /// (level), M (message), N (name), and T (time).  The default is "THLNM".
    46 /// Deleting a letter from the string will cause the associated information
    47 /// to not be logged.
    48 void psLogSetFormat(const char *fmt     ///< Specifies the system log format
    49                    );
     52/** This procedure sets the log format for future log messages.  The argument
     53 *  must be a character string consistsing of the letters H (host), L
     54 *  (level), M (message), N (name), and T (time).  The default is "THLNM".
     55 *  Deleting a letter from the string will cause the associated information
     56 *  to not be logged.
     57 *
     58 */
     59void psLogSetFormat(
     60    const char *fmt                    ///< Specifies the system log format
     61);
    5062
    51 /// This procedure logs a message to the destination set by a prior
    52 /// call to psLogSetDestination(), if myLevel is less than the level
    53 /// specified by a prior call to psLogSetLevel().  The message is specified
    54 /// with a printf-stype string an arguments.
    55 void psLogMsg(const char *name, ///< name of the log source
    56               int myLevel,      ///< severity level of this log message
    57               const char *fmt, ...      ///< printf-style format command
    58              );
     63/** This procedure logs a message to the destination set by a prior
     64 *  call to psLogSetDestination(), if myLevel is less than the level
     65 *  specified by a prior call to psLogSetLevel().  The message is specified
     66 *  with a printf-stype string an arguments.
     67 *
     68 */
     69void psLogMsg(
     70    const char *name,                  ///< name of the log source
     71    int myLevel,                       ///< severity level of this log message
     72    const char *fmt,                   ///< printf-style format command
     73    ...
     74);
    5975
    60 /// This procedure is functionally equivalent to psLogMsg(), except that
    61 /// it takes a va_list as the message parameter, not a printf-style string.
    62 void psLogMsgV(const char *name,        ///< name of the log source
    63                int myLevel,     ///< severity level of this log message
    64                const char *fmt, ///< printf-style format command
    65                va_list ap       ///< varargs argument list
    66               );
     76/** This procedure is functionally equivalent to psLogMsg(), except that
     77 *  it takes a va_list as the message parameter, not a printf-style string.
     78 *
     79 */
     80void psLogMsgV(
     81    const char *name,                  ///< name of the log source
     82    int myLevel,                       ///< severity level of this log message
     83    const char *fmt,                   ///< printf-style format command
     84    va_list ap                         ///< varargs argument list
     85);
    6786
    6887///< Status codes for log messages
    6988enum {
    70     PS_LOG_ABORT = 0,
    71     PS_LOG_ERROR,
    72     PS_LOG_WARN,
    73     PS_LOG_INFO
     89    PS_LOG_ABORT = 0,                  ///< log message is a critical error, perform an abort after printing
     90    PS_LOG_ERROR,                      ///< log message is an error, but don't abort
     91    PS_LOG_WARN,                       ///< log message is a warning
     92    PS_LOG_INFO                        ///< log message is informational only
    7493};
    7594
    7695///< Destinations for log messages
    7796enum {
    78     PS_LOG_NONE,
    79     PS_LOG_TO_STDERR,
    80     PS_LOG_TO_STDOUT
     97    PS_LOG_NONE,                       ///< turn off logging
     98    PS_LOG_TO_STDERR,                  ///< log to system's stderr
     99    PS_LOG_TO_STDOUT                   ///< log to system's stdout
    81100};
    82101
  • trunk/psLib/src/sysUtils/psMemory.h

    r1441 r1448  
    1 #if !defined(PS_MEMORY_H)
    2 #define PS_MEMORY_H
    3 
    41/** @file  psMemory.h
    52 *
     
    1512 *  @ingroup MemoryManagement
    1613 *
    17  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    18  *  @date $Date: 2004-08-09 23:40:55 $
     14 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-10 01:55:34 $
    1916 *
    2017 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    2118 */
     19
     20#if !defined(PS_MEMORY_H)
     21#define PS_MEMORY_H
    2222
    2323#include <stdio.h>                     // needed for FILE
     
    6363typedef struct psMemBlock
    6464{
    65     const void *startblock;     ///< initialised to p_psMEMMAGIC
    66     struct psMemBlock* previousBlock;   ///< previous block in allocation list
    67     struct psMemBlock* nextBlock;       ///< next block allocation list
    68     psFreeFcn freeFcn;          ///< deallocator.  If NULL, use generic deallocation.
    69     size_t userMemorySize;      ///< the size of the user-portion of the memory block
    70     const psMemoryId id;        ///< a unique ID for this allocation
    71     const char *file;           ///< set from __FILE__ in e.g. p_psAlloc
    72     const int lineno;           ///< set from __LINE__ in e.g. p_psAlloc
    73     pthread_mutex_t refCounterMutex;    ///< mutex to ensure exclusive access to reference counter
    74     psReferenceCount refCounter;        ///< how many times pointer is referenced
    75     const void *endblock;       ///< initialised to p_psMEMMAGIC
     65    const void *startblock;            ///< initialised to p_psMEMMAGIC
     66    struct psMemBlock* previousBlock;  ///< previous block in allocation list
     67    struct psMemBlock* nextBlock;      ///< next block allocation list
     68    psFreeFcn freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
     69    size_t userMemorySize;             ///< the size of the user-portion of the memory block
     70    const psMemoryId id;               ///< a unique ID for this allocation
     71    const char *file;                  ///< set from __FILE__ in e.g. p_psAlloc
     72    const int lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
     73    pthread_mutex_t refCounterMutex;   ///< mutex to ensure exclusive access to reference counter
     74    psReferenceCount refCounter;       ///< how many times pointer is referenced
     75    const void *endblock;              ///< initialised to p_psMEMMAGIC
    7676}
    7777psMemBlock;
     
    8282 *  @ingroup memCallback
    8383 */
    84 typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock* ptr      ///< the psMemBlock just allocated
    85                                            );
     84typedef psMemoryId(*psMemAllocateCallback) (
     85    const psMemBlock* ptr              ///< the psMemBlock just allocated
     86);
    8687
    8788/** prototype of memory free callback used by memory functions
     
    9091 *  @ingroup memCallback
    9192 */
    92 typedef psMemoryId(*psMemFreeCallback) (const psMemBlock* ptr  ///< the psMemBlock being freed
    93                                        );
     93typedef psMemoryId(*psMemFreeCallback) (
     94    const psMemBlock* ptr              ///< the psMemBlock being freed
     95);
    9496
    9597/** prototype of a callback used in error conditions
     
    100102 *  @ingroup memCallback
    101103 */
    102 typedef void (*psMemProblemCallback) (const psMemBlock* ptr,   ///< the pointer to the problematic memory
    103                                       // block.
    104                                       const char *file, ///< the file in which the problem originated
    105                                       int lineno        ///< the line number in which the problem originated
    106                                      );
     104typedef void (*psMemProblemCallback) (
     105    const psMemBlock* ptr,             ///< the pointer to the problematic memory block.
     106    const char *file,                  ///< the file in which the problem originated
     107    int lineno                         ///< the line number in which the problem originated
     108);
    107109
    108110/** prototype of a callback function used when memory runs out
     
    114116 *  @ingroup memCallback
    115117 */
    116 typedef void *(*psMemExhaustedCallback) (size_t size    // < the size of buffer required
    117                                         );
     118typedef void *(*psMemExhaustedCallback) (
     119    size_t size                        ///< the size of buffer required
     120);
    118121
    119122/** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
     
    145148 */
    146149#ifdef DOXYGEN
    147 void *psRealloc(void *ptr       ///< Pointer to re-allocate
    148                 size_t size,    ///< Size required
    149                );
    150 #else
    151 
    152 void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
    153                   size_t size,  ///< Size required
    154                   const char *file,     ///< File of call
    155                   int lineno    ///< Line number of call
    156                  );
     150void *psRealloc(
     151    void *ptr                          ///< Pointer to re-allocate
     152    size_t size,                       ///< Size required
     153);
     154#else
     155
     156void *p_psRealloc(
     157    void *ptr,                         ///< Pointer to re-allocate
     158    size_t size,                       ///< Size required
     159    const char *file,                  ///< File of call
     160    int lineno                         ///< Line number of call
     161);
    157162
    158163/// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
     
    166171 */
    167172#ifdef DOXYGEN
    168 void psFree(void *ptr,          ///< Pointer to free, if NULL, function returns immediately.
    169            );
    170 #else
    171 
    172 void p_psFree(void *ptr,        ///< Pointer to free
    173               const char *file, ///< File of call
    174               int lineno        ///< Line number of call
    175              );
     173void psFree(
     174    void *ptr,                         ///< Pointer to free, if NULL, function returns immediately.
     175);
     176#else
     177
     178void p_psFree(
     179    void *ptr,                        ///< Pointer to free
     180    const char *file,                 ///< File of call
     181    int lineno                        ///< Line number of call
     182);
    176183
    177184/// Free memory.  psFree sends file and line number to p_psFree.
     
    194201 *  @ingroup memTracing
    195202 */
    196 int psMemCheckLeaks(psMemoryId id0,     ///< don't list blocks with id < id0
    197                     psMemBlock* ** arr, ///< pointer to array of pointers to leaked blocks, or NULL
    198                     FILE * fd   ///< print list of leaks to fd (or NULL)
    199                    );
     203int psMemCheckLeaks(
     204    psMemoryId id0,                    ///< don't list blocks with id < id0
     205    psMemBlock* ** arr,                ///< pointer to array of pointers to leaked blocks, or NULL
     206    FILE * fd                          ///< print list of leaks to fd (or NULL)
     207);
    200208
    201209/** Check for memory corruption.  Scans all currently allocated memory buffers and checks for corruptions,
     
    204212 *  @ingroup memTracing
    205213 */
    206 int psMemCheckCorruption(bool abort_on_error    ///< Abort on detecting corruption?
    207                         );
     214int psMemCheckCorruption(
     215    bool abort_on_error                ///< Abort on detecting corruption?
     216);
    208217
    209218/** Return reference counter
     
    211220 *  @ingroup memRefCount
    212221 */
    213 psReferenceCount psMemGetRefCounter(void *vptr  ///< Pointer to get refCounter for
    214                                    );
     222psReferenceCount psMemGetRefCounter(
     223    void *vptr                         ///< Pointer to get refCounter for
     224);
    215225
    216226/** Increment reference counter and return the pointer
     
    219229 */
    220230#ifdef DOXYGEN
    221 void *psMemIncrRefCounter(void *vptr    ///< Pointer to increment refCounter, and return
    222                          );
    223 #else
    224 
    225 void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
    226                             const char *file,   ///< File of call
    227                             int lineno  ///< Line number of call
    228                            );
     231void *psMemIncrRefCounter(
     232    void *vptr                         ///< Pointer to increment refCounter, and return
     233);
     234#else
     235
     236void *p_psMemIncrRefCounter(
     237    void *vptr,                        ///< Pointer to increment refCounter, and return
     238    const char *file,                  ///< File of call
     239    int lineno                         ///< Line number of call
     240);
    229241
    230242#define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
     
    234246 *
    235247 *  @ingroup memRefCount
    236  */
    237 #ifdef DOXYGEN
    238 void *psMemDecrRefCounter(void *vptr    ///< Pointer to decrement refCounter, and return
    239                          );
    240 #else
    241 
    242 void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
    243                             const char *file,   ///< File of call
    244                             int lineno  ///< Line number of call
    245                            );
     248 *
     249 *  @return void*    the pointer deremented in refCount, or NULL if pointer is
     250 *                   fully dereferenced.
     251 */
     252#ifdef DOXYGEN
     253void* psMemDecrRefCounter(
     254    void* vptr                         ///< Pointer to decrement refCounter, and return
     255);
     256#else
     257
     258void *p_psMemDecrRefCounter(
     259    void *vptr,                        ///< Pointer to decrement refCounter, and return
     260    const char *file,                  ///< File of call
     261    int lineno                         ///< Line number of call
     262);
    246263
    247264#define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
    248265#endif
    249266
    250 /** Set callback for problems
    251  *  @ingroup memCallback
    252  */
    253 psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  ///< Function to run
    254                                             );
    255 
    256 /** Set callback for out-of-memory
    257  *
    258  *  @ingroup memCallback
    259  */
    260 psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    ///< Function to run
    261                                                 );
     267/** Set callback for problems.
     268 *
     269 *  At various occasions, the memory manager can check the state of the memory
     270 *  stack. If any of these checks discover that the memory stack is corrupted,
     271 *  the psMemProblemCallback is called.
     272 
     273 *  @ingroup memCallback
     274 *
     275 *  @return psMemProblemCallback       old psMemProblemCallback function
     276 */
     277psMemProblemCallback psMemProblemCallbackSet(
     278    psMemProblemCallback func          ///< Function to run at memory problem detection
     279);
     280
     281/** Set callback for out-of-memory.
     282 *
     283 *  If not enough memory is available to satisfy a request by psAlloc or
     284 *  psRealloc, these functions attempt to find an alternative solution by
     285 *  calling the psMemExhaustedCallback, a function which may be set by the
     286 *  programmer in appropriate circumstances, rather than immediately fail.
     287 *  The typical use of such a feature may be when a program needs a large
     288 *  chunk of memory to do an operation, but the exact size is not critical.
     289 *  This feature gives the programmer the opportunity to make a smaller
     290 *  request and try again, limiting the size of the operating buffer.
     291 *
     292 *  @ingroup memCallback
     293 *
     294 *  @return psMemExhaustedCallback     old psMemExhaustedCallback function
     295 */
     296psMemExhaustedCallback psMemExhaustedCallbackSet(
     297    psMemExhaustedCallback func        ///< Function to run at memory exhaustion
     298);
    262299
    263300/** Set call back for when a particular memory block is allocated
    264301 *
    265  *  @ingroup memCallback
    266  */
    267 psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       ///< Function to run
    268                                               );
     302 *  A private variable, p_psMemAllocateID, can be used to trace the allocation
     303 *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a
     304 *  memory block with that ID is allocated, psMemAllocateCallback is called
     305 *  just before memory is returned to the calling function.
     306 *
     307 *  @ingroup memCallback
     308 *
     309 *  @return psMemAllocateCallback      old psMemAllocateCallback function
     310 */
     311psMemAllocateCallback psMemAllocateCallbackSet(
     312    psMemAllocateCallback func       ///< Function to run at memory allocation of specific mem block
     313);
    269314
    270315/** Set call back for when a particular memory block is freed
    271316 *
    272  *  @ingroup memCallback
    273  */
    274 psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   ///< Function to run
    275                                       );
     317 *  A private variable, p_psMemFreeID, can be used to trace the freeing of
     318 *  specific memory blocks. If p_psMemFreeID is set and the memory block with
     319 *  the ID is about to be freed, the psMemFreeCallback callback is called just
     320 *  before the memory block is freed.
     321 *
     322 *  @ingroup memCallback
     323 *
     324 *  @return psMemFreeCallback          old psMemFreeCallback function
     325 */
     326psMemFreeCallback psMemFreeCallbackSet(
     327    psMemFreeCallback func             ///< Function to run at memory free of specific mem block
     328);
    276329
    277330/** get next memory ID
    278331 *
    279332 *  @ingroup memCallback
     333 *
     334 *  @return psMemoryId                 the next memory ID to be used
    280335 */
    281336psMemoryId psMemGetId(void);
    282337
    283 /** set p_psMemAllocateID to id
    284  *
    285  *  @ingroup memCallback
    286  */
    287 psMemoryId psMemAllocateCallbackSetID(psMemoryId id     ///< ID to set
    288                                      );
     338/** set p_psMemAllocateID to specific id
     339 *
     340 *  A private variable, p_psMemAllocateID, can be used to trace the allocation
     341 *  and freeing of specific memory blocks. If p_psMemAllocateID is set and a
     342 *  memory block with that ID is allocated, psMemAllocateCallback is called
     343 *  just before memory is returned to the calling function.
     344 *
     345 *  @ingroup memCallback
     346 *
     347 *  @return psMemoryId       
     348 *
     349 *  @see psMemAllocateCallbackSet   
     350 */
     351psMemoryId psMemAllocateCallbackSetID(
     352    psMemoryId id                      ///< ID to set
     353);
    289354
    290355/** set p_psMemFreeID to id
    291356 *
    292  *  @ingroup memCallback
    293  */
    294 psMemoryId psMemFreeCallbackSetID(psMemoryId id ///< ID to set
    295                                  );
     357 *  A private variable, p_psMemFreeID, can be used to trace the freeing of
     358 *  specific memory blocks. If p_psMemFreeID is set and the memory block with
     359 *  the ID is about to be freed, the psMemFreeCallback callback is called just
     360 *  before the memory block is freed.
     361 *
     362 *  @ingroup memCallback
     363 *
     364 *  @return psMemoryId                 the old p_psMemFreeID
     365 *
     366 *  @see psMemFreeCallbackSet
     367 */
     368psMemoryId psMemFreeCallbackSetID(
     369    psMemoryId id                      ///< ID to set
     370);
    296371
    297372//@} End of Memory Management Functions
     
    306381#pragma GCC poison malloc realloc calloc free
    307382#else
    308 #                define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
    309 #                define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
    310 #                define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
    311 #                define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
    312 #            endif
    313 #        endif
    314 
    315 #    endif
     383#define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
     384#define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
     385#define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
     386#define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
     387#endif
     388#endif
     389
     390#endif
    316391// doxygen skip
    317392
  • trunk/psLib/src/sysUtils/psString.h

    r1441 r1448  
    1 
    21/** @file  psString.h
    32 *
     
    1110 *  @author Eric Van Alst, MHPCC
    1211 *
    13  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-09 23:40:55 $
     12 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-10 01:55:34 $
    1514 *
    1615 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2019#define PS_STRING_H
    2120
    22 /******************************************************************************/
    2321
    24 /*  DEFINE STATEMENTS                                                         */
    25 
    26 /******************************************************************************/
    27 
    28 /** This macro will convert the arguement to a quoted string */
     22/** This macro will convert the argument to a quoted string */
    2923#define PS_STRING(S)  #S
    30 
    31 /******************************************************************************/
    32 
    33 /*  TYPE DEFINITIONS                                                          */
    34 
    35 /******************************************************************************/
    36 
    37 // None
    38 
    39 /*****************************************************************************/
    40 
    41 /* FUNCTION PROTOTYPES                                                       */
    42 
    43 /*****************************************************************************/
    4424
    4525// Doxygen group tags
     
    5434 *  plus one and copy the input string to the newly allocated memory.
    5535 *
    56  *  @return  char* Copy of input string
     36 *  @return char*      Copy of input string
    5737 *
    5838 */
    59 
    60 char *psStringCopy(const char *str
    61                    /**< Input string of characters to copy */
    62                   );
     39char *psStringCopy(
     40    const char *str
     41    /**< Input string of characters to copy */
     42);
    6343
    6444/** Copies the input string up to the specified number of characters
     
    7858/*@null@*/
    7959
    80 char *psStringNCopy(const char *str,
    81                     /**< Input string of characters to copy */
     60char *psStringNCopy(
     61    const char *str,
     62    /**< Input string of characters to copy */
    8263
    83                     int nChar
    84                     /**< Number of bytes to allocate for string copy */
    85                    );
     64    int nChar
     65    /**< Number of bytes to allocate for string copy */
     66);
    8667
    8768/* @} */// Doxygen - End of SystemGroup Functions
  • trunk/psLib/src/sysUtils/psType.h

    r1441 r1448  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 23:40:55 $
     13*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-10 01:55:34 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4040 */
    4141
    42 typedef uint8_t psU8;           ///< 8-bit unsigned int
    43 typedef uint16_t psU16;         ///< 16-bit unsigned int
    44 typedef uint32_t psU32;         ///< 32-bit unsigned int
    45 typedef uint64_t psU64;         ///< 64-bit unsigned int
    46 typedef int8_t psS8;            ///< 8-bit signed int
    47 typedef int16_t psS16;          ///< 16-bit signed int
    48 typedef int32_t psS32;          ///< 32-bit signed int
    49 typedef int64_t psS64;          ///< 64-bit signed int
    50 typedef float psF32;            ///< 32-bit floating point
    51 typedef double psF64;           ///< 64-bit floating point
    52 typedef complex float psC32;    ///< complex with 32-bit floating point Real and Imagary numbers
    53 typedef complex double psC64;   ///< complex with 64-bit floating point Real and Imagary numbers
    54 typedef void *psPTR;            ///< void pointer
     42typedef uint8_t psU8;                  ///< 8-bit unsigned int
     43typedef uint16_t psU16;                ///< 16-bit unsigned int
     44typedef uint32_t psU32;                ///< 32-bit unsigned int
     45typedef uint64_t psU64;                ///< 64-bit unsigned int
     46typedef int8_t psS8;                   ///< 8-bit signed int
     47typedef int16_t psS16;                 ///< 16-bit signed int
     48typedef int32_t psS32;                 ///< 32-bit signed int
     49typedef int64_t psS64;                 ///< 64-bit signed int
     50typedef float psF32;                   ///< 32-bit floating point
     51typedef double psF64;                  ///< 64-bit floating point
     52typedef complex float psC32;           ///< complex with 32-bit floating point Real and Imagary numbers
     53typedef complex double psC64;          ///< complex with 64-bit floating point Real and Imagary numbers
     54typedef void *psPTR;                   ///< void pointer
    5555
    5656typedef enum {
    57     PS_TYPE_S8 = 0x0101,        ///< Character.
    58     PS_TYPE_S16 = 0x0102,                  ///< Short integer.
    59     PS_TYPE_S32 = 0x0104,                  ///< Integer.
    60     PS_TYPE_S64 = 0x0108,                  ///< Long integer.
    61     PS_TYPE_U8 = 0x0301,                   ///< Unsigned character.
    62     PS_TYPE_U16 = 0x0302,                  ///< Unsigned short integer.
    63     PS_TYPE_U32 = 0x0304,                  ///< Unsigned integer.
    64     PS_TYPE_U64 = 0x0308,                  ///< Unsigned long integer.
    65     PS_TYPE_F32 = 0x0404,                  ///< Single-precision Floating point.
    66     PS_TYPE_F64 = 0x0408,                  ///< Double-precision floating point.
    67     PS_TYPE_C32 = 0x0808,                  ///< Complex numbers consisting of single-precision floating
    68     // point.
    69     PS_TYPE_C64 = 0x0810,                  ///< Complex numbers consisting of double-precision floating
    70     // point.
    71     PS_TYPE_PTR = 0x0000                   ///< Something else that's not supported for arithmetic.
     57    PS_TYPE_S8 = 0x0101,               ///< Character.
     58    PS_TYPE_S16 = 0x0102,              ///< Short integer.
     59    PS_TYPE_S32 = 0x0104,              ///< Integer.
     60    PS_TYPE_S64 = 0x0108,              ///< Long integer.
     61    PS_TYPE_U8 = 0x0301,               ///< Unsigned character.
     62    PS_TYPE_U16 = 0x0302,              ///< Unsigned short integer.
     63    PS_TYPE_U32 = 0x0304,              ///< Unsigned integer.
     64    PS_TYPE_U64 = 0x0308,              ///< Unsigned long integer.
     65    PS_TYPE_F32 = 0x0404,              ///< Single-precision Floating point.
     66    PS_TYPE_F64 = 0x0408,              ///< Double-precision floating point.
     67    PS_TYPE_C32 = 0x0808,              ///< Complex numbers consisting of single-precision floating point.
     68    PS_TYPE_C64 = 0x0810,              ///< Complex numbers consisting of double-precision floating point.
     69    PS_TYPE_PTR = 0x0000               ///< Something else that's not supported for arithmetic.
    7270} psElemType;
    7371
    74 #define PS_TYPE_MASK PS_TYPE_U8        ///< the psElemType to use for mask image
    75 #define PS_TYPE_MASK_DATA U8           ///< the data member to use for mask image
    76 #define PS_TYPE_MASK_NAME "psU8"
    77 typedef psU8 psMaskType;        ///< the C datatype for a mask image
     72#define PS_TYPE_MASK PS_TYPE_U8        /**< the psElemType to use for mask image */
     73#define PS_TYPE_MASK_DATA U8           /**< the data member to use for mask image */
     74#define PS_TYPE_MASK_NAME "psU8"       /**< the data type for mask as a string */
    7875
    79 #define PS_MIN_S8        INT8_MIN
    80 #define PS_MIN_S16       INT16_MIN
    81 #define PS_MIN_S32       INT32_MIN
    82 #define PS_MIN_S64       INT64_MIN
    83 #define PS_MIN_U8        0
    84 #define PS_MIN_U16       0
    85 #define PS_MIN_U32       0
    86 #define PS_MIN_U64       0
    87 #define PS_MIN_F32       -FLT_MAX
    88 #define PS_MIN_F64       -DBL_MAX
    89 #define PS_MIN_C32       -FLT_MAX
    90 #define PS_MIN_C64       -DBL_MAX
     76typedef psU8 psMaskType;               ///< the C datatype for a mask image
    9177
    92 #define PS_MAX_S8        INT8_MAX
    93 #define PS_MAX_S16       INT16_MAX
    94 #define PS_MAX_S32       INT32_MAX
    95 #define PS_MAX_S64       INT64_MAX
    96 #define PS_MAX_U8        UINT8_MAX
    97 #define PS_MAX_U16       UINT16_MAX
    98 #define PS_MAX_U32       UINT32_MAX
    99 #define PS_MAX_U64       UINT64_MAX
    100 #define PS_MAX_F32       FLT_MAX
    101 #define PS_MAX_F64       DBL_MAX
    102 #define PS_MAX_C32       FLT_MAX
    103 #define PS_MAX_C64       DBL_MAX
     78
     79#define PS_MIN_S8        INT8_MIN      /**< minimum valid psS8 value */
     80#define PS_MIN_S16       INT16_MIN     /**< minimum valid psS16 value */
     81#define PS_MIN_S32       INT32_MIN     /**< minimum valid psS32 value */
     82#define PS_MIN_S64       INT64_MIN     /**< minimum valid psS64 value */
     83#define PS_MIN_U8        0             /**< minimum valid psU8 value */
     84#define PS_MIN_U16       0             /**< minimum valid psU16 value */
     85#define PS_MIN_U32       0             /**< minimum valid psU32 value */
     86#define PS_MIN_U64       0             /**< minimum valid psU64 value */
     87#define PS_MIN_F32       -FLT_MAX      /**< minimum valid psF32 value */
     88#define PS_MIN_F64       -DBL_MAX      /**< minimum valid psF64 value */
     89#define PS_MIN_C32       -FLT_MAX      /**< minimum valid real or imaginary psC32 value */
     90#define PS_MIN_C64       -DBL_MAX      /**< minimum valid real or imaginary psC32 value */
     91
     92#define PS_MAX_S8        INT8_MAX      /**< maximum valid psS8 value */
     93#define PS_MAX_S16       INT16_MAX     /**< maximum valid psS16 value */
     94#define PS_MAX_S32       INT32_MAX     /**< maximum valid psS32 value */
     95#define PS_MAX_S64       INT64_MAX     /**< maximum valid psS64 value */
     96#define PS_MAX_U8        UINT8_MAX     /**< maximum valid psU8 value */
     97#define PS_MAX_U16       UINT16_MAX    /**< maximum valid psU16 value */
     98#define PS_MAX_U32       UINT32_MAX    /**< maximum valid psU32 value */
     99#define PS_MAX_U64       UINT64_MAX    /**< maximum valid psU64 value */
     100#define PS_MAX_F32       FLT_MAX       /**< maximum valid psF32 value */
     101#define PS_MAX_F64       DBL_MAX       /**< maximum valid psF64 value */
     102#define PS_MAX_C32       FLT_MAX       /**< maximum valid real or imaginary psC32 value */
     103#define PS_MAX_C64       DBL_MAX       /**< maximum valid real or imaginary psC32 value */
    104104
    105105/// Macro to get the bad pixel reason code (stored as part of mask value)
Note: See TracChangeset for help on using the changeset viewer.