gnDefs.h Source File

Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# gnDefs.h

Go to the documentation of this file.

    00001
    00002 // File:            gn/gnDefs.h
    00003 // Purpose:         Defines common constants in libGenome.
    00004 // Description:     Defines, consts, typedef etc for libGenome
    00005 // Rev:             A
    00006 // Author:          Aaron Darling
    00007 // Last Edited:     April 15, 2001, 10:34:50pm
    00008 // Modified by:
    00009 // Copyright:       (c) Aaron Darling
    00010 // Licenses:        Proprietary
    00012 #ifndef _gnDefs_h_
    00013 #define _gnDefs_h_
    00014
    00015 #ifdef __GNUG__
    00016     #pragma interface "gn/gnDefs.h"
    00017 #endif
    00018
    00019 #include <limits.h>
    00020 #include <float.h>
    00021 #include "gn/gnSetup.h"
    00022
    00023 // bool
    00024 typedef unsigned char        boolean;
    00025 typedef unsigned char        int1;
    00026 // signed
    00027 typedef signed char          int8;
    00028 typedef signed short int     int16;
    00029 typedef signed int           int32;
    00030 typedef signed long long     int64;
    00031 typedef signed char          sint8;
    00032 typedef signed short int     sint16;
    00033 typedef signed int           sint32;
    00034 typedef signed long int      sint64;
    00035 // unsigned
    00036 typedef unsigned char        uint8;
    00037 typedef unsigned short int   uint16;
    00038 typedef unsigned int         uint32;
    00039 typedef unsigned long long   uint64;
    00040 // float
    00041 typedef float                float32;
    00042 typedef double               float64;
    00043
    00044 // defines
    00045 #define TRUE                 1
    00046 #define FALSE                0
    00047 #define PI                   3.1415926535897932384626433832795028
    00048
    00049 #define BOOLEAN_MIN              0
    00050 #define BOOLEAN_MAX          1
    00051 #define INT0_MIN                 0
    00052 #define INT1_MAX             1
    00053
    00054 #define INT8_BYTE_SIZE       1
    00055 #define INT16_BYTE_SIZE      2
    00056 #define INT32_BYTE_SIZE      4
    00057 #define INT64_BYTE_SIZE      8
    00058
    00059 #define INT8_BIT_SIZE        8
    00060 #define INT16_BIT_SIZE       16
    00061 #define INT32_BIT_SIZE       32
    00062 #define INT64_BIT_SIZE       64
    00063
    00064 #define UINT8_BYTE_SIZE      1
    00065 #define UINT16_BYTE_SIZE     2
    00066 #define UINT32_BYTE_SIZE     4
    00067 #define UINT64_BYTE_SIZE     8
    00068
    00069 #define UINT8_BIT_SIZE       8
    00070 #define UINT16_BIT_SIZE      16
    00071 #define UINT32_BIT_SIZE      32
    00072 #define UINT64_BIT_SIZE      64
    00073
    00074 // limits.h
    00075 #define INT8_MIN             SCHAR_MIN   //0x00
    00076 #define INT8_MAX             SCHAR_MAX   //0x7f
    00077 #define INT16_MIN            SHRT_MIN    //0x0000
    00078 #define INT16_MAX            SHRT_MAX    //0x7fff
    00079 #define INT32_MIN            INT_MIN     //0x0000000
    00080 #define INT32_MAX            INT_MAX     //0x7fffffff
    00081 #define INT64_MIN            LONG_MIN    //0x0000000000000000
    00082 #define INT64_MAX            LONG_MAX    //0x7fffffffffffffff
    00083
    00084 #define UINT8_MIN            0           //0x00
    00085 #define UINT8_MAX            UCHAR_MAX   //0xff
    00086 #define UINT16_MIN           0           //0x0000
    00087 #define UINT16_MAX           USHRT_MAX   //0xffff
    00088 #define UINT32_MIN           0           //0x00000000
    00089 #define UINT32_MAX           UINT_MAX    //0xffffffff
    00090 #define UINT64_MIN           0           //0x0000000000000000
    00091 #define UINT64_MAX           ULONG_MAX   //0xffffffffffffffff
    00092
    00093 // float.h
    00094 #define FLOAT32_MIN          FLT_MIN
    00095 #define FLOAT32_MAX          FLT_MAX
    00096 #define FLOAT32_MIN_EXP      FLT_MIN_EXP
    00097 #define FLOAT32_MAX_EXP      FLT_MAX_EXP
    00098 #define FLOAT32_MIN_10_EXP   FLT_MIN_10_EXP
    00099 #define FLOAT32_MAX_10_EXP   FLT_MAX_10_EXP
    00100 #define FLOAT32_DIGIT        FLT_DIG
    00101 #define FLOAT32_RADIX        FLT_RADIX
    00102 #define FLOAT32_MIN_FRACTION FLT_EPSILON
    00103
    00104 #define FLOAT64_MIN          DBL_MIN
    00105 #define FLOAT64_MAX          DBL_MAX
    00106 #define FLOAT64_MIN_EXP      DBL_MIN_EXP
    00107 #define FLOAT64_MAX_EXP      DBL_MAX_EXP
    00108 #define FLOAT64_MIN_10_EXP   DBL_MIN_10_EXP
    00109 #define FLOAT64_MAX_10_EXP   DBL_MAX_10_EXP
    00110 #define FLOAT64_DIGIT        DBL_DIG
    00111 #define FLOAT64_RADIX        DBL_RADIX
    00112 #define FLOAT64_MIN_FRACTION DBL_EPSILON
    00113
    00114 // Sequence Types
    00115 typedef char                            gnSeqC;         // Sequence Character
    00116 typedef uint32                          gnSeqI;         // Sequence Index
    00117
    00118 #define GNSEQI_ERROR            UINT32_MAX      // return value
    00119 #define GNSEQI_END                      UINT32_MAX      // argument value
    00120 #define GNSEQI_BEGIN            UINT32_MIN      // argument value
    00121 #define GNSEQC_NULL                     0
    00122 #define GNSEQC_MIN                      INT8_MIN
    00123 #define GNSEQC_MAX                      INT8_MAX
    00124
    00125
    00126 #define CONTIG_SECTION_SIZE 3
    00127 enum gnContigSection{
    00128         gnContigHeader = 0,
    00129         gnContigAnnotation = 1,
    00130         gnContigSequence = 2
    00131 };
    00132
    00133 enum gnNewlineType{
    00134         gnNewlineUnix = 0,
    00135         gnNewlineWindows = 1,
    00136         gnNewlineMac = 2
    00137 };
    00138
    00139 static const uint32 ALL_CONTIGS = UINT32_MAX;
    00140 static const uint32 BUFFER_SIZE = 100000;
    00141
    00142 #endif
    00143         //_gnDefs_h_