NCBI C++ ToolKit
|
Type and macro definitions from C toolkit that are not defined in C++ toolkit. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <assert.h>
#include "blast_toolkit.h"
#include <algo/blast/core/blast_export.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | ListNode |
A generic linked list node structure. More... | |
Macros | |
#define | NCBI_INLINE inline |
"inline" seems to work on our remaining in-house compilers (WorkShop, Compaq, ICC, MPW) More... | |
#define | TRUE 1 |
bool replacment for C indicating true. More... | |
#define | FALSE 0 |
bool replacment for C indicating false. More... | |
#define | ASSERT assert |
macro for assert. More... | |
#define | MIN(a, b) ((a)>(b)?(b):(a)) |
returns smaller of a and b. More... | |
#define | MAX(a, b) ((a)>=(b)?(a):(b)) |
returns larger of a and b. More... | |
#define | ABS(a) ((a)>=0?(a):-(a)) |
returns absolute value of a (|a|) More... | |
#define | SIGN(a) ((a)>0?1:((a)<0?-1:0)) |
return +1 for a > 0, -1 for a < 0 More... | |
#define | UINT4_MAX 4294967295U |
largest number represented by unsigned int. More... | |
#define | INT4_MAX 2147483647 |
largest nubmer represented by signed int More... | |
#define | INT4_MIN (-2147483647-1) |
Smallest (most negative) number represented by signed int. More... | |
#define | NCBIMATH_LN2 0.69314718055994530941723212145818 |
natural log of 2. More... | |
#define | INT2_MAX 32767 |
largest number represented by signed (two byte) short More... | |
#define | INT2_MIN (-32768) |
smallest (most negative) number represented by signed (two byte) short More... | |
#define | INT1_MAX 127 |
largest number represented by signed short (one byte) More... | |
#define | INT1_MIN (-128) |
smallest (most negative) number represented by signed short (one byte) More... | |
#define | DIM(A) (sizeof(A)/sizeof((A)[0])) |
dimension of an array. More... | |
#define | NULLB '\0' |
terminating byte of a char* string. More... | |
#define | NCBI_CONST_INT8(v) v##LL |
64-bit integers More... | |
#define | NCBI_CONST_UINT8(v) v##ULL |
Typedefs | |
typedef Uint1 | Boolean |
bool replacment for C More... | |
typedef struct ListNode | ListNode |
A generic linked list node structure. More... | |
Functions | |
void * | BlastMemDup (const void *orig, size_t size) |
Copies memory using memcpy and malloc. More... | |
ListNode * | ListNodeNew (ListNode *vnp) |
Create a new list node. More... | |
ListNode * | ListNodeAdd (ListNode **head) |
Add a node to the list. More... | |
ListNode * | ListNodeAddPointer (ListNode **head, Uint1 choice, void *value) |
Add a node to the list with a given choice and data pointer. More... | |
ListNode * | ListNodeFree (ListNode *vnp) |
Free all list's nodes, does not attempt to free data. More... | |
ListNode * | ListNodeFreeData (ListNode *vnp) |
Free nodes as well as data (vnp->ptr) assuming it is one contiguous chunk. More... | |
ListNode * | ListNodeCopyStr (ListNode **head, Uint1 choice, const char *str) |
Add a node to the list with a provided choice, and attached data pointing to a provided string. More... | |
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
Definition in file ncbi_std.h.
returns absolute value of a (|a|)
Definition at line 122 of file ncbi_std.h.
#define ASSERT assert |
macro for assert.
Definition at line 107 of file ncbi_std.h.
dimension of an array.
Definition at line 176 of file ncbi_std.h.
#define FALSE 0 |
bool replacment for C indicating false.
Definition at line 101 of file ncbi_std.h.
#define INT1_MAX 127 |
largest number represented by signed short (one byte)
Definition at line 166 of file ncbi_std.h.
#define INT1_MIN (-128) |
smallest (most negative) number represented by signed short (one byte)
Definition at line 171 of file ncbi_std.h.
#define INT2_MAX 32767 |
largest number represented by signed (two byte) short
Definition at line 156 of file ncbi_std.h.
#define INT2_MIN (-32768) |
smallest (most negative) number represented by signed (two byte) short
Definition at line 161 of file ncbi_std.h.
#define INT4_MAX 2147483647 |
largest nubmer represented by signed int
Definition at line 141 of file ncbi_std.h.
#define INT4_MIN (-2147483647-1) |
Smallest (most negative) number represented by signed int.
Definition at line 146 of file ncbi_std.h.
returns larger of a and b.
Definition at line 117 of file ncbi_std.h.
returns smaller of a and b.
Definition at line 112 of file ncbi_std.h.
#define NCBI_CONST_INT8 | ( | v | ) | v##LL |
64-bit integers
Definition at line 195 of file ncbi_std.h.
#define NCBI_CONST_UINT8 | ( | v | ) | v##ULL |
Definition at line 196 of file ncbi_std.h.
#define NCBI_INLINE inline |
"inline" seems to work on our remaining in-house compilers (WorkShop, Compaq, ICC, MPW)
Definition at line 81 of file ncbi_std.h.
#define NCBIMATH_LN2 0.69314718055994530941723212145818 |
natural log of 2.
Definition at line 151 of file ncbi_std.h.
#define NULLB '\0' |
terminating byte of a char* string.
Definition at line 181 of file ncbi_std.h.
return +1 for a > 0, -1 for a < 0
Definition at line 127 of file ncbi_std.h.
#define TRUE 1 |
bool replacment for C indicating true.
Definition at line 97 of file ncbi_std.h.
#define UINT4_MAX 4294967295U |
largest number represented by unsigned int.
Definition at line 136 of file ncbi_std.h.
bool replacment for C
Definition at line 94 of file ncbi_std.h.
void* BlastMemDup | ( | const void * | orig, |
size_t | size | ||
) |
Copies memory using memcpy and malloc.
orig | memory to be copied [in] |
size | amount to be copied [in] |
Definition at line 35 of file ncbi_std.c.
References copy(), malloc(), NULL, orig, and ncbi::grid::netcache::search::fields::size.
Referenced by Blast_HSPClone(), Blast_SetPHIPatternInfo(), Blast_TracebackFromHSPList(), BlastQueryInfoDup(), BlastScoringOptionsDup(), BlastSeqSrcCopy(), BlastSequenceBlkCopy(), BlastSetUp_MaskQuery(), BOOST_AUTO_TEST_CASE(), DynamicSGenCodeNodeArray_Append(), s_BlastHSPCopy(), s_GetNuclValuesArray(), s_PHIScoreBlkFill(), s_SetupSequencesForGappedReevaluateTest(), s_SetupSequencesForUngappedReevaluateNucl(), s_SetupSequencesForUngappedReevaluateTransl(), SPHIQueryInfoCopy(), CBlastOptionsLocal::x_Copy_CBlastDatabaseOptions(), CBlastOptionsLocal::x_Copy_CBlastEffectiveLengthsOptions(), CBlastOptionsLocal::x_Copy_CBlastExtensionOptions(), CBlastOptionsLocal::x_Copy_CBlastHitSavingOptions(), CBlastOptionsLocal::x_Copy_CBlastInitialWordOptions(), CBlastOptionsLocal::x_Copy_CLookupTableOptions(), CBlastOptionsLocal::x_Copy_CPSIBlastOptions(), and CBlastOptionsLocal::x_Copy_CQuerySetUpOptions().
Add a node to the list.
head | Pointer to the start of the list, if *head is NULL will be Pointer to new node. [in] [out] |
Definition at line 77 of file ncbi_std.c.
References head, ListNodeNew(), and NULL.
Referenced by ListNodeAddPointer(), and ListNodeCopyStr().
Add a node to the list with a given choice and data pointer.
head | Pointer to the start of the list, if *head is NULL will be Pointer to new node. [in] [out] |
choice | Choice value for the new node. [in] |
value | Data pointer for the new node. [in] |
Definition at line 99 of file ncbi_std.c.
References ListNode::choice, head, ListNodeAdd(), NULL, ListNode::ptr, and rapidjson::value.
Referenced by BlastLoadMatrixValues().
Add a node to the list with a provided choice, and attached data pointing to a provided string.
head | Pointer to the start of the list, if *head is NULL will be Pointer to new node. [in] [out] |
choice | sets the "choice" field in ListNode [in] |
str | char* buffer to be copied [in] |
Definition at line 124 of file ncbi_std.c.
References ListNode::choice, head, ListNodeAdd(), NULL, ListNode::ptr, str(), and strdup.
Referenced by BlastScoreBlkNucleotideMatrixRead(), and BlastScoreBlkProteinMatrixRead().
Free all list's nodes, does not attempt to free data.
vnp | objects to be freed [in] |
Definition at line 148 of file ncbi_std.c.
References ListNode::next, next(), NULL, and sfree.
Referenced by BlastMatrixValuesDestruct().
Free nodes as well as data (vnp->ptr) assuming it is one contiguous chunk.
vnp | objects to be freed [in] |
Definition at line 169 of file ncbi_std.c.
References ListNode::next, next(), NULL, ListNode::ptr, and sfree.
Referenced by BlastScoreBlkFree().
Create a new list node.
vnp | Pointer to the start of the list, may be NULL [in] |
Definition at line 55 of file ncbi_std.c.
References calloc(), ListNode::next, and NULL.
Referenced by ListNodeAdd().