inc/common.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <strings.h>
#include <fcntl.h>
#include <assert.h>
#include <setjmp.h>
#include <time.h>
#include <math.h>
#include <errno.h>
#include <unistd.h>
#include <libgen.h>

Include dependency graph for common.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  slList
struct  slInt
struct  slDouble
struct  slName
struct  slRef
struct  slPair

Defines

#define _LARGEFILE_SOURCE   1
#define _FILE_OFFSET_BITS   64
#define NAN   (0.0 / 0.0)
#define WIFEXITED(stat)   (((*((int *) &(stat))) & 0xff) == 0)
#define WEXITSTATUS(stat)   (short)(((*((int *) &(stat))) >> 8) & 0xffff)
#define WIFSIGNALED(stat)   (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) &0x00ff)))
#define WTERMSIG(stat)   ((*((int *) &(stat))) & 0x7f)
#define WIFSTOPPED(stat)   (((*((int *) &(stat))) & 0xff) == 0177)
#define WSTOPSIG(stat)   (((*((int *) &(stat))) >> 8) & 0xff)
#define HUGE   MAXFLOAT
#define TRUE   1
#define FALSE   0
#define boolean   int
#define bool   char
#define UBYTE   unsigned char
#define BYTE   signed char
#define UWORD   unsigned short
#define WORD   short
#define bits64   unsigned long long
#define bits32   unsigned
#define bits16   unsigned short
#define bits8   unsigned char
#define signed32   int
#define bits8   unsigned char
#define BIGNUM   0x3fffffff
#define LIMIT_2or8GB   (2147483647 * ((sizeof(size_t)/4)*(sizeof(size_t)/4)))
#define LIMIT_2or6GB
#define PATH_LEN   512
#define INLINE   static inline
#define va_copy(to, from)   ((to) = (from))
#define ptrToLL(p)   ((long long)((size_t)p))
#define ArraySize(a)   (sizeof(a)/sizeof((a)[0]))
#define uglyf   printf
#define uglyAbort   errAbort
#define uglyOut   stdout
#define CloneVar(pt)   cloneMem(pt, sizeof((pt)[0]))
#define AllocVar(pt)   (pt = needMem(sizeof(*pt)))
#define AllocArray(pt, size)   (pt = needLargeZeroedMem(sizeof(*pt) * (size)))
#define AllocA(type)   needMem(sizeof(type))
#define AllocN(type, count)   ((type*)needLargeZeroedMem(sizeof(type) * (count)))
#define ExpandArray(array, oldCount, newCount)   (array = needMoreMem((array), (oldCount)*sizeof((array)[0]), (newCount)*sizeof((array)[0])))
#define CopyArray(source, dest, count)   memcpy(dest,source,(count)*sizeof(dest[0]))
#define CloneArray(a, count)   cloneMem(a, (count)*sizeof(a[0]))
#define internalErr()   errAbort("Internal error %s %d", __FILE__, __LINE__)
#define ZeroVar(v)   zeroBytes(v, sizeof(*v))
#define slAddHead(listPt, node)   ((node)->next = *(listPt), *(listPt) = (node))
#define newSlInt   slIntNew
#define newSlDouble   slDoubleNew
#define slNameNew   newSlName
#define slNameFree   freez
#define slNameFreeList   slFreeList
#define slNameListFromComma(s)   slNameListFromString(s, ',')
#define sameWord(a, b)   (!differentWord(a,b))
#define differentString(a, b)   (strcmp(a,b))
#define sameOk(a, b)   (differentStringNullOk(a,b) == 0)
#define sameString(a, b)   (strcmp(a,b)==0)
#define sameStringN(a, b, c)   (strncmp(a,b,c)==0)
#define isEmpty(string)   (string == NULL || string[0] == 0)
#define isNotEmpty(string)   (! isEmpty(string))
#define stringIn(needle, haystack)   strstr(haystack, needle)
#define chopLine(line, words)   chopByWhite(line, words, ArraySize(words))
#define chopTabs(string, words)   chopByChar(string, '\t', words, ArraySize(words))
#define chopCommas(string, words)   chopByChar(string, ',', words, ArraySize(words))
#define stringIx(string, array)   stringArrayIx( (string), (array), ArraySize(array))
#define SEEK_SET   0
#define SEEK_CUR   1
#define SEEK_END   2
#define writeOne(file, var)   mustWrite((file), &(var), sizeof(var))
#define mustReadOne(file, var)   mustRead((file), &(var), sizeof(var))
#define readOne(file, var)   (fread(&(var), sizeof(var), 1, (file)) == 1)
#define logBase2(x)   (log(x)/log(2))
#define round(a)   ((int)((a)+0.5))
#define roundll(a)   ((long long)((a)+0.5))
#define min(a, b)   ( (a) < (b) ? (a) : (b) )
#define max(a, b)   ( (a) > (b) ? (a) : (b) )
#define INFINITY   (1.0/0.0)

Typedefs

typedef int CmpFunction (const void *elem1, const void *elem2)

Functions

void * needMem (size_t size)
void * needLargeMem (size_t size)
void * needLargeZeroedMem (size_t size)
void * needLargeMemResize (void *vp, size_t size)
void * needLargeZeroedMemResize (void *vp, size_t oldSize, size_t newSize)
void * needHugeMem (size_t size)
void * needHugeZeroedMem (size_t size)
void * needHugeMemResize (void *vp, size_t size)
void * needHugeZeroedMemResize (void *vp, size_t oldSize, size_t newSize)
void * needMoreMem (void *old, size_t copySize, size_t newSize)
void * cloneMem (void *pt, size_t size)
void * wantMem (size_t size)
void freeMem (void *pt)
void freez (void *ppt)
void errAbort (char *format,...)
void errnoAbort (char *format,...)
void warn (char *format,...)
void verbose (int verbosity, char *format,...)
void verboseDot ()
int verboseLevel ()
void verboseSetLevel (int verbosity)
void zeroBytes (void *vpt, int count)
void reverseBytes (char *bytes, long length)
void reverseInts (int *a, int length)
void reverseUnsigned (unsigned *a, int length)
void reverseDoubles (double *a, int length)
void reverseStrings (char **a, int length)
void swapBytes (char *a, char *b, int length)
int slCount (void *list)
void * slElementFromIx (void *list, int ix)
int slIxFromElement (void *list, void *el)
void slSafeAddHead (void *listPt, void *node)
void slAddTail (void *listPt, void *node)
void * slPopHead (void *listPt)
void * slPopTail (void *listPt)
void * slCat (void *a, void *b)
void * slLastEl (void *list)
void slReverse (void *listPt)
void slSort (void *pList, CmpFunction *compare)
void slUniqify (void *pList, CmpFunction *compare, void(*free)())
boolean slRemoveEl (void *vpList, void *vToRemove)
void slFreeList (void *listPt)
slIntslIntNew (int x)
int slIntCmp (const void *va, const void *vb)
int slIntCmpRev (const void *va, const void *vb)
void doubleSort (int count, double *array)
double doubleMedian (int count, double *array)
slDoubleslDoubleNew (double x)
int slDoubleCmp (const void *va, const void *vb)
double slDoubleMedian (struct slDouble *list)
void intSort (int count, int *array)
int intMedian (int count, int *array)
slNamenewSlName (char *name)
slNameslNameNewN (char *name, int size)
int slNameCmpCase (const void *va, const void *vb)
int slNameCmp (const void *va, const void *vb)
void slNameSortCase (struct slName **pList)
void slNameSort (struct slName **pList)
boolean slNameInList (struct slName *list, char *string)
void * slNameFind (void *list, char *string)
int slNameFindIx (struct slName *list, char *string)
char * slNameStore (struct slName **pList, char *string)
slNameslNameAddHead (struct slName **pList, char *name)
slNameslNameAddTail (struct slName **pList, char *name)
slNameslNameCloneList (struct slName *list)
slNameslNameListFromString (char *s, char delimiter)
slNameslNameLoadReal (char *fileName)
slRefslRefNew (void *val)
slRefrefOnList (struct slRef *refList, void *val)
void refAdd (struct slRef **pRefList, void *val)
void refAddUnique (struct slRef **pRefList, void *val)
slRefrefListFromSlList (void *list)
slPairslPairNew (char *name, void *val)
void slPairAdd (struct slPair **pList, char *name, void *val)
void slPairFree (struct slPair **pEl)
void slPairFreeList (struct slPair **pList)
void slPairFreeVals (struct slPair *list)
void slPairFreeValsAndList (struct slPair **pList)
slPairslPairFind (struct slPair *list, char *name)
void * slPairFindVal (struct slPair *list, char *name)
void gentleFree (void *pt)
char * cloneStringZ (char *s, int size)
char * cloneString (char *s)
char * cloneLongString (char *s)
int differentWord (char *s1, char *s2)
int differentStringNullOk (char *a, char *b)
boolean startsWith (char *start, char *string)
boolean startsWithWord (char *firstWord, char *line)
char * rStringIn (char *needle, char *haystack)
char * stringBetween (char *start, char *end, char *haystack)
boolean endsWith (char *string, char *end)
char lastChar (char *s)
boolean wildMatch (char *wildCard, char *string)
char * memMatch (char *needle, int nLen, char *haystack, int hLen)
void toUpperN (char *s, int n)
void toLowerN (char *s, int n)
void toggleCase (char *s, int size)
void touppers (char *s)
void tolowers (char *s)
char * replaceChars (char *string, char *oldStr, char *newStr)
void subChar (char *s, char oldChar, char newChar)
void stripChar (char *s, char c)
void stripString (char *s, char *strip)
int countChars (char *s, char c)
int countCharsN (char *s, char c, int size)
int countLeadingChars (char *s, char c)
int countSame (char *a, char *b)
int chopString (char *in, char *sep, char *outArray[], int outSize)
int chopByWhite (char *in, char *outArray[], int outSize)
int chopByChar (char *in, char chopper, char *outArray[], int outSize)
char * skipLeadingSpaces (char *s)
char * skipToSpaces (char *s)
void eraseTrailingSpaces (char *s)
void eraseWhiteSpace (char *s)
char * trimSpaces (char *s)
void spaceOut (FILE *f, int count)
void starOut (FILE *f, int count)
boolean hasWhiteSpace (char *s)
char * firstWordInLine (char *line)
char * lastWordInLine (char *line)
char * nextWord (char **pLine)
char * nextTabWord (char **pLine)
int stringArrayIx (char *string, char *array[], int arraySize)
int ptArrayIx (void *pt, void *array, int arraySize)
void splitPath (char *path, char dir[256], char name[128], char extension[64])
char * addSuffix (char *head, char *suffix)
void chopSuffix (char *s)
void chopSuffixAt (char *s, char c)
char * chopPrefix (char *s)
char * chopPrefixAt (char *s, char c)
FILE * mustOpen (char *fileName, char *mode)
void mustWrite (FILE *file, void *buf, size_t size)
void mustRead (FILE *file, void *buf, size_t size)
void writeString (FILE *f, char *s)
char * readString (FILE *f)
char * mustReadString (FILE *f)
boolean fastReadString (FILE *f, char buf[256])
void writeBits64 (FILE *f, bits64 x)
bits64 readBits64 (FILE *f)
void carefulClose (FILE **pFile)
boolean carefulCloseWarn (FILE **pFile)
char * firstWordInFile (char *fileName, char *wordBuf, int wordBufSize)
int roundingScale (int a, int p, int q)
int intAbs (int a)
int rangeIntersection (int start1, int end1, int start2, int end2)
int positiveRangeIntersection (int start1, int end1, int start2, int end2)
bits32 byteSwap32 (bits32 a)
void removeReturns (char *dest, char *src)
int intExp (char *text)
double doubleExp (char *text)
char * readLine (FILE *fh)
off_t fileSize (char *fileName)
boolean fileExists (char *fileName)
char * containsStringNoCase (char *haystack, char *needle)
char * strstrNoCase (char *haystack, char *needle)
int vasafef (char *buffer, int bufSize, char *format, va_list args)
int safef (char *buffer, int bufSize, char *format,...)
void safecpy (char *buf, size_t bufSize, const char *src)
void safencpy (char *buf, size_t bufSize, const char *src, size_t n)
void safecat (char *buf, size_t bufSize, const char *src)
void safencat (char *buf, size_t bufSize, const char *src, size_t n)
char * naForNull (char *s)
char * naForEmpty (char *s)
char * emptyForNull (char *s)
char * nullIfAllSpace (char *s)
char * trueFalseString (boolean b)
void uglyTime (char *label,...)
void makeDirs (char *path)
char * skipNumeric (char *s)
char * skipToNumeric (char *s)
char * splitOffNonNumeric (char *s)
char * splitOffNumber (char *db)

Variables

char crLfChopper []
char whiteSpaceChopper []


Define Documentation

#define _FILE_OFFSET_BITS   64

Definition at line 22 of file common.h.

#define _LARGEFILE_SOURCE   1

Definition at line 14 of file common.h.

#define AllocA ( type   )     needMem(sizeof(type))

Definition at line 239 of file common.h.

Referenced by dlAddValAfter(), dlAddValBefore(), dlAddValHead(), dlAddValTail(), initMimeBuf(), and parseMultiParts().

#define AllocArray ( pt,
size   )     (pt = needLargeZeroedMem(sizeof(*pt) * (size)))

Definition at line 237 of file common.h.

Referenced by aliLines(), bfGraphFromRangeGraph(), binKeeperNew(), cgiFromFile(), chainToPsl(), clumpHits(), dnaMotifCommaIn(), gapCalcRead(), gfClientFileArray(), gfIndexNibsAndTwoBits(), gfIndexTransNibsAndTwoBits(), gfLargeIndexSeq(), gfSmallIndexSeq(), histoGram(), kdTreeMake(), pcrClumps(), phhmTraceToAxt(), pslCommaIn(), pslFromFakeFfAli(), pslNew(), pslTrimToQueryRange(), pslTrimToTargetRange(), readBlockCoords(), slDoubleMedian(), spacedSeedOffsets(), sqlByteDynamicArray(), sqlCharDynamicArray(), sqlDoubleDynamicArray(), sqlFloatDynamicArray(), sqlLongLongDynamicArray(), sqlShortDynamicArray(), sqlSignedDynamicArray(), sqlStringDynamicArray(), sqlUbyteDynamicArray(), sqlUnsignedDynamicArray(), sqlUshortDynamicArray(), ssGraphMake(), trixNew(), twoBitFromDnaSeq(), twoBitOutNBeds(), twoBitSeqSizeNoNs(), twoBitSpecNew(), urlOkChars(), and xAliCommaIn().

#define AllocN ( type,
count   )     ((type*)needLargeZeroedMem(sizeof(type) * (count)))

Definition at line 242 of file common.h.

Referenced by newQuickHeap().

#define AllocVar ( pt   )     (pt = needMem(sizeof(*pt)))

Definition at line 233 of file common.h.

Referenced by addExtraHits(), addToBigBundleList(), alignComponents(), apacheAccessLogParse(), asParseColDef(), asParseTableDef(), axtAddBlocksToBoxInList(), axtFromBlocks(), axtReadWithPos(), axtScoreSchemeDefault(), axtScoreSchemeFromProteinText(), axtScoreSchemeReadLf(), axtScoreSchemeSimpleDna(), bfGraphFromRangeGraph(), binKeeperAdd(), binKeeperNew(), blastFileNextGapped(), blastFileNextQuery(), blastFileOpenVerify(), boxFindClumps(), bundleIntoTargets(), cdaAliFromFfAli(), cdaLoadOne(), cfmNew(), cgiParseInputAbort(), cgiParseMultipart(), cgiVarSet(), chainReadBlocks(), chainReadChainLine(), chainSubsetOnQ(), chainToPsl(), clumpHits(), clumpNear(), clumpToExactRange(), clumpToHspRange(), codonLoadBias(), colHashNew(), correlateNew(), crudeAliFind(), dgAddNode(), dgConnectWithVal(), dgConstrainedPriorityOrder(), dgFindPath(), dgFindSubEdges(), dgNew(), dnaLoadNextFromStack(), dnaLoadOpen(), dnaLoadStackNew(), dnaMotifCommaIn(), errCatchNew(), faReadAllMixableInLf(), faReadNamedSeq(), fastMapClumpsToBundles(), ffAliFromSym(), ffFindExtendNmers(), ffSeedExtInMem(), fillInExact(), findMultipleWordHits(), findOrMakeVar(), fofOpen(), foldInExtras(), forwardMergeTwo(), gapCalcRead(), gfAlignSomeClumps(), gfAlignStrand(), gfAlignTrans(), gfAlignTransTrans(), gfClumpsToBundles(), gffFileAddRow(), gffFileNew(), gfFindAlignAaTrans(), gfNewEmpty(), gfOutputAxtMem(), gfOutputInit(), gfOutputPsl(), gfPcrGetRanges(), gfPcrInputLoad(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfRangeLoad(), gfRangesBundle(), gfRangesToFfItem(), gfTransTransFindBundles(), gfWebConfigRead(), gfxPolyAddPoint(), gfxPolyNew(), hardRefineSplice(), histoGram(), hpfNext(), htmlCookieFileRead(), htmlFormVarSet(), htmlPageParse(), htmlPageParseNoHead(), htmlParseForms(), htmlStatusParse(), htmlTagScan(), keyExpParse(), letterProbNew(), lineFileAttach(), lineFileOnString(), lineFileSetMetaDataOutput(), lumpOneDimension(), mafFromAxt(), mafMayOpen(), mafNextWithPos(), mafSubsetE(), makeFastProber(), memTrackerStart(), mergeContigs(), netHttpLineFileMayOpen(), newClump(), newDlList(), newDyString(), newKvt(), newPatSpace(), newQuickHeap(), newSlName(), nextBlock(), nextSeqFromMem(), nibInfoNew(), nibInput(), nibStreamOpen(), nibTwoCacheNew(), parseAndExp(), parseAttribute(), parseCookie(), parseCookies(), parseElement(), parseGtfEnd(), parseIdent(), parseNot(), parseOrExp(), parseRelation(), parseSeqSpec(), parseSubTree(), pcrClumps(), pcrLocalStrand(), peelChains(), phhmTraceToAxt(), phmmMatrixNew(), phmmTraceBack(), pipelineNew(), plProcNew(), pscmOpen(), pslCommaIn(), pslFromAlign(), pslFromFakeFfAli(), pslLoad(), pslNew(), pslTblNew(), pslToFakeFfAli(), pslToFfAli(), pslTrimToQueryRange(), pslTrimToTargetRange(), psOpen(), psPolyAddPoint(), psPolyNew(), qaStatusOnPage(), rbTreeNewDetailed(), refAdd(), repeatMaskOutCommaIn(), repeatMaskOutLoad(), rFindConnected(), rudpNew(), saveAxtBundle(), seqClumpToRangeList(), slDoubleNew(), slIntNew(), slPairNew(), slRefNew(), spacedColumnFromSample(), spacedColumnFromWidthArray(), spaceSaverAddOverflow(), spaceSaverMaxCellsNew(), ssFindBundles(), ssGraphMake(), ssStitch(), subTextNew(), synQueueNew(), tabRowGuessFixedOffsets(), targetClump(), tokenizerOnLineFile(), trans3New(), translateSeqN(), trixNew(), trixParseHitList(), trixSearch(), trixSearchWordResults(), twoBitFromDnaSeq(), twoBitFromFile(), twoBitOpen(), twoBitReadSeqFragExt(), twoBitSpecNew(), twoBitSpecNewFile(), validateTables(), vgHalfInit(), vgOpenGif(), wormCdaAlisInRange(), xAliCommaIn(), xAliLoad(), xapNew(), xaReadNext(), xpNew(), and xStitch().

#define ArraySize (  )     (sizeof(a)/sizeof((a)[0]))

Definition at line 169 of file common.h.

Referenced by axtScoreSchemeReadLf(), binFromRangeBinKeeperExtended(), binFromRangeExtended(), binFromRangeStandard(), binKeeperAnyOverlap(), binKeeperFind(), binKeeperFindLowest(), binKeeperReplaceVal(), binLevels(), binLevelsExtended(), binOffset(), binOffsetExtended(), calcGcRatio(), doGetSeq(), faFastReadNext(), faReadMixedNext(), findLowType(), flyChromNames(), flyFreeNt4Genome(), flyLoadNt4Genome(), gffOpen(), gfOutputAny(), hardRefineSplice(), htmlPageValidateOrAbort(), initAaVal(), initNtLookup(), initNtVal(), isTxType(), kvtParseAdd(), loadPsls(), mafNextWithPos(), makeSnofName(), mgSetDefaultColorMap(), netParseSubnet(), nextBlock(), parseElement(), parsePasvPort(), parseRestOfCdnaInfo(), pscmSetDefaultColorMap(), readPslToBinKeeper(), rudpTest(), spacedSeedMaxWeight(), spacedSeedOffsets(), trixParseHitList(), wormChromForIx(), wormChromNames(), wormChromSize(), wormFreeNt4Genome(), wormGeneToOrfNames(), wormLoadNt4Genome(), wormParseChromRange(), xapNew(), xaReadNext(), xpFree(), xpNew(), xpParseNext(), and xStitch().

#define BIGNUM   0x3fffffff

Definition at line 117 of file common.h.

Referenced by boxFindClumps(), chainFastSubsetOnT(), chainSubsetOnQ(), findOrderedSpan(), findUnorderedSpan(), gfNewEmpty(), and ssFindBestBig().

#define bits16   unsigned short

Definition at line 112 of file common.h.

Referenced by checkSizeTypes(), fofMake(), fofOpen(), gfAddLargeSeq(), gfAllocLargeLists(), gfSegmentedFindHits(), gfSegmentedFindNearHits(), makeHits8(), and packDna8().

#define bits32   unsigned

Definition at line 111 of file common.h.

Referenced by bCmpSeqSource(), byteSwap32(), cdaCreate(), cdaOpenVerify(), checkSizeTypes(), clumpHits(), clumpNear(), cmpRecList(), fofMake(), fofOpen(), gfAddLargeSeq(), gfAddSeq(), gfAllocLargeLists(), gfAllocLists(), gfCountSeq(), gfFastFindDnaHits(), gfIndexNibsAndTwoBits(), gfIndexTransNibsAndTwoBits(), gfLargeIndexSeq(), gfMakeOoc(), gfSegmentedFindHits(), gfSegmentedFindNearHits(), gfSmallIndexSeq(), gfStraightFindHits(), gfStraightFindNearHits(), gfZeroNonOverused(), gfZeroOverused(), hashCrc(), internetHostIp(), loadNt4(), makeHits16(), makeHits8(), maskSimplePepRepeat(), newNt4(), nibInput(), nibOpenVerify(), nibOutput(), nibStreamClose(), nt4BaseCount(), nt4LoadPart(), nt4OpenVerify(), oocMaskCounts(), oocMaskSimpleRepeats(), packDna16(), pcrClumps(), readBits32(), readBlockCoords(), saveNt4(), scanChromOffsetFile(), twoBitFromFile(), twoBitOpen(), twoBitOutNBeds(), twoBitReadSeqFragExt(), twoBitSeqSizeNoNs(), twoBitWriteHeader(), unalignedUnpackDna(), unpackDna(), wormCacheSomeGdf(), wormCdaAlisInRange(), xaIxOpenVerify(), and xaRdRange().

#define bits64   unsigned long long

Definition at line 110 of file common.h.

Referenced by readBits64().

#define bits8   unsigned char

Definition at line 115 of file common.h.

#define bits8   unsigned char

Definition at line 115 of file common.h.

#define bool   char

Definition at line 101 of file common.h.

#define boolean   int

Definition at line 98 of file common.h.

#define BYTE   signed char

Definition at line 107 of file common.h.

#define chopCommas ( string,
words   )     chopByChar(string, ',', words, ArraySize(words))

Definition at line 736 of file common.h.

#define chopLine ( line,
words   )     chopByWhite(line, words, ArraySize(words))

Definition at line 727 of file common.h.

Referenced by axtScoreSchemeFromProteinText(), blastFileNextGapped(), blastFileOpenVerify(), codonLoadBias(), convertEpsToPdf(), findAltSpliceRange(), gfQuerySeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), main(), maskFromOut(), nextBlock(), parseBlockLine(), parseDatabaseLines(), parseQueryLines(), pslNext(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), wormGeneForOrf(), wormGeneRange(), xaReadNext(), and xStitch().

#define chopTabs ( string,
words   )     chopByChar(string, '\t', words, ArraySize(words))

Definition at line 733 of file common.h.

Referenced by gffFileAdd(), and gffHasGtfGroup().

#define CloneArray ( a,
count   )     cloneMem(a, (count)*sizeof(a[0]))

Definition at line 252 of file common.h.

#define CloneVar ( pt   )     cloneMem(pt, sizeof((pt)[0]))

Definition at line 216 of file common.h.

Referenced by binKeeperFind(), chainFastSubsetOnT(), chainSubsetOnQ(), cloneDnaSeq(), and hashElListHash().

#define CopyArray ( source,
dest,
count   )     memcpy(dest,source,(count)*sizeof(dest[0]))

Definition at line 249 of file common.h.

Referenced by sqlByteDynamicArray(), sqlCharDynamicArray(), sqlDoubleDynamicArray(), sqlFloatDynamicArray(), sqlLongLongDynamicArray(), sqlShortDynamicArray(), sqlSignedDynamicArray(), sqlStringDynamicArray(), sqlUbyteDynamicArray(), sqlUnsignedDynamicArray(), and sqlUshortDynamicArray().

#define differentString ( a,
 )     (strcmp(a,b))

Definition at line 608 of file common.h.

Referenced by listDir(), listDirX(), and main().

#define ExpandArray ( array,
oldCount,
newCount   )     (array = needMoreMem((array), (oldCount)*sizeof((array)[0]), (newCount)*sizeof((array)[0])))

Definition at line 245 of file common.h.

Referenced by cgiFromFile(), expandQuickHeap(), pslGrow(), sqlByteStaticArray(), sqlCharStaticArray(), sqlDoubleStaticArray(), sqlFloatStaticArray(), sqlLongLongStaticArray(), sqlShortStaticArray(), sqlSignedStaticArray(), sqlStringStaticArray(), sqlUbyteStaticArray(), sqlUnsignedStaticArray(), sqlUshortStaticArray(), and trixAddToIxx().

#define FALSE   0

Definition at line 97 of file common.h.

Referenced by _gffGetLine(), _gffSeekDna(), _gffSeekDoubleSharpLine(), alignComponents(), allClear(), allSameCluster(), allStartBy(), anyTwrDone(), asParseColDef(), autoScale(), axtAddBlocksToBoxInList(), axtBlastOut(), axtCheck(), axtScoreSchemeReadLf(), axtScoreSym(), axtScoreSymFilterRepeats(), axtSubsetOnT(), badPcrPrimerSeq(), bandExt(), bandExtFf(), base64Validate(), bestMerger(), bfCheckGraph(), bfSkipBlankLines(), bigBlat(), binKeeperAnyOverlap(), binKeeperFindLowest(), bitFindClear(), blastFileNextBlock(), blastiodAxtOutput(), blat(), boxLump(), canAdd(), carefulCloseWarn(), cdaCoalesceFast(), cfmNew(), cfmOut(), cgiFromCommandLine(), cgiFromFile(), cgiMakeTextArea(), cgiParseInput(), chainReadAll(), chainReadAllWithMeta(), chainRemovePartialOverlaps(), checkWordCount(), chromIx(), clearHits(), clumpToExactRange(), clumpToHspRange(), clusterEncompassedBefore(), codonLoadBias(), contigEncompassedBefore(), contigsOverlap(), countBlocksOfLower(), countBlocksOfN(), countGapOpens(), debugAbort(), dgClearConnFlags(), dgClearVisitFlags(), dgConnectedComponents(), dgConstrainedPriorityOrder(), dgFindNewConnected(), dgFindNextConnected(), dgHasCycles(), dgParentsAllVisited(), differentStringNullOk(), dnaMotifIsScoreBased(), dnaUtilOpen(), doBlat(), doubleExp(), earlyWarningHandler(), emblRecord(), endsWith(), errCatchFinish(), exactFind(), expandAlis(), expandThroughNLeft(), expandThroughNRight(), faFastReadNext(), faMixedSpeedReadNext(), faNextSeqFromMemTextRaw(), faPepSpeedReadNext(), faReadAa(), faReadAllMixed(), faReadAllMixedInLf(), faReadAllPep(), faReadAllSeq(), faReadAllSeqMixable(), faReadMixedNext(), faSomeSpeedReadNext(), fastMapClumpsToBundles(), fastReadString(), ffFindAndScore(), ffFindGoodOligo(), ffNextBreak(), ffScore(), ffSeedExtInMem(), ffShAli(), ffShAliPart(), ffShNeedle(), ffSlideOrientedIntrons(), findAltSpliceRange(), findBestAli(), findImprobableOligo(), findSymIx(), flyCdnaSeq(), fofFind(), fofFindFirst(), fofSearch(), gapNotMasked(), geneDna(), genoFindDirect(), genoPcrDirect(), getWormGeneDna(), getWormGeneExonDna(), gfAlignSomeClumps(), gfAlignStrand(), gfAlignTrans(), gfAlignTransTrans(), gfClient(), gfClientFileArray(), gfClumpsToBundles(), gffHasGtfGroup(), gfFindAlignAaTrans(), gffNextDnaLine(), gffOpen(), gffOpenAndRead(), gffReadDna(), gffReadGenes(), gfIndexNibsAndTwoBits(), gfMakeOoc(), gfOutputAny(), gfPcrOneViaNet(), gfTransTransFindBundles(), hasRepeat(), hasWhiteSpace(), headPolyTSizeLoose(), histoGram(), htmlDoEscape(), htmlPageFromForm(), htmlPageValidateOrAbort(), htmlSlurpWithCookies(), htmlTagScan(), initNtChars(), initNtLookup(), initNtMixedCaseChars(), initWormDnaMatchScores(), internetDottedQuadToIp(), internetFillInAddress(), internetIpInSubnet(), internetIpToDottedQuad(), internetIsDottedQuad(), isAllAlpha(), isAllDigit(), isAllDna(), isAllLower(), isAllUpper(), isGtfGroup(), isKozak(), isMimeEncoded(), isMonotonic(), isTxType(), jiggleSmallExons(), jpegSize(), keyTextScan(), kxTokenize(), kxTokenizeFancy(), leftNextMatch(), lineFileNext(), lineFileNextCharRow(), lineFileNextReal(), lineFileNextRow(), lineFileNextRowTab(), lineFileParseHttpHeader(), lineFileSeek(), listDir(), listDirX(), lumpExonsIntoGenes(), lumpHitsIntoExons(), mafColumnEmpty(), mafMayFindAllComponents(), mafSubset(), main(), makeDir(), makeGoodTile(), makeSnofName(), mapBlock(), maskHeadPolyT(), maskTailPolyA(), mergeIntoAdjacentClusters(), mgDrawLine(), mgPutSeg(), mgSaveToGif(), mixedCaseName(), mysqlHost(), netGetOpenFtp(), netHttpGetMultiple(), netSendHugeString(), netSendLongString(), netSendString(), netSkipHttpHeaderLines(), nextBlock(), nextBlockLine(), nextLine(), nextWormCdnaAndInfo(), nibIsRange(), oocMaskCounts(), optionHash(), optionInit(), parseAnOption(), parseGtfEnd(), parseMultiParts(), parseQuotedString(), parseRestOfCdnaInfo(), parseSeqSpec(), peelChains(), phmmPrintTrace(), phyloPrintTree(), pipelineDumpCmds(), pslCheck(), pslFromAlign(), pslHasIntron(), pslShowAlignmentStranded2(), pslxFileOpenWithMeta(), pslxFileOpenWithMetaConfig(), quotedPrintableDecode(), removeFromQuickHeapByElem(), removeNegativeBlocks(), rHasCycles(), rightNextMatch(), rnaPair(), rPathExists(), rwFindTilesBetween(), sameFileContents(), saveAxtBundle(), savePslx(), scanForSmallerExons(), scanForTinyInternal(), scoreAli(), searchOne(), searchOneProt(), seekAllToId(), seqIsLower(), setCurrentDir(), slNameInList(), slRemoveEl(), smoothOneGap(), smoothSmallGaps(), snofDupeOkIndex(), snofFindFirstStartingWith(), snofFindOffset(), snofMakeIndex(), snofSearch(), spacedColumnParseLine(), spaceSaverAdd(), sqlSetParse(), ssStitch(), startServer(), startsWith(), startsWithWord(), storeBlocksOfLower(), storeBlocksOfN(), tailPolyASizeLoose(), tokenizerNext(), totalDegenerateN(), tradeMismatchToCloseSpliceGap(), trans3Frame(), trans3New(), trixSearch(), twoBitOpen(), twoBitParseRange(), twoBitReadSeqFragLower(), ucaseMatch(), validateTables(), verboseDotsEnabled(), verboseSetLevel(), vgNextItemButton(), warnAboutDupes(), wildMatch(), wormCdnaInfo(), wormCdnaSeq(), wormFixupOrfName(), wormGeneForOrf(), wormGeneRange(), wormInfoForGene(), wormIsAltSplicedName(), wormIsGeneName(), wormIsNamelessCluster(), wormParseChromRange(), wuBlastOut(), xenAlignBig(), xenAlignWorm(), xenStitcher(), xmlBlastOut(), and xpParseNext().

#define HUGE   MAXFLOAT

Definition at line 91 of file common.h.

#define INFINITY   (1.0/0.0)

Definition at line 993 of file common.h.

Referenced by autoScale().

#define INLINE   static inline

Definition at line 134 of file common.h.

 
#define internalErr (  )     errAbort("Internal error %s %d", __FILE__, __LINE__)

Definition at line 269 of file common.h.

Referenced by clumpTargetName(), clumpToExactRange(), clumpToHspRange(), dnaMotifBitsOfInfo(), dnaMotifSequenceProb(), fchar_width(), findTileSize(), getHitsFromServer(), gfTypeName(), skipFile(), trans3Find(), and whichSeqIn().

#define isEmpty ( string   )     (string == NULL || string[0] == 0)

Definition at line 629 of file common.h.

Referenced by cgiOptionalInt(), and textOutInit().

#define isNotEmpty ( string   )     (! isEmpty(string))

Definition at line 630 of file common.h.

#define LIMIT_2or6GB

Value:

(2147483647 + (2147483647 * ((sizeof(size_t)/4)-1)) + \
        (2147483647 * ((sizeof(size_t)/4)-1)))

Definition at line 121 of file common.h.

#define LIMIT_2or8GB   (2147483647 * ((sizeof(size_t)/4)*(sizeof(size_t)/4)))

Definition at line 119 of file common.h.

#define logBase2 (  )     (log(x)/log(2))

Definition at line 887 of file common.h.

Referenced by dnaMotifBitScore(), and u1().

#define max ( a,
 )     ( (a) > (b) ? (a) : (b) )

Definition at line 902 of file common.h.

Referenced by axtPrintTraditional(), calcDigitCount(), contigsOverlap(), ffMergeClose(), forwardMergeTwo(), gdfGeneExtents(), gfPcrOneViaNet(), kdBuild(), parseBlockLine(), rangeIntersection(), rangeTreeAdd(), replaceChars(), saveAxtBundle(), scoreWindow(), trimAlignment(), xaRdRange(), and xStitch().

#define min ( a,
 )     ( (a) < (b) ? (a) : (b) )

Definition at line 897 of file common.h.

Referenced by bandExtAfter(), bandExtBefore(), calcLooseGap(), calcTightGap(), chainConnectCost(), chainRemovePartialOverlaps(), contigsOverlap(), extendExactLeft(), extendExactRight(), extendGaplessLeft(), extendGaplessRight(), extendHitLeft(), extendHitRight(), ffMergeClose(), fillInExact(), findMaxOverlap(), findOverlap(), forwardMergeTwo(), gdfGeneExtents(), gfPcrOneViaNet(), htmlPrintJointAlignment(), parseBlockLine(), pslCalcMilliBad(), pslTailSizes(), rangeIntersection(), rangeTreeAdd(), xaRdRange(), and xStitch().

#define mustReadOne ( file,
var   )     mustRead((file), &(var), sizeof(var))

Definition at line 839 of file common.h.

Referenced by cdaLoadOne(), cdaOpenVerify(), cdaReadBlock(), fofOpen(), gdfReadOneGene(), loadNt4(), nibOpenVerify(), nt4BaseCount(), nt4LoadPart(), nt4OpenVerify(), oocMaskCounts(), readBits32(), scanChromOffsetFile(), twoBitOpen(), wormCacheSomeGdf(), wormCdaAlisInRange(), xaIxOpenVerify(), and xaRdRange().

#define NAN   (0.0 / 0.0)

Definition at line 63 of file common.h.

Referenced by histoGram().

#define newSlDouble   slDoubleNew

Definition at line 442 of file common.h.

#define newSlInt   slIntNew

Definition at line 418 of file common.h.

#define PATH_LEN   512

Definition at line 126 of file common.h.

Referenced by dnaLoadSingle(), getTargetName(), gfAlignStrand(), gfAlignTrans(), gfAlignTransTrans(), gfiExpandAndLoadCached(), gfIndexNibsAndTwoBits(), gfIndexTransNibsAndTwoBits(), gfPcrOneViaNet(), makeDirs(), nibInfoFromCache(), nibLoadAllMasked(), readSeqFrag(), rTempName(), semiUniqName(), and trixOpen().

#define ptrToLL (  )     ((long long)((size_t)p))

Definition at line 166 of file common.h.

Referenced by carefulCheckHeap(), carefulFree(), and dgAddNode().

#define readOne ( file,
var   )     (fread(&(var), sizeof(var), 1, (file)) == 1)

Definition at line 842 of file common.h.

Referenced by cdaLoadString(), fastReadString(), oocMaskCounts(), readString(), wormCdaAlisInRange(), and xaRdRange().

#define round (  )     ((int)((a)+0.5))

Definition at line 890 of file common.h.

Referenced by blastzScoreToNcbiBits(), blastzScoreToNcbiScore(), convertEpsToPdf(), gfClient(), intExp(), isDna(), main(), makeMatchTable(), makeWobbleMatchTable(), milliMatchScore(), ncbiBlastOut(), outputBed(), psFloatOut(), pslCalcMilliBad(), roundingScale(), scaledLog(), scaledLogOfFraction(), slog(), spaceSaverAddOverflow(), transitionCost(), wuBlastOut(), and xaReadNext().

#define roundll (  )     ((long long)((a)+0.5))

Definition at line 893 of file common.h.

#define sameOk ( a,
 )     (differentStringNullOk(a,b) == 0)

Definition at line 620 of file common.h.

Referenced by parseMultiParts().

#define sameString ( a,
 )     (strcmp(a,b)==0)

Definition at line 623 of file common.h.

Referenced by aliLines(), apacheAccessLogParse(), axtScoreSchemeReadLf(), bigBlat(), blastFileNextGapped(), cgiFromFile(), cgiParseMultipart(), cgiStringList(), chainReadChainLine(), clusterEncompassedBefore(), codonLoadBias(), contigEncompassedBefore(), countTagsOfType(), emblRecord(), endsWith(), faReadNamedSeq(), fileExists(), findAltSpliceRange(), findOrderedSpan(), findTileSize(), findUnorderedSpan(), fofBatchFind(), fofMake(), gapCalcFromFile(), gfClientFileArray(), gfFindNamedSource(), gfPcrGetRanges(), gfQuerySeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfRangesBundle(), gfWebConfigRead(), gfWebFindServer(), hashRemove(), hpfFindResultInModel(), htmlHeaderRead(), kvtGet(), lineFileMayOpen(), lineFileParseHttpHeader(), listDir(), mafMayFindComponent(), mafMayOpen(), mafNextWithPos(), mafWrite(), matchingOption(), mergeIntoAdjacentClusters(), mgLoadGif(), mustOpen(), netGetOpenFtp(), netHttpConnect(), netHttpGet(), netHttpLineFileMayOpen(), netSkipHttpHeaderLines(), netSkipHttpHeaderLinesCatch(), optionInt(), optionLongLong(), parseAttribute(), parseBlockLine(), parseCookie(), parseElement(), parseEntity(), parseFacility(), parseGtfEnd(), parseMultiParts(), parseOptions(), parseRestOfCdnaInfo(), pcrServer(), phyloFindName(), pscmSetHint(), pslTransMap(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), queryServer(), raFoldInOneRetName(), readPartHeaderMB(), rkeyEval(), seekAllPastId(), slNameFindIx(), slNameStore(), slPairFind(), ssFindBundles(), startServer(), statusServer(), trixSearch(), verboseDotsEnabled(), verboseSetLogFile(), xapNext(), xapParseAny(), xaReadNext(), xpParseEndTag(), xpParseNext(), and xStitch().

#define sameStringN ( a,
b,
 )     (strncmp(a,b,c)==0)

Definition at line 626 of file common.h.

#define sameWord ( a,
 )     (!differentWord(a,b))

Definition at line 605 of file common.h.

Referenced by _cgiFindInput(), appendMimeVar(), asParseTableDef(), axtBlastOut(), cgiMakeDropListClass(), cgiMakeDropListFull(), cgiMakeDropListWithVals(), cgiMakeMultList(), cgiOneChoice(), checkNest(), cleanEnvVars(), doBlat(), doDetailLine(), dtdParse(), findLowType(), findObType(), findOrMakeVar(), formParseVars(), getCompressor(), getCompressSuffix(), getStrand(), gfOutputAny(), gfPcrOutputWriteList(), gfTypeFromName(), gfWebConfigRead(), htmlAttributeFindVal(), htmlFormCgiVars(), htmlFormGet(), htmlFormVarGet(), htmlPageFromForm(), htmlPageScanAttribute(), htmlPageValidateOrAbort(), htmlParseForms(), isMimeEncoded(), isMixableInputType(), isTxType(), main(), maskNucSeqList(), mustFindColumn(), netParseUrl(), netSkipHttpHeaderLines(), nextBlock(), parseAttribute(), readTaggedNumLine(), rkeyEval(), searchOneMaskTrim(), setupWss(), slNameFind(), slNameInList(), textOutInit(), tokenizerMustMatch(), validateBody(), and validateTables().

#define SEEK_CUR   1

Definition at line 794 of file common.h.

Referenced by nt4LoadPart(), and twoBitReadSeqFragExt().

#define SEEK_END   2

Definition at line 798 of file common.h.

Referenced by fileSize(), and snofOpen().

#define SEEK_SET   0

Definition at line 790 of file common.h.

Referenced by faReadMixedNext(), findAltSpliceRange(), flyCdnaSeq(), fofBatchFind(), fofFetch(), fofFetchString(), fofFindFirst(), fofOpen(), fofSearch(), lineFileSeek(), mafRewind(), nibInput(), nibStreamClose(), snofNameAtIx(), snofSearch(), trixSearchWordResults(), twoBitSeekTo(), twoBitTotalSize(), wormCdaAlisInRange(), wormCdnaInfo(), wormCdnaSeq(), wormGeneRange(), wormGetSomeGdfGene(), wormGetSomeGdfGeneList(), and xaRdRange().

#define signed32   int

Definition at line 114 of file common.h.

#define slAddHead ( listPt,
node   )     ((node)->next = *(listPt), *(listPt) = (node))

Definition at line 349 of file common.h.

Referenced by addBaseProb(), addToBigBundleList(), alignComponents(), aliLines(), asParseColDef(), axtAddBlocksToBoxInList(), bfGraphFromRangeGraph(), binKeeperAdd(), binKeeperFind(), binKeeperRemove(), blastFileNextGapped(), blastFileNextQuery(), blastFileReadAll(), boxFindClumps(), bundleIntoTargets(), cgiParseInputAbort(), cgiParseMultipart(), cgiStringList(), chainBlocks(), chainMergeAbutting(), chainReadBlocks(), chainSubsetOnQ(), chainToAxt(), charSepToSlNames(), clumpHits(), clumpNear(), clumpToExactRange(), clumpToHspRange(), colHashAdd(), crudeAliFind(), dgAddNode(), dgConnectWithVal(), dgConstrainedPriorityOrder(), dgFindPath(), dgFindSubEdges(), dgRemoveFromConList(), dgSwapEdges(), dlListToSlList(), dnaLoadAll(), dnaLoadNextFromStack(), dtdParse(), errCatchPushHandlers(), faReadAllMixableInLf(), faSeqListFromMemText(), faSeqListFromMemTextRaw(), fastMapClumpsToBundles(), ffFindExtendNmers(), ffSeedExtInMem(), findMultipleWordHits(), findOrMakeVar(), fofMake(), foldInExtras(), getHitsFromServer(), gfClumpsToBundles(), gfFastFindDnaHits(), gffFileAddRow(), gffGroupLines(), gfPcrGetRanges(), gfPcrInputLoadAll(), gfQuerySeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfRangesBundle(), gfSegmentedFindHits(), gfSegmentedFindNearHits(), gfStraightFindHits(), gfStraightFindNearHits(), gfTransTransFindBundles(), hashElListHash(), htmlCookieFileRead(), htmlFormVarSet(), htmlPageScanAttribute(), htmlParseForms(), htmlTagScan(), kxTokenizeFancy(), lineFileSetMetaDataOutput(), listDir(), listDirX(), loadHashT3Ranges(), loadPsl(), lumpOneDimension(), mafFromAxt(), mafFromAxtTemp(), mafMoveComponentToTop(), mafNextWithPos(), mafReadAll(), mafSubsetE(), mergeHits(), parseCookies(), parseElement(), parseGtfEnd(), parseMultiParts(), pcrClumps(), pcrLocalStrand(), peelChains(), phmmTraceBack(), pslLoadAll(), pushMemHandler(), rangeListAdd(), rBoxJoin(), readAllLines(), refAdd(), refListFromSlList(), removeNegativeBlocks(), rFindConnected(), saveAxtBundle(), scanChromOffsetFile(), seqClumpToRangeList(), seqListToTrans3List(), slNameAddHead(), slNameCloneList(), slNameListFromString(), slNameStore(), slPairAdd(), slRemoveEl(), slUniqify(), spacedColumnFromSample(), spacedColumnFromWidthArray(), spaceSaverAddOverflow(), ssFindBestBig(), ssFindBundles(), ssGraphMake(), ssStitch(), stringToSlNames(), tabRowByChar(), tabRowByFixedOffsets(), tabRowByWhite(), tabRowGuessFixedOffsets(), targetClump(), trixParseHitList(), trixSearch(), twoBitFromFile(), twoBitOpen(), twoBitSeqNames(), validateTables(), wormCdaAlisInRange(), wormGdfGenesInRange(), xAliLoadAll(), xaRdRange(), and xStitch().

#define slNameFree   freez

Definition at line 471 of file common.h.

#define slNameFreeList   slFreeList

Definition at line 474 of file common.h.

#define slNameListFromComma (  )     slNameListFromString(s, ',')

Definition at line 523 of file common.h.

#define slNameNew   newSlName

Definition at line 468 of file common.h.

Referenced by asParseColSymSpec(), charSepToSlNames(), htmlFormVarAddValue(), htmlPageScanAttribute(), slNameAddHead(), slNameAddTail(), slNameCloneList(), slNameListFromString(), slNameLoadReal(), stringToSlNames(), and twoBitSeqNames().

#define stringIn ( needle,
haystack   )     strstr(haystack, needle)

Definition at line 639 of file common.h.

Referenced by blastFileNextQuery(), dyStringSub(), eatComment(), htmlTagScan(), netParseUrl(), netUrlOpen(), qaCountBetween(), qaStringBetween(), stringBetween(), and tokenizerNext().

#define stringIx ( string,
array   )     stringArrayIx( (string), (array), ArraySize(array))

Definition at line 786 of file common.h.

Referenced by wormChromIx().

#define TRUE   1

Definition at line 96 of file common.h.

Referenced by _gffGetLine(), _gffSeekDna(), _gffSeekDoubleSharpLine(), alignComponents(), aliLines(), allClear(), allSameCluster(), allStartBy(), anyTwrDone(), asParseColArraySpec(), asParseFile(), asParseTableDef(), asParseText(), autoScale(), axtBlastOut(), axtCheck(), axtScoreSchemeRead(), axtScoreSchemeReadLf(), axtScoreSym(), axtScoreSymFilterRepeats(), axtSubsetOnT(), axtTransPosToQ(), badPcrPrimerSeq(), bandExt(), base64Validate(), bfCheckGraph(), bfSkipBlankLines(), bigBlat(), binKeeperAnyOverlap(), binKeeperFindLowest(), bitFindSet(), bitsInByteInit(), blastFileOpenVerify(), blastiodAxtOutput(), blat(), boxLump(), canAdd(), carefulCloseWarn(), cdaCoalesceBlocks(), cgiFromCommandLine(), cgiFromFile(), cgiParseInput(), cgiSpoof(), chainReadAllWithMeta(), chainReadUsedSwap(), chainRemovePartialOverlaps(), checkWordCount(), clumpToExactRange(), clumpToHspRange(), clusterEncompassedBefore(), codonLoadBias(), contigEncompassedBefore(), contigsOverlap(), convertEpsToPdf(), countGapOpens(), countWordsInFile(), dgConnectedComponentsWithVals(), dgConstrainedPriorityOrder(), dgFindNewConnectedWithVals(), dgFindNextConnectedWithVals(), dgHasCycles(), dgParentsAllVisited(), dnaLoadNextFromStack(), dnaLoadStackNew(), dnaLoadStackOrSingle(), dnaMotifIsScoreBased(), dnaUtilOpen(), doBlat(), dtdParse(), dyStringVaPrintf(), earlyWarningHandler(), emblOpen(), emblRecord(), errCatchAbortHandler(), errCatchFinish(), errCatchPushHandlers(), exactFind(), expandAlis(), expandThroughNLeft(), expandThroughNRight(), faFastReadNext(), faFromMemText(), faMixedSpeedReadNext(), faNextSeqFromMemText(), faNextSeqFromMemTextRaw(), faReadAllDna(), faReadAllMixed(), faReadAllMixedInLf(), faReadDna(), faReadMixedNext(), faReadNamedSeq(), faSomeSpeedReadNext(), faSpeedReadNext(), fastMapClumpsToBundles(), fastReadString(), ffFindAndScore(), ffFindGoodOligo(), ffMergeClose(), ffNextBreak(), ffScoreProtein(), ffSeedExtInMem(), ffShAli(), ffShAliPart(), ffShNeedle(), ffSlideOrientedIntrons(), fileExists(), findAltSpliceRange(), findImprobableOligo(), findSymIx(), flyCdnaSeq(), fofFindFirst(), fofSearch(), foldInExtras(), gapCalcFromFile(), gapCalcFromString(), gapNotMasked(), geneDna(), genoFindDirect(), getLineMB(), getMimeHeaderFieldVal(), getMimeHeaderMainVal(), getOurAck(), getWormGeneDna(), getWormGeneExonDna(), gfAlignAaClumps(), gfAlignTrans(), gfAlignTransTrans(), gfClient(), gfClientFileArray(), gffFileAdd(), gffFileAddRow(), gffHasGtfGroup(), gfFindAlignAaTrans(), gffNextDnaLine(), gffOpen(), gffOpenAndRead(), gffReadDna(), gffReadGenes(), gfIndexTransNibsAndTwoBits(), gfOutputAny(), gfPcrInputLoadAll(), gfPipeHandler(), gfTransTransFindBundles(), gfWebConfigRead(), hardRefineSplice(), hashNameIntFile(), hashTwoColumnFile(), hashWordsInFile(), hasRepeat(), hasWhiteSpace(), headPolyTSizeLoose(), histoGram(), htmlCookieFileRead(), htmlFormCgiVars(), htmlNoEscape(), htmlPageValidateOrAbort(), htmlSetBgColor(), htmlSetCookie(), htmlTagScan(), initNtChars(), initNtCompTable(), initNtLookup(), initNtMixedCaseChars(), initNtVal(), initWormDnaMatchScores(), internetDottedQuadToIp(), internetFillInAddress(), internetIpInSubnet(), internetIpToDottedQuad(), internetIsDottedQuad(), isAllAlpha(), isAllDigit(), isAllDna(), isAllLower(), isAllUpper(), isGtfGroup(), isKozak(), isMimeEncoded(), isMonotonic(), isTxType(), jiggleSmallExons(), jpegSize(), keyExpParse(), keyTextScan(), kxTokenizeFancy(), leftNextMatch(), lineFileNext(), lineFileNextCharRow(), lineFileNextReal(), lineFileNextRow(), lineFileNextRowTab(), lineFileParseHttpHeader(), lineFileReuse(), lineFileSetUniqueMetaData(), listDir(), listDirX(), loadHashT3Ranges(), loadPsls(), logOpenSyslog(), lumpExonsIntoGenes(), lumpHitsIntoExons(), mafColumnEmpty(), mafMayFindAllComponents(), mafMayOpen(), mafSubsetE(), main(), makeDir(), makeGoodTile(), makeSnofName(), mapBlock(), maskFromOut(), maskHeadPolyT(), maskTailPolyA(), medianVal(), mergeIntoAdjacentClusters(), mgFillUnder(), mgPutSegZeroClear(), mgSaveToGif(), mixedCaseName(), mysqlHost(), ncbiBlastOut(), netBlockBrokenPipes(), netGetOpenFtp(), netGetOpenHttp(), netHttpGetMultiple(), netHttpLineFileMayOpen(), netLineFileMayOpen(), netLineFileMayOpenCatchError(), netSendHugeString(), netSendLongString(), netSendString(), netSkipHttpHeaderLines(), netSkipHttpHeaderLinesCatch(), netUrlHead(), nextBlock(), nextBlockLine(), nextLine(), nextWormCdna(), nextWormCdnaAndInfo(), nibTwoCacheSeqPart(), oocMaskCounts(), parseAnOption(), parseAttribute(), parseCookie(), parseCookies(), parseGtfEnd(), parseMultiParts(), parseQuotedString(), parseRestOfCdnaInfo(), parseSeqSpec(), parseSubTree(), peelChains(), phmmPrintTrace(), phyloOpenTree(), phyloPrintTreeNoDups(), pipelineDumpCmds(), pipelineLineFile(), pslCheck(), pslFromAlign(), pslHasIntron(), pslShowAlignmentStranded(), pslShowAlignmentStranded2(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), pslxFileOpenWithUniqueMeta(), qaStatusOnPage(), quickHeapBalanceWithChildren(), quotedPrintableDecode(), raFoldIn(), raReadAll(), raReadSingle(), readAllLines(), readPartHeaderMB(), readPslToBinKeeper(), refineSmallExons(), refineSpliceSites(), removeFromQuickHeapByElem(), removeNegativeBlocks(), rFindConnected(), rHasCycles(), rightNextMatch(), rkeyEval(), rnaPair(), rPathExists(), rTopoSort(), sameFileContents(), saveAxtBundle(), savePslx(), scanForSmallerExons(), scoreAli(), searchOne(), searchOneIndex(), seekAllToId(), seqIsLower(), setCurrentDir(), slNameInList(), slNameLoadReal(), slRemoveEl(), smoothOneGap(), smoothSmallGaps(), snofFindFirstStartingWith(), snofFindOffset(), snofSearch(), spacedColumnFromFile(), spacedColumnParseLine(), spaceSaverAddOverflow(), sqlEnumParse(), ssStitch(), startsWith(), tailPolyASizeLoose(), tokenizerNew(), tokenizerNext(), tokenizerReuse(), totalDegenerateN(), tradeMismatchToCloseSpliceGap(), transTripleSearch(), tripleSearch(), trixOpen(), trixSearch(), twoBitOpen(), twoBitParseRange(), twoBitReadSeqFrag(), twoBitSpecNewFile(), ucaseMatch(), useTempFile(), validateTables(), verboseDotsEnabled(), vgMgMethods(), vgNextItemButton(), warnAboutDupes(), wildMatch(), wormCdnaInfo(), wormCdnaSeq(), wormFixupOrfName(), wormGeneForOrf(), wormInfoForGene(), wormIsNamelessCluster(), wormParseChromRange(), wormSearchAllCdna(), wuBlastOut(), xAliLoadAll(), xenStitch(), xpParseNext(), and xStitch().

#define UBYTE   unsigned char

Definition at line 106 of file common.h.

Referenced by affineAlign(), bandExt(), byteSwap32(), cdaLoadOne(), cdaLoadString(), cdaRcOne(), cdaWriteOne(), cdaWriteString(), checkSizeTypes(), cmpRecList(), compress_data(), decoder(), drawAfterOnOff(), fastReadString(), fofMake(), fofOpen(), gdfReadOneGene(), gfText(), gif_decoder(), leftGood(), mgTextBlit(), mgTextBlitSolid(), netGetHugeString(), netGetLongString(), netGetString(), netSendHugeString(), netSendLongString(), netSendString(), nibOutput(), nibStreamOne(), oocMaskCounts(), packDna4(), phmmFindMommy(), phmmTraceBack(), readBits64(), readString(), rightGood(), twoBitFromDnaSeq(), twoBitReadSeqFragExt(), unpackDna4(), validateCgiUrl(), write_code(), writeBits64(), writeString(), xenAlignSmall(), xor_pt(), and y_xor_line().

#define uglyAbort   errAbort

Definition at line 172 of file common.h.

#define uglyf   printf

Definition at line 171 of file common.h.

Referenced by bandExt(), clumpHits(), doHelp(), and startServer().

#define uglyOut   stdout

Definition at line 173 of file common.h.

Referenced by bandExt().

#define UWORD   unsigned short

Definition at line 108 of file common.h.

Referenced by gif_decoder().

#define va_copy ( to,
from   )     ((to) = (from))

Definition at line 159 of file common.h.

Referenced by dyStringVaPrintf(), and htmlVaWarn().

#define WEXITSTATUS ( stat   )     (short)(((*((int *) &(stat))) >> 8) & 0xffff)

Definition at line 71 of file common.h.

Referenced by pipelineWait(), and plProcWait().

#define WIFEXITED ( stat   )     (((*((int *) &(stat))) & 0xff) == 0)

Definition at line 67 of file common.h.

Referenced by plProcWait().

#define WIFSIGNALED ( stat   )     (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) &0x00ff)))

Definition at line 75 of file common.h.

Referenced by plProcWait().

#define WIFSTOPPED ( stat   )     (((*((int *) &(stat))) & 0xff) == 0177)

Definition at line 83 of file common.h.

#define WORD   short

Definition at line 109 of file common.h.

Referenced by checkSizeTypes(), decoder(), get_next_code(), and gfText().

#define writeOne ( file,
var   )     mustWrite((file), &(var), sizeof(var))

Definition at line 833 of file common.h.

Referenced by cdaCreate(), cdaWriteBlock(), cdaWriteOne(), cdaWriteString(), fofMake(), gfMakeOoc(), nibOutput(), nibStreamClose(), nibStreamOne(), nibStreamOpen(), saveNt4(), twoBitWriteHeader(), twoBitWriteOne(), and writeString().

#define WSTOPSIG ( stat   )     (((*((int *) &(stat))) >> 8) & 0xff)

Definition at line 87 of file common.h.

#define WTERMSIG ( stat   )     ((*((int *) &(stat))) & 0x7f)

Definition at line 79 of file common.h.

Referenced by plProcWait().

#define ZeroVar (  )     zeroBytes(v, sizeof(*v))

Definition at line 301 of file common.h.

Referenced by bafWriteLine(), bigBlat(), fileSize(), genoFindDirect(), getBeforeBlockMapping(), getOverBlockMapping(), gfClientSeqList(), internetFillInAddress(), internetIpToDottedQuad(), mafFromAxtTemp(), netAcceptFrom(), plProcSetup(), scanIndexForSmallExons(), searchOneMaskTrim(), and startServer().


Typedef Documentation

typedef int CmpFunction(const void *elem1, const void *elem2)

Definition at line 386 of file common.h.


Function Documentation

char* addSuffix ( char *  head,
char *  suffix 
)

Definition at line 1613 of file common.c.

References needMem().

Referenced by convertEpsToPdf().

01616 {
01617 char *ret = NULL;
01618 int size = strlen(head) + strlen(suffix) +1;
01619 ret = needMem(sizeof(char)*size);
01620 snprintf(ret, size, "%s%s", head, suffix);
01621 return ret;
01622 }

Here is the call graph for this function:

Here is the caller graph for this function:

bits32 byteSwap32 ( bits32  a  ) 

Definition at line 1739 of file common.c.

References bits32, and UBYTE.

Referenced by nibOpenVerify(), oocMaskCounts(), readBits32(), readBlockCoords(), twoBitOutNBeds(), and twoBitSeqSizeNoNs().

01741 {
01742 union {bits32 whole; UBYTE bytes[4];} u,v;
01743 u.whole = a;
01744 v.bytes[0] = u.bytes[3];
01745 v.bytes[1] = u.bytes[2];
01746 v.bytes[2] = u.bytes[1];
01747 v.bytes[3] = u.bytes[0];
01748 return v.whole;
01749 }

Here is the caller graph for this function:

void carefulClose ( FILE **  pFile  ) 

Definition at line 1683 of file common.c.

References carefulCloseWarn(), and noWarnAbort().

Referenced by appendMimeVar(), bigBlat(), dnaMotifToLogoPs(), dnaMotifToLogoPsW(), doBlat(), doDetailLine(), fofClose(), freeWormCdnaIterator(), gfMakeOoc(), gfPcrOutputWriteAll(), hashHisto(), loadNt4(), mafWriteAll(), nibGetSize(), nibInfoFree(), nibOutput(), parseMultiParts(), psClose(), searchOneIndex(), twoBitClose(), wormCdnaUncache(), wormUncacheSomeGdf(), writeGulp(), and xapParseFile().

01686 {
01687 if (!carefulCloseWarn(pFile))
01688     noWarnAbort();
01689 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean carefulCloseWarn ( FILE **  pFile  ) 

Definition at line 1661 of file common.c.

References errnoWarn(), FALSE, and TRUE.

Referenced by carefulClose().

01665 {
01666 FILE *f;
01667 boolean ok = TRUE;
01668 if ((pFile != NULL) && ((f = *pFile) != NULL))
01669     {
01670     if (f != stdin && f != stdout)
01671         {
01672         if (fclose(f) != 0)
01673             {
01674             errnoWarn("fclose failed");
01675             ok = FALSE;
01676             }
01677         }
01678     *pFile = NULL;
01679     }
01680 return ok;
01681 }

Here is the call graph for this function:

Here is the caller graph for this function:

int chopByChar ( char *  in,
char  chopper,
char *  outArray[],
int  outSize 
)

Definition at line 1248 of file common.c.

Referenced by lineFileChopCharNext(), lineFileChopNextTab(), nextBlock(), tabRowByChar(), and trixParseHitList().

01250 {
01251 int i;
01252 char c;
01253 if (*in == 0)
01254     return 0;
01255 for (i=0; (i<outSize) || (outArray==NULL); ++i)
01256     {
01257     if (outArray != NULL)
01258         outArray[i] = in;
01259     for (;;)
01260         {
01261         if ((c = *in++) == 0)
01262             return i+1;
01263         else if (c == chopper)
01264             {
01265             if (outArray != NULL)
01266                 in[-1] = 0;
01267             break;
01268             }
01269         }
01270     }
01271 return i;
01272 }

Here is the caller graph for this function:

int chopByWhite ( char *  in,
char *  outArray[],
int  outSize 
)

Definition at line 1209 of file common.c.

Referenced by countWordsInFile(), faReadMixedNext(), lineFileChopNext(), mafNextWithPos(), readAllWords(), and tabRowByWhite().

01211 {
01212 int recordCount = 0;
01213 char c;
01214 for (;;)
01215     {
01216     if (outArray != NULL && recordCount >= outSize)
01217         break;
01218 
01219     /* Skip initial separators. */
01220     while (isspace(*in)) ++in;
01221     if (*in == 0)
01222         break;
01223     
01224     /* Store start of word and look for end of word. */    
01225     if (outArray != NULL)
01226         outArray[recordCount] = in;
01227     recordCount += 1;
01228     for (;;)
01229         {
01230         if ((c = *in) == 0)
01231             break;
01232         if (isspace(c))
01233             break;
01234         ++in;
01235         }
01236     if (*in == 0)
01237         break;
01238  
01239     /* Tag end of word with zero. */
01240     if (outArray != NULL)
01241         *in = 0;
01242     /* And skip over the zero. */
01243     in += 1;
01244     }
01245 return recordCount;
01246 }

Here is the caller graph for this function:

char* chopPrefix ( char *  s  ) 

Definition at line 1650 of file common.c.

References chopPrefixAt().

01655 {
01656 return chopPrefixAt(s, '.');
01657 }

Here is the call graph for this function:

char* chopPrefixAt ( char *  s,
char  c 
)

Definition at line 1641 of file common.c.

Referenced by chopPrefix().

01643 {
01644 char *e = strchr(s, c);
01645 if (e == NULL) return s;
01646 *e++ = 0;
01647 return e;
01648 }

Here is the caller graph for this function:

int chopString ( char *  in,
char *  sep,
char *  outArray[],
int  outSize 
)

Definition at line 1184 of file common.c.

Referenced by axtScoreSchemeFromBlastzMatrix(), axtScoreSchemeReadLf(), kvtParseAdd(), netParseSubnet(), parseElement(), parsePasvPort(), parseRestOfCdnaInfo(), twoBitSpecNew(), wormGeneToOrfNames(), wormIsGeneName(), wormParseChromRange(), xaReadNext(), and xStitch().

01185 {
01186 int recordCount = 0;
01187 
01188 for (;;)
01189     {
01190     if (outArray != NULL && recordCount >= outSize)
01191         break;
01192     /* Skip initial separators. */
01193     in += strspn(in, sep);
01194     if (*in == 0)
01195         break;
01196     if (outArray != NULL)
01197         outArray[recordCount] = in;
01198     recordCount += 1;
01199     in += strcspn(in, sep);
01200     if (*in == 0)
01201         break;
01202     if (outArray != NULL)
01203         *in = 0;
01204     in += 1;
01205     }
01206 return recordCount;
01207 }

Here is the caller graph for this function:

void chopSuffix ( char *  s  ) 

Definition at line 1624 of file common.c.

Referenced by convertEpsToPdf(), and getHost().

01626 {
01627 char *e = strrchr(s, '.');
01628 if (e != NULL)
01629     *e = 0;
01630 }

Here is the caller graph for this function:

void chopSuffixAt ( char *  s,
char  c 
)

Definition at line 1632 of file common.c.

01635 {
01636 char *e = strrchr(s, c);
01637 if (e != NULL)
01638     *e = 0;
01639 }

char* cloneLongString ( char *  s  ) 

Definition at line 40 of file common.c.

References cloneMem().

Referenced by htmlPageParse().

00042 {
00043 size_t size = strlen(s);
00044 return cloneMem(s, size+1);
00045 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* cloneMem ( void *  pt,
size_t  size 
)

Definition at line 14 of file common.c.

References needLargeMem().

Referenced by axtReadWithPos(), cloneLongString(), faReadAllMixableInLf(), ffShNeedle(), nextBlock(), and stringBetween().

00016 {
00017 void *newPt = needLargeMem(size);
00018 memcpy(newPt, pt, size);
00019 return newPt;
00020 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* cloneString ( char *  s  ) 

Definition at line 31 of file common.c.

References cloneStringZ().

Referenced by allocNt4(), apacheAccessLogParse(), asParseColArraySpec(), asParseColDef(), asParseTableDef(), asParseText(), axtAffine2Level(), axtFromBlocks(), axtReadWithPos(), axtScoreSchemeReadLf(), blastFileNextGapped(), blastFileOpenVerify(), bundleIntoTargets(), cgiEncode(), cgiEncodeFull(), cgiFromFile(), cgiParseMultipart(), cgiVarSet(), chainReadChainLine(), chainSubsetOnQ(), chainToPsl(), checkTagIsInside(), cloneDnaSeq(), clumpToExactRange(), clumpToHspRange(), convertEpsToPdf(), dnaLoadNextFromStack(), dnaLoadOpen(), dnaLoadSingle(), doBlat(), doDetailLine(), emblRecord(), expandRelativePath(), faReadAllMixableInLf(), faReadMixedNext(), faReadNamedSeq(), findMultipleWordHits(), fofOpen(), formParseVars(), forwardMergeTwo(), gapCalcFromString(), getDirs(), getFileNameFromHdrSig(), getLineMB(), getMimeHeaderFieldVal(), getMimeHeaderMainVal(), getQueryInput(), getWormGeneExonDna(), gfClientFileArray(), gffFileNew(), gffHasGtfGroup(), gfIndexNibsAndTwoBits(), gfPcrGetRanges(), gfPcrInputLoad(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfRangeLoad(), gfRangesBundle(), gfWebConfigRead(), hashVarLine(), hpfNext(), htmlCookieFileRead(), htmlExpandUrl(), htmlFormVarSet(), htmlHeaderRead(), htmlPageParse(), htmlPageParseNoHead(), htmlTagScan(), initialEntityHash(), lineFileAttach(), lineFileOnString(), lineFileParseHttpHeader(), loadHashT3Ranges(), mafFromAxt(), mafMayOpen(), mafNextWithPos(), mafSubsetE(), mafWrite(), main(), mergeContigs(), netHttpGetMultiple(), netUrlHead(), newDnaSeq(), nextSeqFromMem(), nibInfoNew(), nibInput(), nibStreamOpen(), nibTwoCacheNew(), oligoDg(), oligoTm(), outputFa(), parseAttribute(), parseCookie(), parseCookies(), parseDatabaseLines(), parseElement(), parseEntity(), parseFileSeq(), parseGtfEnd(), parseIdent(), parseMultiParts(), parseQueryLines(), parseSeqSpec(), pcrLocalStrand(), peelChains(), phhmTraceToAxt(), plProcNew(), pscmSetHint(), pslFromFakeFfAli(), pslGetCreateSql(), pslLoad(), pslNew(), pslShowAlignmentStranded(), pslShowAlignmentStranded2(), pslTblNew(), pslTrimToQueryRange(), pslTrimToTargetRange(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), qaStatusOnPage(), qaStatusSoftError(), quotedPrintableDecode(), raFromString(), readPartHeaderMB(), repeatMaskOutLoad(), saveAxtBundle(), searchOneIndex(), seqClumpToRangeList(), shaNewNode(), slPairNew(), spacedColumnFromSample(), splitOffNumber(), sqlByteArrayToString(), sqlCharArrayToString(), sqlDoubleArrayToString(), sqlFloatArrayToString(), sqlLongLongArrayToString(), sqlShortArrayToString(), sqlSignedArrayToString(), sqlStringArrayToString(), sqlStringComma(), sqlStringDynamicArray(), sqlUbyteArrayToString(), sqlUnsignedArrayToString(), sqlUshortArrayToString(), stringToSlNames(), stripCommas(), subTextNew(), tabRowGuessFixedOffsets(), transIndexBothStrands(), translateSeqN(), trixParseHitList(), trixSearchWordResults(), twoBitFromDnaSeq(), twoBitFromFile(), twoBitIsRange(), twoBitOpen(), twoBitReadSeqFragExt(), twoBitSpecNew(), twoBitSpecNewFile(), vgOpenGif(), wormCdnaInfo(), wormGeneFirstOrfName(), wormInfoForGene(), xAliLoad(), xapNew(), xapParseAny(), xapStartTag(), xaReadNext(), xpNew(), and xStitch().

00033 {
00034 if (s == NULL)
00035     return NULL;
00036 else
00037     return cloneStringZ(s, strlen(s));
00038 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* cloneStringZ ( char *  s,
int  size 
)

Definition at line 22 of file common.c.

References needMem().

Referenced by cloneString(), faReadNamedSeq(), formParseVars(), htmlExpandUrl(), htmlStatusParse(), mafFromAxt(), mafSubsetE(), newGdfGene(), outputFa(), parseFileSeq(), pcrLocalStrand(), qaStringBetween(), splitOffNonNumeric(), and xStitch().

00024 {
00025 char *d = needMem(size+1);
00026 memcpy(d, s, size);
00027 d[size] = 0;
00028 return d;
00029 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* containsStringNoCase ( char *  haystack,
char *  needle 
)

Definition at line 1828 of file common.c.

References strstrNoCase().

01829 {
01830 return strstrNoCase(haystack, needle);
01831 }

Here is the call graph for this function:

int countChars ( char *  s,
char  c 
)

Definition at line 1127 of file common.c.

Referenced by expandRelativePath(), gfPcrMakePrimer(), isGtfGroup(), makeEscapedString(), makeQuotedString(), projectString(), and tabRowByChar().

01129 {
01130 char a;
01131 int count = 0;
01132 while ((a = *s++) != 0)
01133     if (a == c)
01134         ++count;
01135 return count;
01136 }

Here is the caller graph for this function:

int countCharsN ( char *  s,
char  c,
int  size 
)

Definition at line 1138 of file common.c.

01140 {
01141 int i;
01142 int count = 0;
01143 for (i=0; i<size; ++i)
01144     if (s[i] == c)
01145         ++count;
01146 return count;
01147 }

int countLeadingChars ( char *  s,
char  c 
)

Definition at line 1149 of file common.c.

01151 {
01152 int count = 0;
01153 while (*s++ == c)
01154    ++count;
01155 return count;
01156 }

int countSame ( char *  a,
char *  b 
)

Definition at line 1158 of file common.c.

Referenced by cmpSeqName().

01160 {
01161 char c;
01162 int i;
01163 int count = 0;
01164 for (i=0; ; ++i)
01165    {
01166    c = a[i];
01167    if (b[i] != c)
01168        break;
01169    if (c == 0)
01170        break;
01171    ++count;
01172    }
01173 return count;
01174 }

Here is the caller graph for this function:

int differentStringNullOk ( char *  a,
char *  b 
)

Definition at line 856 of file common.c.

References FALSE.

00864 {
00865 if (a == b)
00866     return FALSE;
00867 else if (a == NULL)
00868     return -1;
00869 else if (b == NULL)
00870     return 1;
00871 else
00872     return strcmp(a,b) != 0;
00873 }

int differentWord ( char *  s1,
char *  s2 
)

Definition at line 839 of file common.c.

Referenced by gffFindGeneIgnoreCase(), gffReadGenes(), rbTreeCmpWord(), stringArrayIx(), and warnAboutDupes().

00843 {
00844 char c1, c2;
00845 for (;;)
00846     {
00847     c1 = toupper(*s1++);
00848     c2 = toupper(*s2++);
00849     if (c1 != c2) /* Takes care of end of string in one but not the other too */
00850         return c2-c1;
00851     if (c1 == 0)  /* Take care of end of string in both. */
00852         return 0;
00853     }
00854 }

Here is the caller graph for this function:

double doubleExp ( char *  text  ) 

Definition at line 140 of file intExp.c.

References expression(), FALSE, kxTokenize(), slFreeList(), and tok.

Referenced by intExp().

00142 {
00143 double val;
00144 struct kxTok *tokList = tok = kxTokenize(text, FALSE);
00145 val = expression();
00146 slFreeList(&tokList);
00147 return val;
00148 }

Here is the call graph for this function:

Here is the caller graph for this function:

double doubleMedian ( int  count,
double *  array 
)

Definition at line 442 of file common.c.

References doubleSort().

Referenced by slDoubleMedian().

00445 {
00446 double median;
00447 doubleSort(count, array);
00448 if ((count&1) == 1)
00449     median = array[count>>1];
00450 else
00451     {
00452     count >>= 1;
00453     median = (array[count] + array[count-1]) * 0.5;
00454     }
00455 return median;
00456 }

Here is the call graph for this function:

Here is the caller graph for this function:

void doubleSort ( int  count,
double *  array 
)

Definition at line 435 of file common.c.

References doubleCmp().

Referenced by doubleMedian().

00437 {
00438 if (count > 1)
00439 qsort(array, count, sizeof(array[0]), doubleCmp);
00440 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* emptyForNull ( char *  s  ) 

Definition at line 1973 of file common.c.

01975 {
01976 if (s == NULL)
01977    s = emptyStr;
01978 return s;
01979 }

boolean endsWith ( char *  string,
char *  end 
)

Definition at line 937 of file common.c.

References FALSE, and sameString.

Referenced by getDecompressor(), netLineFileMayOpen(), netLineFileMayOpenCatchError(), nibIsFile(), nibIsRange(), sendFtpCommand(), setupWss(), textOutInit(), twoBitIsFile(), and twoBitSpecNew().

00939 {
00940 int sLen, eLen, offset;
00941 sLen = strlen(string);
00942 eLen = strlen(end);
00943 offset = sLen - eLen;
00944 if (offset < 0)
00945     return FALSE;
00946 return sameString(string+offset, end);
00947 }

Here is the caller graph for this function:

void eraseTrailingSpaces ( char *  s  ) 

Definition at line 1311 of file common.c.

Referenced by htmlTagScan(), and trimSpaces().

01313 {
01314 int len = strlen(s);
01315 int i;
01316 char c;
01317 
01318 for (i=len-1; i>=0; --i)
01319     {
01320     c = s[i];
01321     if (isspace(c))
01322         s[i] = 0;
01323     else
01324         break;
01325     }
01326 }

Here is the caller graph for this function:

void eraseWhiteSpace ( char *  s  ) 

Definition at line 1329 of file common.c.

Referenced by base64Validate(), and phyloParseString().

01330 {
01331 char *in, *out;
01332 char c;
01333 
01334 in = out = s;
01335 for (;;)
01336     {
01337     c = *in++;
01338     if (c == 0) 
01339         break;
01340     if (!isspace(c))
01341         *out++ = c;
01342     }
01343 *out++ = 0;
01344 }

Here is the caller graph for this function:

void errAbort ( char *  format,
  ... 
)

Definition at line 105 of file errabort.c.

Referenced by _cgiFindInput(), affineAlign(), aliLines(), asLinkEmbeddedObjects(), atom(), axtAffine2Level(), axtBlastOut(), axtReadWithPos(), axtScoreSchemeFromProteinText(), axtScoreSchemeReadLf(), badProteinMatrixLine(), bandExt(), bfError(), bfUnexpectedEof(), binFromRangeBinKeeperExtended(), binFromRangeExtended(), binFromRangeStandard(), binKeeperAdd(), binKeeperNew(), blat(), carefulAlloc(), carefulCheckHeap(), carefulFree(), cBlockFindCrossover(), cdaOpenVerify(), cdaWriteOne(), cgiBadVar(), cgiDouble(), cgiInt(), cgiOneChoice(), cgiParseInputAbort(), cgiParseMultipart(), chainConnectCost(), chainRangeQPlusStrand(), chainReadBlocks(), chainReadChainLine(), chainReadUsedSwapLf(), checkChainGaps(), checkChainIncreases(), checkComplete(), checkExactlyOne(), checkOpts(), checkStartBeforeEnd(), cleanEnvVars(), closePipeline(), closePipelineFile(), codonLoadBias(), copyFile(), dgAddNode(), dgConstrainedPriorityOrder(), dgFindPath(), dnaMotifNormalize(), dnaMotifToLogoPGM(), dnaMotifToLogoPng(), doBlat(), doDetailLine(), doGetSeq(), dtdParse(), dtdxTag(), eatLf(), emblLineGroup(), errCatchEnd(), expandEntities(), expandFaFastBuf(), faMixedSpeedReadNext(), faReadAllIntoHash(), faReadSeq(), ffCalcGapPenalty(), fileModTime(), findSource(), findStringEnd(), fixupChildRefs(), fofFetch(), fofFetchString(), fofOpen(), genoFindDirect(), getcMB(), getCompressor(), getCompressSuffix(), getLineMB(), getMimeHeaderFieldVal(), getMimeHeaderMainVal(), getPortIx(), getPostInput(), getQueryInput(), gfCheckTileSize(), gfClient(), gffSyntaxError(), gfiExpandAndLoadCached(), gfiGetSeqName(), gfIndexNibsAndTwoBits(), gfIndexTransNibsAndTwoBits(), gfMakeOoc(), gfNewEmpty(), gfOutputAny(), gfOutputSim4(), gfPcrClumps(), gfPcrGetRanges(), gfPcrMakePrimer(), gfPcrOneViaNet(), gfPcrOutputWriteList(), gfQuerySeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfTypeFromName(), gfWebConfigRead(), gfWebFindServer(), hashAddUnique(), hashMustFindName(), hashMustFindVal(), hashMustRemove(), hashVarLine(), htmlCookieFileRead(), htmlFormVarGet(), htmlFormVarSet(), htmlIncludeFile(), htmlMemDeath(), htmlPageFormOrAbort(), htmlPageParseOk(), htmlPageSetVar(), htmlPageValidateOrAbort(), internetParseDottedQuad(), jpegSize(), kvtAdd(), kxTokenizeFancy(), lineFileExpectAtLeast(), lineFileExpectWords(), lineFileNeedDouble(), lineFileNeedFullNum(), lineFileNeedNum(), lineFileNext(), lineFileOpen(), lineFileShort(), lineFileSkip(), lineFileUnexpectedEnd(), lineFileVaAbort(), listDirX(), logOpenSyslog(), longSeqTm(), mafFindComponent(), mafFindCompPrefix(), mafFindCompSpecies(), mafMayOpen(), mafNextWithPos(), mafRewind(), mafScoreRangeMultiz(), main(), makeDir(), makeHits(), maskFromOut(), memTrackerEnd(), memTrackerStart(), mgLoadGif(), mgSaveGif(), mustFindColumn(), mustOpen(), mustRead(), mustReadString(), mustWrite(), needHugeMem(), needHugeMemResize(), needLargeMem(), needLargeMemResize(), needMem(), needNextWord(), needQuotedString(), netGetOpenFtp(), netHttpConnect(), netHttpLineFileMayOpen(), netMustConnectTo(), netParseUrl(), netSendString(), netUrlOpen(), newBlock(), newQuickHeap(), nextSeqFromMem(), nibInput(), nibOpenVerify(), nibOutput(), notEmbl(), notGoodSubnet(), nt4OpenVerify(), number(), oligoDg(), oligoTm(), oocMaskCounts(), optGet(), optionDouble(), optionFloat(), optionInt(), optionLongLong(), optionMultiVal(), optionMustExist(), optionVal(), parseAndExp(), parseAttribute(), parseCookies(), parseElement(), parseEntity(), parseErr(), parseExp(), parseFacility(), parseGtfEnd(), parseMultiOption(), parseMultiParts(), parseOrExp(), parseParenthesized(), parsePasvPort(), parseRelation(), parseRestOfCdnaInfo(), parseSeqSpec(), parseSubrange(), parseSubTree(), pcrClumps(), pcrServer(), phyloParseString(), pipelineFile(), pipelineLineFile(), pipelineNew(), pipelineOpenMem(), plProcMemWrite(), plProcWait(), popAbortHandler(), popMemHandler(), popWarnHandler(), projectString(), pscmFindColorIx(), pslFromAlign(), pslGetCreateSql(), pslNext(), pslOutFormat(), pslOutputShort(), pslTransMap(), pslWeightedIntronOrientation(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), pushAbortHandler(), pushWarnHandler(), putBackMB(), queryServer(), quickHeapBalanceWithChildren(), raFoldIn(), raFoldInOneRetName(), raReadAll(), rawKeyIn(), readLine(), readPartHeaderMB(), readQuotedString(), readStringZ(), readTaggedNumLine(), removeFromQuickHeapN(), rkeyEval(), safecat(), safecpy(), safencat(), safencpy(), saveAxtBundle(), savePslx(), scanChromOffsetFile(), searchOneIndex(), sendFtpCommand(), shortScoreScheme(), slDoubleMedian(), snofMustOpen(), splitPath(), sqlDouble(), sqlEatChar(), sqlFloat(), sqlGetOptQuoteString(), sqlLongLong(), sqlSigned(), sqlUnsigned(), sqlUnsignedLong(), startSeqQuery(), stringToSlNames(), subTextStatic(), syntaxError(), tabRowByChar(), tabRowByFixedOffsets(), tabRowByWhite(), tabRowGuessFixedOffsets(), tokenizerErrAbort(), tokenizerMustHaveNext(), tokenizerNext(), tokenizerNotEnd(), tooManyBlocks(), trixParseHitList(), twoBitCheckTotalSize(), twoBitOpen(), twoBitReadSeqFragExt(), twoBitSeekTo(), twoBitWriteHeader(), usage(), validateCgiUrl(), validateOption(), validateSeqs(), vasafef(), wormCacheSomeGdf(), wormCdaAlisInRange(), wormCdnaInfo(), wormChromSize(), wormFaCommentIntoInfo(), wormGdfGenesInRange(), wormGeneToOrfNames(), wormGetNamelessClusterDna(), xaIxOpenVerify(), xapError(), xapNext(), xaReadNext(), xenAlignSmall(), xpError(), and xStitch().

00107 {
00108 va_list args;
00109 va_start(args, format);
00110 vaErrAbort(format, args);
00111 va_end(args);
00112 }

Here is the caller graph for this function:

void errnoAbort ( char *  format,
  ... 
)

Definition at line 114 of file errabort.c.

Referenced by appendMimeVar(), copyFile(), copyOpenFile(), faReadMixedNext(), faWrite(), faWriteAll(), fofMake(), getUser(), gfConnect(), incCounterFile(), isPipe(), lineFileSeek(), mafOpen(), mgSaveGif(), mkdirTrashDirectory(), moreMimeBuf(), mustFork(), netFileFromSocket(), netMustReadAll(), openRead(), openWrite(), pipeCreate(), pipelineExecProc(), pipelineFile(), plProcExecChild(), plProcMemWrite(), plProcSetup(), plProcWait(), rawKeyIn(), safeClose(), and textOutInit().

00116 {
00117 char fbuf[512];
00118 va_list args;
00119 va_start(args, format);
00120 sprintf(fbuf, "%s\n%s", strerror(errno), format);
00121 vaErrAbort(fbuf, args);
00122 va_end(args);
00123 }

Here is the caller graph for this function:

boolean fastReadString ( FILE *  f,
char  buf[256] 
)

Definition at line 1570 of file common.c.

References FALSE, mustRead(), readOne, TRUE, and UBYTE.

Referenced by twoBitOpen().

01573 {
01574 UBYTE bLen;
01575 int len;
01576 if (!readOne(f, bLen))
01577     return FALSE;
01578 if ((len = bLen)> 0)
01579     mustRead(f, buf, len);
01580 buf[len] = 0;
01581 return TRUE;
01582 } 

Here is the call graph for this function:

Here is the caller graph for this function:

boolean fileExists ( char *  fileName  ) 

Definition at line 1814 of file common.c.

References fileSize(), sameString, and TRUE.

Referenced by htmlIncludeFile(), htmlPageGet(), mysqlHost(), and rTempName().

01817 {
01818 /* To make piping easier stdin and stdout always exist. */
01819 if (sameString(fileName, "stdin")) return TRUE;
01820 if (sameString(fileName, "stdout")) return TRUE;
01821 
01822 return fileSize(fileName) != -1;
01823 }

Here is the call graph for this function:

Here is the caller graph for this function:

off_t fileSize ( char *  fileName  ) 

Definition at line 18 of file osunix.c.

References SEEK_END.

Referenced by faReadSeq(), fileExists(), gffOpen(), and readInGulp().

00020 {
00021 struct stat mystat;
00022 ZeroVar(&mystat);
00023 if (stat(pathname,&mystat)==-1)
00024     {
00025     return -1;
00026     }
00027 return mystat.st_size;
00028 }

Here is the caller graph for this function:

char* firstWordInFile ( char *  fileName,
char *  wordBuf,
int  wordBufSize 
)

Definition at line 1691 of file common.c.

References mustOpen(), and trimSpaces().

Referenced by getDirs(), and mysqlHost().

01693 {
01694 FILE *f = mustOpen(fileName, "r");
01695 fgets(wordBuf, wordBufSize, f);
01696 fclose(f);
01697 return trimSpaces(wordBuf);
01698 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* firstWordInLine ( char *  line  ) 

Definition at line 1381 of file common.c.

References skipLeadingSpaces(), and skipToSpaces().

Referenced by faMixedSpeedReadNext().

01384 {
01385 char *e;
01386 line = skipLeadingSpaces(line);
01387 if ((e = skipToSpaces(line)) != NULL)
01388     *e = 0;
01389 return line;
01390 }

Here is the call graph for this function:

Here is the caller graph for this function:

void freeMem ( void *  pt  ) 

Definition at line 210 of file memalloc.c.

References memHandler::free, and mhStack.

Referenced by apacheAccessLogFree(), axtFree(), axtScoreSchemeProteinRead(), bandExtFf(), bfGraphFree(), binKeeperFree(), binKeeperRemove(), blastBlockFree(), blastFileFree(), blastGappedAliFree(), blastQueryFree(), cdaFreeAli(), chainFree(), chainMergeAbutting(), checkTagIsInside(), clusterRemoveEncompassed(), contigRemoveEncompassed(), copyFile(), cpFile(), crudeAliFind(), dgConstrainedPriorityOrder(), dgDisconnect(), dgFindPath(), dgRemoveFromConList(), dlDelete(), dlListReset(), dlSort(), dnaLoadClose(), dnaMotifFree(), expandFaFastBuf(), ffMergeNeedleAlis(), ffRemoveEmptyAlis(), findCrudeGenes(), fofClose(), freeContig(), freeDlListAndVals(), freeDnaSeq(), freeDyString(), freeFastProber(), freeHashAndVals(), freeHistoGram(), freeKvt(), freeNt4(), freePatSpace(), freez(), gapCalcFree(), gdfFreeGene(), genoFindFree(), gentleFree(), gfAlignTrans(), gfAlignTransTrans(), gffClose(), gffFileFree(), gffFreeGene(), gffHasGtfGroup(), gfOutputFree(), gfPcrInputFree(), gfPcrOutputFree(), gfRangeFree(), gif_decoder(), hpfModelFree(), hpfResultFree(), htmlAttributeFree(), htmlCookieFree(), htmlFormVarFree(), htmlIncludeFile(), htmlStatusFree(), htmlTagFree(), kdTreeMake(), lineFileClose(), lmCleanup(), mafCompFree(), mafFileFree(), makeHits8(), memTrackerEnd(), mergeContigs(), mergeWithinCluster(), mgFree(), netParseUrl(), nibInfoFree(), nibStreamClose(), nt4LoadPart(), oligoDg(), oligoTm(), phmmMatrixFree(), plProcFree(), pscmSetHint(), pslFree(), pslTblFree(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), queryServer(), raFromString(), rcSeqs(), readLine(), removeNegativeBlocks(), repeatMaskOutFree(), scanChromOffsetFile(), scoreNoninsertingExtensions(), shaFreeNode(), shuffleList(), slDoubleMedian(), slFreeList(), slPairFree(), slSort(), snofClose(), snofOpen(), spacedColumnFromLineFile(), spacedColumnFromSample(), spaceSaverFree(), sqlStringFreeDynamicArray(), ssGraphFree(), stringToSlNames(), strstrNoCase(), subTextFree(), synQueueGet(), synQueueGrab(), targetHitsFree(), tokenizerFree(), trimFlakyEnds(), trixClose(), trixHitPosFree(), trixSearchResultFree(), trixWordResultFree(), twoBitIsRange(), twoBitSpecFree(), wormFreeCdnaInfo(), wormInfoForGene(), xaAliFree(), xAliFree(), xapFree(), xapStartTag(), xpFree(), and xStitch().

00212 {
00213 if (pt != NULL)
00214     mhStack->free(pt);
00215 }

Here is the caller graph for this function:

void freez ( void *  ppt  ) 

Definition at line 217 of file memalloc.c.

References freeMem().

Referenced by aliLines(), apacheAccessLogFree(), appendCgiVar(), axtAffine2Level(), axtBundleFree(), axtFree(), axtScoreSchemeFree(), bfGraphFree(), binKeeperFree(), bitFree(), blastBlockFree(), blastFileFree(), blastGappedAliFree(), blastQueryFree(), boxClumpFree(), cfmFree(), cgiFromFile(), cgiParseMultipart(), cgiUrlString(), chainFree(), chainRemovePartialOverlaps(), clumpHits(), colHashFree(), convertEpsToPdf(), correlateFree(), dgFree(), dgNodeFree(), dnaLoadClose(), dnaLoadSingle(), dnaLoadStackFree(), dnaMotifFree(), doBlat(), dyStringCannibalize(), errCatchFree(), faFreeFastBuf(), fillConcave(), flyFreeNt4Genome(), fofClose(), formParseVars(), freeContig(), freeDlList(), freeDnaSeq(), freeDyString(), freeFastProber(), freeHash(), freeKvt(), freeNt4(), freePatSpace(), freeQuickHeap(), freeWormCdnaIterator(), gapCalcFree(), genoFindFree(), getHitsFromServer(), gfAbort(), gfClumpFree(), gffFileFree(), gffGroupFree(), gfHitSortDiagonal(), gfOutputFree(), gfPcrInputFree(), gfPcrOutputFree(), gfRangeFree(), gfxPolyFree(), hashElFree(), hashVarLine(), headerBytes(), hpfModelFree(), hpfResultFree(), htmlAttributeFree(), htmlCookieFree(), htmlExpandUrl(), htmlFormFree(), htmlFormVarFree(), htmlFormVarSet(), htmlPageFree(), htmlPageFromForm(), htmlPageParse(), htmlPageParseNoHead(), htmlStatusFree(), htmlTagFree(), jpegSize(), lineFileClose(), lineFileDecompress(), loadHashT3Ranges(), mafAliFree(), mafCompFree(), mafFileFree(), memGifClose(), netHttpConnect(), netHttpGet(), netParseSubnet(), nibInfoFree(), nibStreamClose(), nibTwoCacheFree(), outputFa(), parseMultiParts(), parsePasvPort(), pcrClumps(), phmmMatrixFree(), pipelineFree(), psClose(), pscmClose(), pslFree(), pslShowAlignmentStranded(), psPolyFree(), qaStatusSoftError(), rbTreeFree(), readPartHeaderMB(), repeatMaskOutFree(), rudpClose(), rudpFree(), searchOneIndex(), slPairFree(), slPairFreeVals(), spaceSaverFree(), sqlStringFreeDynamicArray(), ssBundleFree(), ssFfItemFree(), ssGraphFree(), startServer(), subTextFree(), synQueueFree(), synQueueFreeAndVals(), targetHitsFree(), tokenizerFree(), trans3Free(), trixClose(), trixHitPosFree(), trixSearchResultFree(), trixWordResultFree(), twoBitClose(), twoBitOutNBeds(), twoBitReadSeqFragExt(), twoBitSeqSizeNoNs(), validateTables(), vgClose(), vgOpenGif(), wormCdnaUncache(), wormFreeNt4Genome(), xAliFree(), xapFree(), xenAlignWorm(), and xpFree().

00220 {
00221 void **ppt = (void **)vpt;
00222 void *pt = *ppt;
00223 *ppt = NULL;
00224 freeMem(pt);
00225 }

Here is the call graph for this function:

Here is the caller graph for this function:

void gentleFree ( void *  pt  ) 

Definition at line 834 of file common.c.

References freeMem().

Referenced by gif_compress_data().

00835 {
00836 if (pt != NULL) freeMem((char*)pt);
00837 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean hasWhiteSpace ( char *  s  ) 

Definition at line 1371 of file common.c.

References FALSE, and TRUE.

01373 {
01374 char c;
01375 while ((c = *s++) != 0)
01376     if (isspace(c))
01377         return TRUE;
01378 return FALSE;
01379 }

int intAbs ( int  a  ) 

Definition at line 1714 of file common.c.

Referenced by cdaCoalesceOne().

01716 {
01717 return (a >= 0 ? a : -a);
01718 }

Here is the caller graph for this function:

int intExp ( char *  text  ) 

Definition at line 150 of file intExp.c.

References doubleExp(), and round.

Referenced by cgiIntExp().

00152 {
00153 return round(doubleExp(text));
00154 }

Here is the call graph for this function:

Here is the caller graph for this function:

int intMedian ( int  count,
int *  array 
)

Definition at line 518 of file common.c.

References intSort().

00521 {
00522 int median;
00523 intSort(count, array);
00524 if ((count&1) == 1)
00525     median = array[count>>1];
00526 else
00527     {
00528     count >>= 1;
00529     median = (array[count] + array[count-1]) * 0.5;
00530     }
00531 return median;
00532 }

Here is the call graph for this function:

void intSort ( int  count,
int *  array 
)

Definition at line 511 of file common.c.

References intCmp().

Referenced by intMedian().

00513 {
00514 if (count > 1)
00515 qsort(array, count, sizeof(array[0]), intCmp);
00516 }

Here is the call graph for this function:

Here is the caller graph for this function:

char lastChar ( char *  s  ) 

Definition at line 949 of file common.c.

Referenced by htmlExpandUrl(), quotedPCollapse(), and quotedPrintableEncode().

00951 {
00952 if (s == NULL || s[0] == 0)
00953     return 0;
00954 return s[strlen(s)-1];
00955 }

Here is the caller graph for this function:

char* lastWordInLine ( char *  line  ) 

Definition at line 1392 of file common.c.

References skipLeadingSpaces(), and skipToSpaces().

01396 {
01397 char *s = line;
01398 char *word = NULL, *wordEnd = NULL;
01399 for (;;)
01400     {
01401     s = skipLeadingSpaces(s);
01402     if (s == NULL || s[0] == 0)
01403         break;
01404     word = s;
01405     s = wordEnd = skipToSpaces(s);
01406     if (s == NULL)
01407         break;
01408     }
01409 if (wordEnd != NULL)
01410     *wordEnd = 0;
01411 return word;
01412 }

Here is the call graph for this function:

void makeDirs ( char *  path  ) 

Definition at line 2014 of file common.c.

References makeDir(), and PATH_LEN.

02016 {
02017 char pathBuf[PATH_LEN];
02018 char* next = pathBuf;
02019 
02020 strcpy(pathBuf, path);
02021 if (*next == '/')
02022     next++;
02023 
02024 while((*next != '\0')
02025       && (next = strchr(next, '/')) != NULL)
02026     {
02027     *next = '\0';
02028     makeDir(pathBuf);
02029     *next = '/';
02030     next++;
02031     }
02032 makeDir(pathBuf);
02033 }

Here is the call graph for this function:

char* memMatch ( char *  needle,
int  nLen,
char *  haystack,
int  hLen 
)

Definition at line 957 of file common.c.

Referenced by countOccurrences(), getChunkMB(), jiggleSmallExons(), pcrLocalStrand(), and setEopMB().

00960 {
00961 char c = *needle++;
00962 nLen -= 1;
00963 hLen -= nLen;
00964 while (--hLen >= 0)
00965     {   
00966     if (*haystack++ == c && memcmp(needle, haystack, nLen) == 0)
00967         {
00968         return haystack-1;
00969         }
00970     }
00971 return NULL;
00972 }

Here is the caller graph for this function:

FILE* mustOpen ( char *  fileName,
char *  mode 
)

Definition at line 1482 of file common.c.

References errAbort(), errno, and sameString.

Referenced by appendMimeVar(), blat(), cdaCreate(), cdaOpenVerify(), codonLoadBias(), dnaMotifToLogoPs(), dnaMotifToLogoPsW(), doBlat(), doDetailLine(), elFromRec(), faWrite(), faWriteAll(), firstWordInFile(), flyCdnaSeq(), fofMake(), fofOpen(), fofRecToPos(), gfClient(), gfClientFileArray(), gfMakeOoc(), gfPcrOutputWriteAll(), hashHisto(), jpegSize(), logOpenFile(), mafWriteAll(), mgLoadGif(), mgSaveGif(), nibOutput(), nibStreamOpen(), nt4OpenVerify(), oocMaskCounts(), parseMultiParts(), pslWriteAll(), psOpen(), readInGulp(), saveNt4(), scanChromOffsetFile(), twoBitOpen(), verboseSetLogFile(), wormCacheSomeGdf(), wormCdaAlisInRange(), wormCdnaCache(), wormGeneForOrf(), wormGeneRange(), wormInfoForGene(), wormSearchAllCdna(), writeGulp(), xaIxOpenVerify(), xaOpenVerify(), xapOpen(), xapParseFile(), xenAlignBig(), xenAlignWorm(), and xStitch().

01484 {
01485 FILE *f;
01486 
01487 if (sameString(fileName, "stdin"))
01488     return stdin;
01489 if (sameString(fileName, "stdout"))
01490     return stdout;
01491 if ((f = fopen(fileName, mode)) == NULL)
01492     {
01493     char *modeName = "";
01494     if (mode)
01495         {
01496         if (mode[0] == 'r')
01497             modeName = " to read";
01498         else if (mode[0] == 'w')
01499             modeName = " to write";
01500         else if (mode[0] == 'a')
01501             modeName = " to append";
01502         }
01503     errAbort("Can't open %s%s: %s", fileName, modeName, strerror(errno));
01504     }
01505 return f;
01506 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mustRead ( FILE *  file,
void *  buf,
size_t  size 
)

Definition at line 1518 of file common.c.

References errAbort().

Referenced by cdaLoadString(), fastReadString(), fofBatchFind(), fofFetch(), fofFetchString(), fofFindFirst(), fofOpen(), fofSearch(), gdfReadOneGene(), loadNt4(), nt4LoadPart(), readBits64(), readInGulp(), readString(), scanChromOffsetFile(), twoBitFromFile(), twoBitReadSeqFragExt(), and xaReadNext().

01520 {
01521 if (size != 0 && fread(buf, size, 1, file) != 1)
01522     errAbort("Error reading %lld bytes: %s", (long long)size, strerror(ferror(file)));
01523 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* mustReadString ( FILE *  f  ) 

Definition at line 1560 of file common.c.

References errAbort(), and readString().

01562 {
01563 char *s = readString(f);
01564 if (s == NULL)
01565     errAbort("Couldn't read string");
01566 return s;
01567 }

Here is the call graph for this function:

void mustWrite ( FILE *  file,
void *  buf,
size_t  size 
)

Definition at line 1508 of file common.c.

References errAbort().

Referenced by axtWrite(), bandExt(), cdaWriteString(), dumpNearCrossover(), fofMake(), kvtWriteAll(), makeIndex(), parseMultiParts(), savePslx(), twoBitWriteOne(), writeBits64(), writeContig(), writeGulp(), writeSeqWithBreaks(), writeString(), and xenShowAli().

01510 {
01511 if (size != 0 && fwrite(buf, size, 1, file) != 1)
01512     {
01513     errAbort("Error writing %lld bytes: %s\n", (long long)size, strerror(ferror(file)));
01514     }
01515 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* naForEmpty ( char *  s  ) 

Definition at line 1965 of file common.c.

01967 {
01968 if (s == NULL || s[0] == 0)
01969     s = naStr;
01970 return s;
01971 }

char* naForNull ( char *  s  ) 

Definition at line 1957 of file common.c.

Referenced by htmlFormVarPrint().

01959 {
01960 if (s == NULL) 
01961    s = naStr;
01962 return s;
01963 }

Here is the caller graph for this function:

void* needHugeMem ( size_t  size  ) 

Definition at line 131 of file memalloc.c.

References memHandler::alloc, errAbort(), and mhStack.

Referenced by cloneDnaSeq(), expandFaFastBuf(), faReadMixedNext(), faReadSeq(), gfAllocLargeLists(), gfAllocLists(), and needHugeZeroedMem().

00133 {
00134 void *pt;
00135 if (size == 0)
00136     errAbort("needHugeMem: trying to allocate 0 bytes");
00137 if ((pt = mhStack->alloc(size)) == NULL)
00138     errAbort("needHugeMen: Out of huge memory - request size %llu bytes\n",
00139              (unsigned long long)size);
00140 return pt;
00141 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needHugeMemResize ( void *  vp,
size_t  size 
)

Definition at line 153 of file memalloc.c.

References errAbort(), mhStack, and memHandler::realloc.

Referenced by needHugeZeroedMemResize().

00157 {
00158 void *pt;
00159 if ((pt = mhStack->realloc(vp, size)) == NULL)
00160     errAbort("needHugeMemResize: Out of memory - request resize %llu bytes\n",
00161         (unsigned long long)size);
00162 return pt;
00163 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needHugeZeroedMem ( size_t  size  ) 

Definition at line 144 of file memalloc.c.

References needHugeMem().

Referenced by gfNewEmpty().

00146 {
00147 void *v;
00148 v = needHugeMem(size);
00149 memset(v, 0, size);
00150 return v;
00151 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needHugeZeroedMemResize ( void *  vp,
size_t  oldSize,
size_t  newSize 
)

Definition at line 166 of file memalloc.c.

References needHugeMemResize().

00170 {
00171 void *v;
00172 v = needHugeMemResize(vp, newSize);
00173 if (newSize > oldSize)
00174     memset(((char*)v)+oldSize, 0, newSize-oldSize);
00175 return v;
00176 }

Here is the call graph for this function:

void* needLargeMem ( size_t  size  ) 

Definition at line 84 of file memalloc.c.

References memHandler::alloc, errAbort(), maxAlloc, and mhStack.

Referenced by allocNt4(), allocPatSpaceLists(), axtAffine2Level(), axtFromBlocks(), cloneMem(), dlSort(), dnaLoadNextFromStack(), fofFetch(), fofFetchString(), gfHitSortDiagonal(), makeHits8(), makeTileHash(), mgNew(), needLargeZeroedMem(), nibInput(), nt4LoadPart(), nt4Unpack(), parseMultiParts(), phmmMatrixNew(), pipelineFile(), rcSeqs(), readInGulp(), shuffleList(), slSort(), startServer(), translateSeqN(), twoBitFromFile(), and twoBitReadSeqFragExt().

00087 {
00088 void *pt;
00089 if (size == 0 || size >= maxAlloc)
00090     errAbort("needLargeMem: trying to allocate %llu bytes (limit: %llu)",
00091          (unsigned long long)size, (unsigned long long)maxAlloc);
00092 if ((pt = mhStack->alloc(size)) == NULL)
00093     errAbort("needLargeMem: Out of memory - request size %llu bytes\n",
00094              (unsigned long long)size);
00095 return pt;
00096 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needLargeMemResize ( void *  vp,
size_t  size 
)

Definition at line 107 of file memalloc.c.

References errAbort(), maxAlloc, mhStack, and memHandler::realloc.

Referenced by needLargeZeroedMemResize().

00110 {
00111 void *pt;
00112 if (size == 0 || size >= maxAlloc)
00113     errAbort("needLargeMemResize: trying to allocate %llu bytes (limit: %llu)",
00114          (unsigned long long)size, (unsigned long long)maxAlloc);
00115 if ((pt = mhStack->realloc(vp, size)) == NULL)
00116     errAbort("needLargeMemResize: Out of memory - request size %llu bytes\n",
00117              (unsigned long long)size);
00118 return pt;
00119 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needLargeZeroedMem ( size_t  size  ) 

Definition at line 98 of file memalloc.c.

References needLargeMem().

Referenced by bitAlloc(), bitClone(), newBlock(), and newPatSpace().

00100 {
00101 void *v;
00102 v = needLargeMem(size);
00103 memset(v, 0, size);
00104 return v;
00105 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needLargeZeroedMemResize ( void *  vp,
size_t  oldSize,
size_t  newSize 
)

Definition at line 121 of file memalloc.c.

References needLargeMemResize().

Referenced by bitRealloc(), and needMoreMem().

00124 {
00125 void *v = needLargeMemResize(vp, newSize);
00126 if (newSize > oldSize)
00127     memset(((char*)v)+oldSize, 0, newSize-oldSize);
00128 return v;
00129 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needMem ( size_t  size  ) 

Definition at line 180 of file memalloc.c.

References memHandler::alloc, errAbort(), mhStack, and NEEDMEM_LIMIT.

Referenced by addSuffix(), allocNt4(), axtAffine2Level(), bandExtFf(), base64Decode(), base64Encode(), cdaAliFromFfAli(), cdaLoadOne(), cdaLoadString(), cgiEncode(), cgiEncodeFull(), cloneStringZ(), copyFile(), cpFile(), crudeAliFind(), envUpdate(), errorSafeSetup(), expandRelativePath(), ffShAliPart(), ffShNeedle(), fillConcave(), findCrudeGenes(), flyLoadNt4Genome(), fofOpen(), fold2pairingList(), forwardMergeTwo(), geneDna(), getPostInput(), gffDupeGeneAndSurrounds(), gfPcrMakePrimer(), gif_compress_data(), gif_decoder(), headerBytes(), htmlEncode(), jpegSize(), kxTokNew(), lineFileAttach(), lmInit(), makeEscapedString(), makeFastProber(), makeQuotedString(), mgNew(), mixedCaseName(), netGetHugeString(), netGetLongString(), newDnaSeq(), newDyString(), newFileInfo(), newGdfGene(), newHash(), newKvt(), newSlName(), newWormFeature(), phmmMatrixNew(), plProcNew(), projectIntArray(), projectString(), pslShowAlignmentStranded(), pslShowAlignmentStranded2(), quotedPrintableDecode(), readAllWords(), readLine(), readString(), replaceChars(), saveAliToPermanentMem(), scanChromOffsetFile(), setProgram(), shaNewNode(), slNameNewN(), snofOpen(), spacedColumnFromLineFile(), spaceSaverAddOverflow(), strstrNoCase(), subTextString(), tabRowNew(), tokenizerOnLineFile(), wormLoadNt4Genome(), wormSearchAllCdna(), xaReadNext(), and xStitch().

00183 {
00184 void *pt;
00185 if (size == 0 || size > NEEDMEM_LIMIT)
00186     errAbort("needMem: trying to allocate %llu bytes (limit: %llu)",
00187          (unsigned long long)size, (unsigned long long)NEEDMEM_LIMIT);
00188 if ((pt = mhStack->alloc(size)) == NULL)
00189     errAbort("needMem: Out of memory - request size %llu bytes\n",
00190              (unsigned long long)size);
00191 memset(pt, 0, size);
00192 return pt;
00193 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* needMoreMem ( void *  old,
size_t  copySize,
size_t  newSize 
)

Definition at line 195 of file memalloc.c.

References needLargeZeroedMemResize().

Referenced by dyStringExpandBuf(), lineFileExpandBuf(), newEdge(), and pslNext().

00199 {
00200 return needLargeZeroedMemResize(old, oldSize, newSize);
00201 }

Here is the call graph for this function:

Here is the caller graph for this function:

struct slName* newSlName ( char *  name  )  [read]

Definition at line 535 of file common.c.

References AllocVar, and needMem().

Referenced by cgiStringList(), listDir(), parseMultiOption(), readAllLines(), slNameStore(), wormGeneToOrfNames(), and xStitch().

00537 {
00538 struct slName *sn;
00539 if (name != NULL)
00540     {
00541     int len = strlen(name);
00542     sn = needMem(sizeof(*sn)+len);
00543     strcpy(sn->name, name);
00544     return sn;
00545     }
00546 else
00547     {
00548     AllocVar(sn);
00549     }
00550 return sn;
00551 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* nextTabWord ( char **  pLine  ) 

Definition at line 1431 of file common.c.

01433 {
01434 char *s = *pLine;
01435 char *e;
01436 if (s == NULL || *s == '\n' || *s == 0)
01437     {
01438     *pLine = NULL;
01439     return NULL;
01440     }
01441 e = strchr(s, '\t');
01442 if (e == NULL)
01443     {
01444     e = strchr(s, '\n');
01445     if (e != NULL)
01446         *e = 0;
01447     *pLine = NULL;
01448     }
01449 else
01450     {
01451     *e++ = 0;
01452     *pLine = e;
01453     }
01454 return s;
01455 }

char* nextWord ( char **  pLine  ) 

Definition at line 1414 of file common.c.

References skipLeadingSpaces(), and skipToSpaces().

Referenced by apacheAccessLogParse(), checkTagIsInside(), emblLineGroup(), findTileSize(), getHitsFromServer(), gfPcrGetRanges(), gfWebConfigRead(), hashWordsInFile(), hpfNext(), htmlCookieFileRead(), htmlHeaderRead(), lineFileParseHttpHeader(), lineFileSlurpHttpBody(), mafMayOpen(), mafNextWithPos(), needNextWord(), netSkipHttpHeaderLines(), netSkipHttpHeaderLinesCatch(), netUrlHead(), nextQuotedWord(), parseGtfEnd(), raFoldInOneRetName(), raFromString(), raNextRecord(), readTaggedNumLine(), spacedColumnFromSample(), startServer(), trixParseHitList(), and trixSearchWordResults().

01417 {
01418 char *s = *pLine, *e;
01419 if (s == NULL || s[0] == 0)
01420     return NULL;
01421 s = skipLeadingSpaces(s);
01422 if (s[0] == 0)
01423     return NULL;
01424 e = skipToSpaces(s);
01425 if (e != NULL)
01426     *e++ = 0;
01427 *pLine = e;
01428 return s;
01429 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* nullIfAllSpace ( char *  s  ) 

Definition at line 1981 of file common.c.

References skipLeadingSpaces().

01983 {
01984 s = skipLeadingSpaces(s);
01985 if (s != NULL)
01986     if (s[0] == 0)
01987         s = NULL;
01988 return s;
01989 }

Here is the call graph for this function:

int positiveRangeIntersection ( int  start1,
int  end1,
int  start2,
int  end2 
)

Definition at line 1729 of file common.c.

References rangeIntersection().

Referenced by addOverlap().

01732 {
01733 int ret = rangeIntersection(start1,end1,start2,end2);
01734 if (ret < 0)
01735     ret = 0;
01736 return ret;
01737 }

Here is the call graph for this function:

Here is the caller graph for this function:

int ptArrayIx ( void *  pt,
void *  array,
int  arraySize 
)

Definition at line 1467 of file common.c.

Referenced by aliLines().

01469 {
01470 int i;
01471 void **a = array;
01472 for (i=0; i<arraySize; ++i)
01473     {
01474     if (pt == a[i])
01475         return i;
01476     }
01477 return -1;
01478 }

Here is the caller graph for this function:

int rangeIntersection ( int  start1,
int  end1,
int  start2,
int  end2 
)

Definition at line 1720 of file common.c.

References max, and min.

Referenced by binKeeperAnyOverlap(), binKeeperFind(), binKeeperFindLowest(), binKeeperReplaceVal(), positiveRangeIntersection(), pslTrimToQueryRange(), pslTrimToTargetRange(), and rBoxJoin().

01723 {
01724 int s = max(start1,start2);
01725 int e = min(end1,end2);
01726 return e-s;
01727 }

Here is the caller graph for this function:

bits64 readBits64 ( FILE *  f  ) 

Definition at line 1597 of file common.c.

References bits64, mustRead(), and UBYTE.

01599 {
01600 int i;
01601 UBYTE buf[8];
01602 bits64 x = 0;
01603 mustRead(f, buf, 8);
01604 for (i=0; i<8; ++i)
01605     {
01606     x <<= 8;
01607     x |= buf[i];
01608     }
01609 return x;
01610 }

Here is the call graph for this function:

char* readLine ( FILE *  fh  ) 

Definition at line 1779 of file common.c.

References errAbort(), freeMem(), and needMem().

01781 {
01782 int bufCapacity = 256;
01783 int bufSize = 0;
01784 char* buf = needMem(bufCapacity);
01785 int ch;
01786 
01787 /* loop until EOF of EOLN */
01788 while (((ch = getc(fh)) != EOF) && (ch != '\n'))
01789     {
01790     /* expand if almost full, always keep one extra char for
01791      * zero termination */
01792     if (bufSize >= bufCapacity-2)
01793         {
01794         bufCapacity *= 2;
01795         buf = realloc(buf, bufCapacity);
01796         if (buf == NULL)
01797             {
01798             errAbort("Out of memory in readline - request size %d bytes", bufCapacity);
01799             }
01800         }
01801     buf[bufSize++] = ch;
01802     }
01803 
01804 /* only return EOF if no data was read */
01805 if ((ch == EOF) && (bufSize == 0))
01806     {
01807     freeMem(buf);
01808     return NULL;
01809     }
01810 buf[bufSize] = '\0';
01811 return buf;
01812 }

Here is the call graph for this function:

char* readString ( FILE *  f  ) 

Definition at line 1543 of file common.c.

References mustRead(), needMem(), readOne, and UBYTE.

Referenced by mustReadString().

01546 {
01547 UBYTE bLen;
01548 int len;
01549 char *s;
01550 
01551 if (!readOne(f, bLen))
01552     return NULL;
01553 len = bLen;
01554 s = needMem(len+1);
01555 if (len > 0)
01556     mustRead(f, s, len);
01557 return s;
01558 }

Here is the call graph for this function:

Here is the caller graph for this function:

void refAdd ( struct slRef **  pRefList,
void *  val 
)

Definition at line 725 of file common.c.

References AllocVar, slAddHead, and slRef::val.

Referenced by addRef(), findOrMakeVar(), loadHashT3Ranges(), and refAddUnique().

00727 {
00728 struct slRef *ref;
00729 AllocVar(ref);
00730 ref->val = val;
00731 slAddHead(pRefList, ref);
00732 }

Here is the caller graph for this function:

void refAddUnique ( struct slRef **  pRefList,
void *  val 
)

Definition at line 734 of file common.c.

References refAdd(), and refOnList().

00736 {
00737 if (refOnList(*pRefList, val) == NULL)
00738     {
00739     refAdd(pRefList, val);
00740     }
00741 }

Here is the call graph for this function:

struct slRef* refListFromSlList ( void *  list  )  [read]

Definition at line 743 of file common.c.

References slList::next, slAddHead, slRefNew(), and slReverse().

00745 {
00746 struct slList *el;
00747 struct slRef *refList = NULL, *ref;
00748 for (el= list; el != NULL; el = el->next)
00749     {
00750     ref = slRefNew(el);
00751     slAddHead(&refList, ref);
00752     }
00753 slReverse(&refList);
00754 return refList;
00755 }

Here is the call graph for this function:

struct slRef* refOnList ( struct slRef refList,
void *  val 
) [read]

Definition at line 706 of file common.c.

References slRef::next, and slRef::val.

Referenced by refAddUnique().

00708 {
00709 struct slRef *ref;
00710 for (ref = refList; ref != NULL; ref = ref->next)
00711     if (ref->val == val)
00712         return ref;
00713 return NULL;
00714 }

Here is the caller graph for this function:

void removeReturns ( char *  dest,
char *  src 
)

Definition at line 1751 of file common.c.

01755 {
01756 int i = 0;
01757 int j = 0;
01758 
01759 /* until the end of the string */
01760 for (;;)
01761     {
01762     /* skip the returns */
01763     while(src[j] == '\r')
01764         j++;
01765 
01766     /* copy the characters */
01767     dest[i] = src[j];
01768 
01769     /* check to see if done */
01770     if(src[j] == '\0')
01771         break;
01772 
01773     /* advance the counters */
01774     i++;
01775     j++;
01776     }
01777 }

char* replaceChars ( char *  string,
char *  oldStr,
char *  newStr 
)

Definition at line 1018 of file common.c.

References max, and needMem().

Referenced by netParseUrl().

01024 {
01025 int numTimes = 0;
01026 int oldLen = strlen(old);
01027 int newLen = strlen(new);
01028 int strLen = 0;
01029 char *result = NULL;
01030 char *ptr = strstr(string, old);
01031 char *resultPtr = NULL;
01032 
01033 while(NULL != ptr)
01034     {
01035     numTimes++;
01036     ptr += oldLen;
01037     ptr = strstr(ptr, old);
01038     }
01039 strLen = max(strlen(string) + (numTimes * (newLen - oldLen)), strlen(string));
01040 result = needMem(strLen + 1);
01041 
01042 ptr = strstr(string, old);
01043 resultPtr = result;
01044 while(NULL != ptr)
01045     {
01046     strLen = ptr - string;
01047     strcpy(resultPtr, string);
01048     string = ptr + oldLen;
01049 
01050     resultPtr += strLen;
01051     strcpy(resultPtr, new);
01052     resultPtr += newLen;
01053     ptr = strstr(string, old);
01054     }
01055 
01056 strcpy(resultPtr, string);
01057 return result;
01058 }

Here is the call graph for this function:

Here is the caller graph for this function:

void reverseBytes ( char *  bytes,
long  length 
)

Definition at line 57 of file common.c.

Referenced by axtAffine2Level(), bandExt(), mafFlipStrand(), reverseComplement(), and reverseFold().

00058 {
00059 long halfLen = (length>>1);
00060 char *end = bytes+length;
00061 char c;
00062 while (--halfLen >= 0)
00063     {
00064     c = *bytes;
00065     *bytes++ = *--end;
00066     *end = c;
00067     }
00068 }

Here is the caller graph for this function:

void reverseDoubles ( double *  a,
int  length 
)

Definition at line 98 of file common.c.

00100 {
00101 int halfLen = (length>>1);
00102 double *end = a+length;
00103 double c;
00104 while (--halfLen >= 0)
00105     {
00106     c = *a;
00107     *a++ = *--end;
00108     *end = c;
00109     }
00110 }

void reverseInts ( int *  a,
int  length 
)

Definition at line 70 of file common.c.

Referenced by pslShowAlignmentStranded2().

00072 {
00073 int halfLen = (length>>1);
00074 int *end = a+length;
00075 int c;
00076 while (--halfLen >= 0)
00077     {
00078     c = *a;
00079     *a++ = *--end;
00080     *end = c;
00081     }
00082 }

Here is the caller graph for this function:

void reverseStrings ( char **  a,
int  length 
)

Definition at line 112 of file common.c.

00114 {
00115 int halfLen = (length>>1);
00116 char **end = a+length;
00117 char *c;
00118 while (--halfLen >= 0)
00119     {
00120     c = *a;
00121     *a++ = *--end;
00122     *end = c;
00123     }
00124 }

void reverseUnsigned ( unsigned *  a,
int  length 
)

Definition at line 84 of file common.c.

Referenced by pslRc(), pslRcBoth(), and swapRCBlocks().

00086 {
00087 int halfLen = (length>>1);
00088 unsigned *end = a+length;
00089 unsigned c;
00090 while (--halfLen >= 0)
00091     {
00092     c = *a;
00093     *a++ = *--end;
00094     *end = c;
00095     }
00096 }

Here is the caller graph for this function:

int roundingScale ( int  a,
int  p,
int  q 
)

Definition at line 1700 of file common.c.

References round.

Referenced by cdaAliFromFfAli(), cdaCoalesceOne(), cdaShowAlignmentTrack(), and savePslx().

01702 {
01703 if (a > 100000 || p > 100000)
01704     {
01705     double x = a;
01706     x *= p;
01707     x /= q;
01708     return round(x);
01709     }
01710 else
01711     return (a*p + q/2)/q;
01712 }

Here is the caller graph for this function:

char* rStringIn ( char *  needle,
char *  haystack 
)

Definition at line 903 of file common.c.

00905 {
00906 int nSize = strlen(needle);
00907 char *pos;
00908 for (pos = haystack + strlen(haystack) - nSize; pos >= haystack; pos -= 1)
00909     {
00910     if (memcmp(needle, pos, nSize) == 0)
00911         return pos;
00912     }
00913 return NULL;
00914 }

void safecat ( char *  buf,
size_t  bufSize,
const char *  src 
)

Definition at line 1930 of file common.c.

References errAbort().

01932 {
01933 size_t blen = strlen(buf);
01934 size_t slen = strlen(src);
01935 if (blen+slen > bufSize-1)
01936     errAbort("buffer overflow, size %lld, new string size: %lld", (long long)bufSize, (long long)(blen+slen));
01937 strcat(buf, src);
01938 }

Here is the call graph for this function:

void safecpy ( char *  buf,
size_t  bufSize,
const char *  src 
)

Definition at line 1908 of file common.c.

References errAbort().

01910 {
01911 size_t slen = strlen(src);
01912 if (slen > bufSize-1)
01913     errAbort("buffer overflow, size %lld, string size: %lld", (long long)bufSize, (long long)slen);
01914 strcpy(buf, src);
01915 }

Here is the call graph for this function:

int safef ( char *  buffer,
int  bufSize,
char *  format,
  ... 
)

Definition at line 1896 of file common.c.

References vasafef().

Referenced by cgiBooleanDefined(), cgiEncode(), cgiEncodeFull(), cgiFromCommandLine(), cgiMakeCheckBoxWithMsg(), cgiMakeClearButton(), cgiMakeHiddenBoolean(), cgiParseMultipart(), chainLookup(), chainReadUsedSwapLf(), checkNest(), checkTagIsInside(), convertEpsToPdf(), envUpdate(), evalToDouble(), fofOpen(), getFileNameFromHdrSig(), getTargetName(), gfiExpandAndLoadCached(), gfIndexNibsAndTwoBits(), gfIndexTransNibsAndTwoBits(), gfPcrGetRanges(), gifLabelVerticalText(), hashLookupUpperCase(), htmlFormCgiVars(), htmlIncludeWebFile(), mafFromAxt(), mkdirTrashDirectory(), ncbiPrintE(), netGetOpenFtp(), netHttpConnect(), netHttpGet(), nibInfoFromCache(), nibLdPartMasked(), nibOpenVerify(), nibTwoLoadOne(), parseMultiParts(), pcrQuery(), pslGetCreateSql(), pslTransMap(), readSeqFrag(), rTempName(), semiUniqName(), trixOpen(), and twoBitReadSeqFragExt().

01899 {
01900 int sz;
01901 va_list args;
01902 va_start(args, format);
01903 sz = vasafef(buffer, bufSize, format, args);
01904 va_end(args);
01905 return sz;
01906 }

Here is the call graph for this function:

Here is the caller graph for this function:

void safencat ( char *  buf,
size_t  bufSize,
const char *  src,
size_t  n 
)

Definition at line 1940 of file common.c.

References errAbort().

01942 {
01943 size_t blen = strlen(buf);
01944 if (blen+n > bufSize-1)
01945     errAbort("buffer overflow, size %lld, new string size: %lld", (long long)bufSize, (long long)(blen+n));
01946 size_t slen = strlen(src);
01947 if (slen > n)
01948     slen = n;
01949 strncat(buf, src, n);
01950 buf[blen+slen] = '\0';
01951 }

Here is the call graph for this function:

void safencpy ( char *  buf,
size_t  bufSize,
const char *  src,
size_t  n 
)

Definition at line 1917 of file common.c.

References errAbort().

01920 {
01921 if (n > bufSize-1)
01922     errAbort("buffer overflow, size %lld, substring size: %lld", (long long)bufSize, (long long)n);
01923 size_t slen = strlen(src);
01924 if (slen > n)
01925     slen = n;
01926 strncpy(buf, src, n);
01927 buf[slen] = '\0';
01928 }

Here is the call graph for this function:

char* skipLeadingSpaces ( char *  s  ) 

Definition at line 1278 of file common.c.

Referenced by axtScoreSchemeFromProteinText(), bfSkipBlankLines(), cgiInt(), cgiOptionalInt(), eatComment(), emblLineGroup(), faMixedSpeedReadNext(), firstWordInLine(), hashVarLine(), hpfNext(), htmlCookieFileRead(), htmlHeaderRead(), htmlStatusParse(), htmlTagScan(), lastWordInLine(), lineFileNextReal(), netSkipHttpHeaderLines(), netSkipHttpHeaderLinesCatch(), netUrlHead(), nextQuotedWord(), nextSeqFromMem(), nextWord(), nullIfAllSpace(), parseAttribute(), parseCookie(), parseEntity(), parseGtfEnd(), parseQueryLines(), raFoldInOneRetName(), raFromString(), raNextRecord(), stringToSlNames(), tabRowGuessFixedOffsets(), tokenizerNext(), and trimSpaces().

01280 {
01281 char c;
01282 if (s == NULL) return NULL;
01283 for (;;)
01284     {
01285     c = *s;
01286     if (!isspace(c))
01287         return s;
01288     ++s;
01289     }
01290 }

Here is the caller graph for this function:

char* skipNumeric ( char *  s  ) 

Definition at line 2035 of file common.c.

02037 {
02038 while (isdigit(*s))
02039    ++s;
02040 return s;
02041 }

char* skipToNumeric ( char *  s  ) 

Definition at line 2043 of file common.c.

Referenced by splitOffNonNumeric(), and splitOffNumber().

02045 {
02046 while (*s != 0 && !isdigit(*s))
02047     ++s;
02048 return s;
02049 }

Here is the caller graph for this function:

char* skipToSpaces ( char *  s  ) 

Definition at line 1293 of file common.c.

Referenced by firstWordInLine(), hashVarLine(), htmlStatusParse(), lastWordInLine(), nextSeqFromMem(), nextWord(), stringToSlNames(), and tabRowGuessFixedOffsets().

01294 {
01295 char c;
01296 if (s == NULL)
01297     return NULL;
01298 for (;;)
01299     {
01300     c = *s;
01301     if (c == 0)
01302         return NULL;
01303     if (isspace(c))
01304         return s;
01305     ++s;
01306     }
01307 }

Here is the caller graph for this function:

void slAddTail ( void *  listPt,
void *  node 
)

Definition at line 200 of file common.c.

References slList::next.

Referenced by asParseTokens(), dgFindPath(), gffReadGenes(), gfRangesBundle(), gfWebConfigRead(), hpfNext(), htmlFormVarAddValue(), htmlHeaderRead(), htmlTagScan(), loadHashT3Ranges(), parseAttribute(), parseMultiOption(), pipelineNew(), slNameAddTail(), spaceSaverAddOverflow(), wormGeneToOrfNames(), and wormGetSomeGdfGeneList().

00201 {
00202 struct slList **ppt = (struct slList **)listPt;
00203 struct slList *n = (struct slList *)node;
00204 
00205 while (*ppt != NULL)
00206     {
00207     ppt = &((*ppt)->next);
00208     }
00209 n->next = NULL; 
00210 *ppt = n;
00211 }

Here is the caller graph for this function:

void* slCat ( void *  a,
void *  b 
)

Definition at line 265 of file common.c.

References slList::next.

Referenced by addToBigBundleList(), boxLump(), clumpHits(), gfAlignTrans(), gfAlignTransTrans(), gfClientSeqList(), gfTransTransFindBundles(), mergeClusters(), and xenAlignWorm().

00267                 :
00268  *   struct slName *a = getNames("a");
00269  *   struct slName *b = getNames("b");
00270  *   struct slName *ab = slCat(a,b)
00271  */
00272 {
00273 struct slList *a = va;
00274 struct slList *b = vb;
00275 struct slList *end;
00276 if (a == NULL)
00277     return b;
00278 for (end = a; end->next != NULL; end = end->next)
00279     ;
00280 end->next = b;
00281 return a;
00282 }

Here is the caller graph for this function:

int slCount ( void *  list  ) 

List managing routines.

Definition at line 144 of file common.c.

References slList::next.

Referenced by bigBlat(), blat(), boxLump(), chainToPsl(), dlCount(), dnaSeqHash(), dumpBuns(), fofMake(), gffDupeGeneAndSurrounds(), gffPrintInfo(), gfHitSortDiagonal(), gfLargeIndexSeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfSmallIndexSeq(), hpfNext(), kdTreeMake(), mafColMinMaxScore(), makeIndex(), phhmTraceToAxt(), rBoxJoin(), shuffleList(), slDoubleMedian(), slSort(), spacedColumnFromSizeCommaList(), tabRowByFixedOffsets(), twoBitWriteHeader(), wuBlastOut(), and xenAlignWorm().

00145 {
00146 struct slList *pt = (struct slList *)list;
00147 int len = 0;
00148 
00149 while (pt != NULL)
00150     {
00151     len += 1;
00152     pt = pt->next;
00153     }
00154 return len;
00155 }

Here is the caller graph for this function:

int slDoubleCmp ( const void *  va,
const void *  vb 
)

Definition at line 467 of file common.c.

References slDouble::val.

00469 {
00470 const struct slDouble *a = *((struct slDouble **)va);
00471 const struct slDouble *b = *((struct slDouble **)vb);
00472 double diff = a->val - b->val;
00473 if (diff < 0)
00474     return -1;
00475 else if (diff > 0)
00476     return 1;
00477 else
00478     return 0;
00479 }

double slDoubleMedian ( struct slDouble list  ) 

Definition at line 481 of file common.c.

References AllocArray, doubleMedian(), errAbort(), freeMem(), slDouble::next, and slCount().

00483 {
00484 int i,count = slCount(list);
00485 struct slDouble *el;
00486 double *array, median;
00487 if (count == 0)
00488     errAbort("Can't take median of empty list");
00489 AllocArray(array,count);
00490 for (i=0, el=list; i<count; ++i, el=el->next)
00491     array[i] = el->val;
00492 median = doubleMedian(count, array);
00493 freeMem(array);
00494 return median;
00495 }

Here is the call graph for this function:

struct slDouble* slDoubleNew ( double  x  )  [read]

Definition at line 458 of file common.c.

References AllocVar, and slDouble::val.

00460 {
00461 struct slDouble *a;
00462 AllocVar(a);
00463 a->val = x;
00464 return a;
00465 }

void* slElementFromIx ( void *  list,
int  ix 
)

Definition at line 157 of file common.c.

References slList::next.

00160 {
00161 struct slList *pt = (struct slList *)list;
00162 int i;
00163 for (i=0;i<ix;i++)
00164     {
00165     if (pt == NULL) return NULL;
00166     pt = pt->next;
00167     }
00168 return pt;
00169 }

void slFreeList ( void *  listPt  ) 

Definition at line 305 of file common.c.

References freeMem(), and slList::next.

Referenced by axtAffine(), binKeeperFree(), boxClumpFree(), chainFree(), connectedComponents(), dgNodeFree(), doubleExp(), ffFreeAli(), gfAlignTrans(), gfAlignTransTrans(), gffFileFree(), gffGroupFree(), gfxPolyFree(), hashElFreeList(), hpfModelFree(), hpfNext(), htmlFormVarFree(), lmCleanup(), mergeAdd(), pcrClumps(), psOneColumn(), psPolyFree(), saveAliToPermanentMem(), spacedColumnFromSizeCommaList(), spaceSaverFree(), ssFindBundles(), ssStitch(), tabRowByFixedGuess(), targetHitsFree(), validateCgiUrls(), wormChromPartExonsUpper(), wormGdfGenesInRange(), wormGeneFirstOrfName(), wormGeneRange(), xenAlignBig(), xenAlignWorm(), and xStitch().

00307 {
00308 struct slList **ppt = (struct slList**)listPt;
00309 struct slList *next = *ppt;
00310 struct slList *el;
00311 
00312 while (next != NULL)
00313     {
00314     el = next;
00315     next = el->next;
00316     freeMem((char*)el);
00317     }
00318 *ppt = NULL;
00319 }

Here is the call graph for this function:

Here is the caller graph for this function:

int slIntCmp ( const void *  va,
const void *  vb 
)

Definition at line 405 of file common.c.

References slInt::val.

00407 {
00408 const struct slInt *a = *((struct slInt **)va);
00409 const struct slInt *b = *((struct slInt **)vb);
00410 return a->val - b->val;
00411 }

int slIntCmpRev ( const void *  va,
const void *  vb 
)

Definition at line 413 of file common.c.

References slInt::val.

00415 {
00416 const struct slInt *a = *((struct slInt **)va);
00417 const struct slInt *b = *((struct slInt **)vb);
00418 return b->val - a->val;
00419 }

struct slInt* slIntNew ( int  x  )  [read]

Definition at line 396 of file common.c.

References AllocVar, and slInt::val.

00398 {
00399 struct slInt *a;
00400 AllocVar(a);
00401 a->val = x;
00402 return a;
00403 }

int slIxFromElement ( void *  list,
void *  el 
)

Definition at line 171 of file common.c.

References slList::next.

00173 {
00174 struct slList *pt;
00175 int ix = 0;
00176 
00177 for (pt = list, ix=0; pt != NULL; pt = pt->next, ++ix)
00178     if (el == (void*)pt)
00179         return ix;
00180 return -1;
00181 }

void* slLastEl ( void *  list  ) 

Definition at line 183 of file common.c.

References slList::next.

Referenced by chainCalcBounds().

00185 {
00186 struct slList *next, *el;
00187 if ((el = list) == NULL)
00188     return NULL;
00189 while ((next = el->next) != NULL)
00190     el = next;
00191 return el;
00192 }

Here is the caller graph for this function:

struct slName* slNameAddHead ( struct slName **  pList,
char *  name 
) [read]

Definition at line 638 of file common.c.

References slAddHead, and slNameNew.

00640 {
00641 struct slName *el = slNameNew(name);
00642 slAddHead(pList, el);
00643 return el;
00644 }

struct slName* slNameAddTail ( struct slName **  pList,
char *  name 
) [read]

Definition at line 646 of file common.c.

References slAddTail(), and slNameNew.

00649 {
00650 struct slName *el = slNameNew(name);
00651 slAddTail(pList, el);
00652 return el;
00653 }

Here is the call graph for this function:

struct slName* slNameCloneList ( struct slName list  )  [read]

Definition at line 655 of file common.c.

References slName::name, slName::next, slAddHead, slNameNew, and slReverse().

00657 {
00658 struct slName *el, *newEl, *newList = NULL;
00659 for (el = list; el != NULL; el = el->next)
00660     {
00661     newEl = slNameNew(el->name);
00662     slAddHead(&newList, newEl);
00663     }
00664 slReverse(&newList);
00665 return newList;
00666 }

Here is the call graph for this function:

int slNameCmp ( const void *  va,
const void *  vb 
)

Definition at line 575 of file common.c.

References slName::name.

Referenced by slNameSort().

00577 {
00578 const struct slName *a = *((struct slName **)va);
00579 const struct slName *b = *((struct slName **)vb);
00580 return strcmp(a->name, b->name);
00581 }

Here is the caller graph for this function:

int slNameCmpCase ( const void *  va,
const void *  vb 
)

Definition at line 561 of file common.c.

References slName::name.

Referenced by slNameSortCase().

00563 {
00564 const struct slName *a = *((struct slName **)va);
00565 const struct slName *b = *((struct slName **)vb);
00566 return strcasecmp(a->name, b->name);
00567 }

Here is the caller graph for this function:

void* slNameFind ( void *  list,
char *  string 
)

Definition at line 599 of file common.c.

References slName::name, slName::next, and sameWord.

00602 {
00603 struct slName *el;
00604 for (el = list; el != NULL; el = el->next)
00605     if (sameWord(string, el->name))
00606         return el;
00607 return NULL;
00608 }

int slNameFindIx ( struct slName list,
char *  string 
)

Definition at line 610 of file common.c.

References slName::name, slName::next, and sameString.

00614 {
00615 struct slName *el;
00616 int ix = 0;
00617 for (el = list; el != NULL; el = el->next, ix++)
00618     if (sameString(string, el->name))
00619         return ix;
00620 return -1;
00621 }

boolean slNameInList ( struct slName list,
char *  string 
)

Definition at line 589 of file common.c.

References FALSE, slName::name, slName::next, sameWord, and TRUE.

Referenced by kvtWriteAll().

00591 {
00592 struct slName *el;
00593 for (el = list; el != NULL; el = el->next)
00594     if (sameWord(string, el->name))
00595         return TRUE;
00596 return FALSE;
00597 }

Here is the caller graph for this function:

struct slName* slNameListFromString ( char *  s,
char  delimiter 
) [read]

Definition at line 668 of file common.c.

References slAddHead, slNameNew, slNameNewN(), and slReverse().

00672 {
00673 char *e;
00674 struct slName *list = NULL, *el;
00675 while (s != NULL && s[0] != 0)
00676     {
00677     e = strchr(s, delimiter);
00678     if (e == NULL)
00679         el = slNameNew(s);
00680     else
00681         {
00682         el = slNameNewN(s, e-s);
00683         e += 1;
00684         }
00685     slAddHead(&list, el);
00686     s = e;
00687     }
00688 slReverse(&list);
00689 return list;
00690 }

Here is the call graph for this function:

struct slName* slNameLoadReal ( char *  fileName  )  [read]

Definition at line 692 of file common.c.

References lineFileClose(), lineFileNextReal(), lineFileOpen(), slNameNew, slReverse(), slSafeAddHead(), and TRUE.

00695 {
00696 struct slName *lines = NULL;
00697 char *line;
00698 struct lineFile *lf = lineFileOpen(fileName, TRUE);
00699 while (lineFileNextReal(lf, &line))
00700     slSafeAddHead(&lines, slNameNew(line));
00701 lineFileClose(&lf);
00702 slReverse(&lines);
00703 return lines;
00704 }

Here is the call graph for this function:

struct slName* slNameNewN ( char *  name,
int  size 
) [read]

Definition at line 553 of file common.c.

References needMem().

Referenced by charSepToSlNames(), and slNameListFromString().

00555 {
00556 struct slName *sn = needMem(sizeof(*sn) + size);
00557 memcpy(sn->name, name, size);
00558 return sn;
00559 }

Here is the call graph for this function:

Here is the caller graph for this function:

void slNameSort ( struct slName **  pList  ) 

Definition at line 583 of file common.c.

References slNameCmp(), and slSort().

Referenced by listDir().

00585 {
00586 slSort(pList, slNameCmp);
00587 }

Here is the call graph for this function:

Here is the caller graph for this function:

void slNameSortCase ( struct slName **  pList  ) 

Definition at line 569 of file common.c.

References slNameCmpCase(), and slSort().

00571 {
00572 slSort(pList, slNameCmpCase);
00573 }

Here is the call graph for this function:

char* slNameStore ( struct slName **  pList,
char *  string 
)

Definition at line 623 of file common.c.

References slName::name, newSlName(), slName::next, sameString, and slAddHead.

00626 {
00627 struct slName *el;
00628 for (el = *pList; el != NULL; el = el->next)
00629     {
00630     if (sameString(string, el->name))
00631         return el->name;
00632     }
00633 el = newSlName(string);
00634 slAddHead(pList, el);
00635 return el->name;
00636 }

Here is the call graph for this function:

void slPairAdd ( struct slPair **  pList,
char *  name,
void *  val 
)

Definition at line 768 of file common.c.

References slAddHead, and slPairNew().

00770 {
00771 struct slPair *el = slPairNew(name, val);
00772 slAddHead(pList, el);
00773 }

Here is the call graph for this function:

struct slPair* slPairFind ( struct slPair list,
char *  name 
) [read]

Definition at line 814 of file common.c.

References slPair::name, slPair::next, and sameString.

Referenced by slPairFindVal().

00816 {
00817 struct slPair *el;
00818 for (el = list; el != NULL; el = el->next)
00819     if (sameString(name, el->name))
00820         break;
00821 return el;
00822 }

Here is the caller graph for this function:

void* slPairFindVal ( struct slPair list,
char *  name 
)

Definition at line 824 of file common.c.

References slPairFind(), and slPair::val.

00826 {
00827 struct slPair *el = slPairFind(list, name);
00828 if (el == NULL)
00829     return NULL;
00830 return el->val;
00831 }

Here is the call graph for this function:

void slPairFree ( struct slPair **  pEl  ) 

Definition at line 775 of file common.c.

References freeMem(), freez(), and slPair::name.

Referenced by slPairFreeList().

00777 {
00778 struct slPair *el = *pEl;
00779 if (el != NULL)
00780     {
00781     freeMem(el->name);
00782     freez(pEl);
00783     }
00784 }

Here is the call graph for this function:

Here is the caller graph for this function:

void slPairFreeList ( struct slPair **  pList  ) 

Definition at line 786 of file common.c.

References slPair::next, and slPairFree().

Referenced by slPairFreeValsAndList().

00788 {
00789 struct slPair *el, *next;
00790 
00791 for (el = *pList; el != NULL; el = next)
00792     {
00793     next = el->next;
00794     slPairFree(&el);
00795     }
00796 *pList = NULL;
00797 }

Here is the call graph for this function:

Here is the caller graph for this function:

void slPairFreeVals ( struct slPair list  ) 

Definition at line 799 of file common.c.

References freez(), slPair::next, and slPair::val.

Referenced by slPairFreeValsAndList().

00801 {
00802 struct slPair *el;
00803 for (el = list; el != NULL; el = el->next)
00804     freez(&el->val);
00805 }

Here is the call graph for this function:

Here is the caller graph for this function:

void slPairFreeValsAndList ( struct slPair **  pList  ) 

Definition at line 807 of file common.c.

References slPairFreeList(), and slPairFreeVals().

00809 {
00810 slPairFreeVals(*pList);
00811 slPairFreeList(pList);
00812 }

Here is the call graph for this function:

struct slPair* slPairNew ( char *  name,
void *  val 
) [read]

Definition at line 758 of file common.c.

References AllocVar, cloneString(), slPair::name, and slPair::val.

Referenced by slPairAdd().

00760 {
00761 struct slPair *el;
00762 AllocVar(el);
00763 el->name = cloneString(name);
00764 el->val = val;
00765 return el;
00766 }

Here is the call graph for this function:

Here is the caller graph for this function:

void* slPopHead ( void *  listPt  ) 

Definition at line 229 of file common.c.

References slList::next.

Referenced by slUniqify(), and twoBitSpecFree().

00231 {
00232 struct slList **listPt = (struct slList **)vListPt;
00233 struct slList *el = *listPt;
00234 if (el != NULL)
00235     {
00236     *listPt = el->next;
00237     el->next = NULL;
00238     }
00239 return el;
00240 }

Here is the caller graph for this function:

void* slPopTail ( void *  listPt  ) 

Definition at line 242 of file common.c.

References slList::next.

00244 {
00245 struct slList **listPt = (struct slList **)vListPt;
00246 struct slList *el = *listPt;
00247 if (el != NULL)
00248     {
00249     for (;;)
00250         {
00251         if (el->next == NULL)
00252             {
00253             *listPt = NULL;
00254             break;
00255             }
00256         listPt = &el->next;
00257         el = el->next;
00258         }
00259     }
00260 return el;
00261 }

struct slRef* slRefNew ( void *  val  )  [read]

Definition at line 716 of file common.c.

References AllocVar, and slRef::val.

Referenced by refListFromSlList().

00718 {
00719 struct slRef *ref;
00720 AllocVar(ref);
00721 ref->val = val;
00722 return ref;
00723 }

Here is the caller graph for this function:

boolean slRemoveEl ( void *  vpList,
void *  vToRemove 
)

Definition at line 371 of file common.c.

References FALSE, slList::next, slAddHead, slReverse(), and TRUE.

Referenced by cgiVarExclude(), hashRemove(), and mafMoveComponentToTop().

00372                                                  :
00373  *    slRemove(&list, el);  
00374  * Returns TRUE if element in list.  */
00375 {
00376 struct slList **pList = vpList;
00377 struct slList *toRemove = vToRemove;
00378 struct slList *el, *next, *newList = NULL;
00379 boolean didRemove = FALSE;
00380 
00381 for (el = *pList; el != NULL; el = next)
00382     {
00383     next = el->next;
00384     if (el != toRemove)
00385         {
00386         slAddHead(&newList, el);
00387         }
00388     else
00389         didRemove = TRUE;
00390     }
00391 slReverse(&newList);
00392 *pList = newList;
00393 return didRemove;
00394 }

Here is the call graph for this function:

Here is the caller graph for this function:

void slReverse ( void *  listPt  ) 

Definition at line 284 of file common.c.

References slList::next.

Referenced by aliLines(), asParseColSymSpec(), asParseTableDef(), blastFileNextGapped(), blastFileNextQuery(), blastFileReadAll(), cgiParseInputAbort(), cgiParseMultipart(), chainMergeAbutting(), chainReadBlocks(), chainSubsetOnQ(), chainSwap(), chainToAxt(), charSepToSlNames(), clumpHits(), clumpNear(), crudeAliFind(), dgConstrainedPriorityOrder(), dnaLoadAll(), dtdParse(), faReadAllMixableInLf(), faSeqListFromMemText(), faSeqListFromMemTextRaw(), fastMapClumpsToBundles(), ffAliSort(), findMultipleWordHits(), fixDirectionAndOffsets(), formParseVars(), getHitsFromServer(), gfAlignSomeClumps(), gfAlignTrans(), gfAlignTransTrans(), gfClumpsToBundles(), gffFileAdd(), gffGroupLines(), gfFindAlignAaTrans(), gfHitSortDiagonal(), gfPcrGetRanges(), gfPcrInputLoadAll(), gfPcrViaNet(), gfQuerySeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), gfTransTransFindBundles(), htmlCookieFileRead(), htmlPageScanAttribute(), htmlTagScan(), kxTokenizeFancy(), mafNextWithPos(), mafReadAll(), mafSubsetE(), makeOffsetList(), mergeHits(), parseCookies(), parseElement(), parseMultiParts(), pslLoadAll(), rangeTreeAllOverlapping(), rangeTreeList(), rbTreeItems(), rbTreeItemsInRange(), readAllLines(), refListFromSlList(), removeNegativeBlocks(), saveAxtBundle(), scanChromOffsetFile(), seqClumpToRangeList(), seqListToTrans3List(), shuffleList(), slNameCloneList(), slNameListFromString(), slNameLoadReal(), slRemoveEl(), slSort(), slUniqify(), spacedColumnFromSample(), spacedColumnFromWidthArray(), spaceSaverFinish(), ssGraphMake(), ssStitch(), stringToSlNames(), tabRowByFixedOffsets(), tabRowByWhite(), tabRowGuessFixedOffsets(), targetClump(), trixParseHitList(), trixSearch(), twoBitFromFile(), twoBitLoadAll(), twoBitOpen(), twoBitSeqNames(), twoBitSpecNew(), twoBitSpecNewFile(), wormCdaAlisInRange(), wormGdfGenesInRange(), wormGetSomeGdfGeneList(), xAliLoadAll(), and xaRdRange().

00286         :
00287  *    slReverse(&list);
00288  */
00289 {
00290 struct slList **ppt = (struct slList **)listPt;
00291 struct slList *newList = NULL;
00292 struct slList *el, *next;
00293 
00294 next = *ppt;
00295 while (next != NULL)
00296     {
00297     el = next;
00298     next = el->next;
00299     el->next = newList;
00300     newList = el;
00301     }
00302 *ppt = newList;
00303 }

Here is the caller graph for this function:

void slSafeAddHead ( void *  listPt,
void *  node 
)

Definition at line 219 of file common.c.

References slList::next.

Referenced by asParseColSymSpec(), slNameLoadReal(), twoBitLoadAll(), twoBitSpecNew(), and twoBitSpecNewFile().

00220 {
00221 struct slList **ppt = (struct slList **)listPt;
00222 struct slList *n = (struct slList *)node;
00223 
00224 n->next = *ppt; 
00225 *ppt = n; 
00226 }

Here is the caller graph for this function:

void slSort ( void *  pList,
CmpFunction compare 
)

Referenced by aliLines(), binKeeperFindSorted(), chainBlocks(), clumpHits(), clumpNear(), fastMapClumpsToBundles(), ffAliSort(), ffSeedExtInMem(), fofBatchFind(), fofMake(), gfAlignSomeClumps(), gfAlignStrand(), gfAlignTrans(), gfAlignTransTrans(), gfClumpComputeQueryCoverage(), gfClumpsToBundles(), gffGroupLines(), gfFindAlignAaTrans(), gfTransTransFindBundles(), hashToRaString(), letterProbFromMotifColumn(), listDirX(), lumpOneDimension(), slNameSort(), slNameSortCase(), slUniqify(), thinProtoList(), and trixSearch().

Here is the caller graph for this function:

void slUniqify ( void *  pList,
CmpFunction compare,
void(*)()  free 
)

void spaceOut ( FILE *  f,
int  count 
)

Definition at line 1357 of file common.c.

Referenced by axtPrintTraditional(), and rTreeDump().

01359 {
01360 while (--count >= 0)
01361     fputc(' ', f);
01362 }

Here is the caller graph for this function:

char* splitOffNonNumeric ( char *  s  ) 

Definition at line 2051 of file common.c.

References cloneStringZ(), and skipToNumeric().

02053 {
02054 return cloneStringZ(s,skipToNumeric(s)-s);
02055 }

Here is the call graph for this function:

char* splitOffNumber ( char *  db  ) 

Definition at line 2057 of file common.c.

References cloneString(), and skipToNumeric().

02059 {
02060 return cloneString(skipToNumeric(db));
02061 }

Here is the call graph for this function:

void splitPath ( char *  path,
char  dir[256],
char  name[128],
char  extension[64] 
)

Definition at line 11 of file filePath.c.

Referenced by gfFindNamedSource(), gfiGetSeqName(), nibParseName(), and setProgram().

00016 {
00017 char *dirStart, *nameStart, *extStart, *extEnd;
00018 int dirSize, nameSize, extSize;
00019 
00020 undosPath(path);
00021 dirStart = path;
00022 nameStart = strrchr(path,'/');
00023 if (nameStart == NULL)
00024     nameStart = path;
00025 else
00026     nameStart += 1;
00027 extStart = strrchr(nameStart, '.');
00028 if (extStart == NULL)
00029     extStart = nameStart + strlen(nameStart);
00030 extEnd = extStart + strlen(extStart);
00031 if ((dirSize = (nameStart - dirStart)) >= 256)
00032     errAbort("Directory too long in %s", path);
00033 if ((nameSize = (extStart - nameStart)) >= 128)
00034     errAbort("Name too long in %s", path);
00035 if ((extSize = (extEnd - extStart)) >= 64)
00036     errAbort("Extension too long in %s", path);
00037 if (dir != NULL)
00038     {
00039     memcpy(dir, dirStart, dirSize);
00040     dir[dirSize] = 0;
00041     }
00042 if (name != NULL)
00043     {
00044     memcpy(name, nameStart, nameSize);
00045     name[nameSize] = 0;
00046     }
00047 if (extension != NULL)
00048     {
00049     memcpy(extension, extStart, extSize);
00050     extension[extSize] = 0;
00051     }
00052 }

Here is the caller graph for this function:

void starOut ( FILE *  f,
int  count 
)

Definition at line 1364 of file common.c.

01366 {
01367 while (--count >= 0)
01368     fputc('*', f);
01369 }

boolean startsWith ( char *  start,
char *  string 
)

Definition at line 875 of file common.c.

References FALSE, and TRUE.

Referenced by aliLines(), bfSearchForLine(), blastFileNextGapped(), cgiParseMultipart(), codonLoadBias(), dtdParse(), emblLineGroup(), expandRelativePath(), getFileNameFromHdrSig(), getPostInput(), gffTnName(), gfPcrGetRanges(), gfQuerySeq(), gfQuerySeqTrans(), gfQuerySeqTransTrans(), hpfNext(), htmlExpandUrl(), htmlPageParse(), htmlPageValidateOrAbort(), initCgiInput(), lineFileParseHttpHeader(), lineFileSkipToLineStartingWith(), lineFileSlurpHttpBody(), mafMayFindCompPrefix(), mafMayFindCompSpecies(), mafMayOpen(), maskFromOut(), mgLoadGif(), netLineFileMayOpen(), netLineFileMayOpenCatchError(), netSkipHttpHeaderLines(), netSkipHttpHeaderLinesCatch(), netUrlHead(), netUrlOpen(), nextBlock(), nextBlockLine(), parseAnOption(), parseMultiParts(), parseSubTree(), pcrServer(), pslOutFormat(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), qaCountBetween(), queryServer(), raNextRecord(), reasonablePrefix(), startServer(), stripString(), trixSearchWordResults(), and validateCgiUrl().

00877 {
00878 char c;
00879 int i;
00880 
00881 for (i=0; ;i += 1)
00882     {
00883     if ((c = start[i]) == 0)
00884         return TRUE;
00885     if (string[i] != c)
00886         return FALSE;
00887     }
00888 }

Here is the caller graph for this function:

boolean startsWithWord ( char *  firstWord,
char *  line 
)

Definition at line 890 of file common.c.

References FALSE.

00893 {
00894 int len = strlen(firstWord);
00895 int i;
00896 for (i=0; i<len; ++i)
00897    if (firstWord[i] != line[i])
00898        return FALSE;
00899 char c = line[len];
00900 return c == 0 || isspace(c);
00901 }

int stringArrayIx ( char *  string,
char *  array[],
int  arraySize 
)

Definition at line 1457 of file common.c.

References differentWord().

Referenced by gfOutputAny().

01459 {
01460 int i;
01461 for (i=0; i<arraySize; ++i)
01462     if (!differentWord(array[i], string))
01463         return i;
01464 return -1;
01465 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* stringBetween ( char *  start,
char *  end,
char *  haystack 
)

Definition at line 916 of file common.c.

References cloneMem(), and stringIn.

00920 {
00921 char *pos, *p;
00922 int len;
00923 if ((p = stringIn(start, haystack)) != NULL)
00924     {
00925     pos = p + strlen(start);
00926     if ((p = stringIn(end, pos)) != NULL)
00927         {
00928         len = p - pos;
00929         pos = cloneMem(pos, len + 1);
00930         pos[len] = 0;
00931         return pos;
00932         }
00933     }
00934 return NULL;
00935 }

Here is the call graph for this function:

void stripChar ( char *  s,
char  c 
)

Definition at line 1086 of file common.c.

Referenced by axtScoreSchemeDnaWrite().

01088 {
01089 char *in = s, *out = s;
01090 char b;
01091 
01092 for (;;)
01093     {
01094     b = *out = *in++;
01095     if (b == 0)
01096        break;
01097     if (b != c)
01098        ++out;
01099     }
01100 }

Here is the caller graph for this function:

void stripString ( char *  s,
char *  strip 
)

Definition at line 1102 of file common.c.

References startsWith().

01104 {
01105 char c, *in = s, *out = s;
01106 int stripSize = strlen(strip);
01107 char stripFirst = strip[0];
01108 
01109 while ((c = *in) != 0)
01110     {
01111     c = *in;
01112     if (c == stripFirst)
01113         {
01114         if (startsWith(strip, in))
01115             {
01116             in += stripSize;
01117             continue;
01118             }
01119         }
01120     *out = c;
01121     ++out;
01122     ++in;
01123     }
01124 *out = 0;
01125 }

Here is the call graph for this function:

char* strstrNoCase ( char *  haystack,
char *  needle 
)

Definition at line 1833 of file common.c.

References freeMem(), and needMem().

Referenced by containsStringNoCase().

01843 {
01844 char *haystackCopy = NULL;
01845 char *needleCopy = NULL;
01846 int index = 0;
01847 int haystackLen = 0;
01848 int needleLen = 0;
01849 char *p, *q;
01850 
01851 if (NULL == haystack || NULL == needle) 
01852     {
01853     return NULL;
01854     }
01855 
01856 haystackLen = strlen(haystack);
01857 needleLen = strlen(needle);
01858 
01859 haystackCopy = (char*) needMem(haystackLen + 1);
01860 needleCopy = (char*) needMem(needleLen + 1);
01861 
01862 for(index = 0; index < haystackLen;  index++)
01863     {
01864     haystackCopy[index] = tolower(haystack[index]);
01865     }
01866 haystackCopy[haystackLen] = 0; /* Null terminate */
01867 
01868 for(index = 0; index < needleLen;  index++)
01869     {
01870     needleCopy[index] = tolower(needle[index]);
01871     }
01872 needleCopy[needleLen] = 0; /* Null terminate */
01873 
01874 p=strstr(haystackCopy, needleCopy);
01875 q=haystackCopy;
01876  
01877 freeMem(haystackCopy);
01878 freeMem(needleCopy);
01879 
01880 if(p==NULL) return NULL;
01881 
01882 return p-q+haystack;
01883 }

Here is the call graph for this function:

Here is the caller graph for this function:

void subChar ( char *  s,
char  oldChar,
char  newChar 
)

Definition at line 1071 of file common.c.

Referenced by qaStatusOnPage(), semiUniqName(), and undosPath().

01073 {
01074 char c;
01075 for (;;)
01076     {
01077     c = *s;
01078     if (c == 0)
01079         break;
01080     if (c == oldChar)
01081         *s = newChar;
01082     ++s;
01083     }
01084 }

Here is the caller graph for this function:

void swapBytes ( char *  a,
char *  b,
int  length 
)

Definition at line 127 of file common.c.

00128 {
00129 char c;
00130 int i;
00131 
00132 for (i=0; i<length; ++i)
00133     {
00134     c = a[i];
00135     a[i] = b[i];
00136     b[i] = c;
00137     }
00138 }

void toggleCase ( char *  s,
int  size 
)

Definition at line 990 of file common.c.

Referenced by bigBlat(), maskNucSeqList(), maskQuerySeq(), readMaskedNib(), and readMaskedTwoBit().

00992 {
00993 char c;
00994 int i;
00995 for (i=0; i<size; ++i)
00996     {
00997     c = s[i];
00998     if (isupper(c))
00999         c = tolower(c);
01000     else if (islower(c))
01001         c = toupper(c);
01002     s[i] = c;
01003     }
01004 }

Here is the caller graph for this function:

void toLowerN ( char *  s,
int  n 
)

Definition at line 982 of file common.c.

Referenced by bigBlat(), doBlat(), gfMakeOoc(), trixFindIndexStartLine(), and twoBitReadSeqFragExt().

00984 {
00985 int i;
00986 for (i=0; i<n; ++i)
00987     s[i] = tolower(s[i]);
00988 }

Here is the caller graph for this function:

void tolowers ( char *  s  ) 

Definition at line 1060 of file common.c.

Referenced by bafWriteLine(), gfPcrClumps(), gfPcrOneViaNet(), netParseUrl(), outputFa(), pslShowAlignmentStranded(), pslShowAlignmentStranded2(), readPartHeaderMB(), wormFixupOrfName(), and wormGeneToOrfNames().

01062 {
01063 char c;
01064 for (;;)
01065     {
01066     if ((c = *s) == 0) break;
01067     *s++ = tolower(c);
01068     }
01069 }

Here is the caller graph for this function:

void toUpperN ( char *  s,
int  n 
)

Definition at line 974 of file common.c.

Referenced by bigBlat(), gdfUpcExons(), getWormGeneDna(), maskFromOut(), twoBitReadSeqFragExt(), and wormFixupOrfName().

00976 {
00977 int i;
00978 for (i=0; i<n; ++i)
00979     s[i] = toupper(s[i]);
00980 }

Here is the caller graph for this function:

void touppers ( char *  s  ) 

Definition at line 1007 of file common.c.

Referenced by checkTagIsInside(), hashLookupUpperCase(), htmlPageValidateOrAbort(), oligoTm(), outputFa(), parseMultiParts(), rnaPair(), and wormGeneRange().

01009 {
01010 char c;
01011 for (;;)
01012     {
01013     if ((c = *s) == 0) break;
01014     *s++ = toupper(c);
01015     }
01016 }

Here is the caller graph for this function:

char* trimSpaces ( char *  s  ) 

Definition at line 1346 of file common.c.

References eraseTrailingSpaces(), and skipLeadingSpaces().

Referenced by dnaLoadNextFromStack(), dnaLoadStackNew(), dtdParse(), dtdxTag(), firstWordInFile(), gfWebConfigRead(), netParseUrl(), readPartHeaderMB(), spacedColumnParseLine(), tabRowByFixedOffsets(), textOutInit(), and twoBitSpecNewFile().

01348 {
01349 if (s != NULL)
01350     {
01351     s = skipLeadingSpaces(s);
01352     eraseTrailingSpaces(s);
01353     }
01354 return s;
01355 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* trueFalseString ( boolean  b  ) 

Definition at line 1991 of file common.c.

01993 {
01994 return (b ? "true" : "false");
01995 }

void uglyTime ( char *  label,
  ... 
)

Definition at line 1997 of file common.c.

References clock1000().

02000 {
02001 static long lastTime = 0;
02002 long time = clock1000();
02003 va_list args;
02004 va_start(args, label);
02005 if (label != NULL)
02006     {
02007     vfprintf(stdout, label, args);
02008     fprintf(stdout, ": %ld millis<BR>\n", time - lastTime);
02009     }
02010 lastTime = time;
02011 va_end(args);
02012 }

Here is the call graph for this function:

int vasafef ( char *  buffer,
int  bufSize,
char *  format,
va_list  args 
)

Definition at line 1885 of file common.c.

References errAbort().

Referenced by safef().

01888 {
01889 int sz = vsnprintf(buffer, bufSize, format, args);
01890 /* note that some version return -1 if too small */
01891 if ((sz < 0) || (sz >= bufSize))
01892     errAbort("buffer overflow, size %d, format: %s", bufSize, format);
01893 return sz;
01894 }

Here is the call graph for this function:

Here is the caller graph for this function:

void verbose ( int  verbosity,
char *  format,
  ... 
)

Definition at line 28 of file verbose.c.

Referenced by bfNextLine(), blastFileNextGapped(), blastFileNextQuery(), gapCalcFromFile(), gapCalcTest(), hardRefineSplice(), htmlNextCrLfLine(), htmlPageFromForm(), isMonotonic(), maskQuerySeq(), nextBlock(), and verboseDot().

00032 {
00033 va_list args;
00034 va_start(args, format);
00035 verboseVa(verbosity, format, args);
00036 va_end(args);
00037 }

Here is the caller graph for this function:

void verboseDot (  ) 

Definition at line 64 of file verbose.c.

00066 {
00067 if (verboseDotsEnabled())
00068     verbose(1, ".");
00069 }

int verboseLevel (  ) 

Definition at line 79 of file verbose.c.

Referenced by badFormat(), and blastFileNextQuery().

00081 {
00082 return logVerbosity;
00083 }

Here is the caller graph for this function:

void verboseSetLevel ( int  verbosity  ) 

Definition at line 71 of file verbose.c.

Referenced by setOptions().

00074 {
00075 logVerbosity = verbosity;
00076 checkedDotsEnabled = FALSE; /* force rechecking of dots enabled */
00077 }

Here is the caller graph for this function:

void* wantMem ( size_t  size  ) 

Definition at line 203 of file memalloc.c.

References memHandler::alloc, and mhStack.

Referenced by gffReadDna().

00206 {
00207 return mhStack->alloc(size);
00208 }

Here is the caller graph for this function:

void warn ( char *  format,
  ... 
)

Definition at line 40 of file errabort.c.

Referenced by axtCheck(), badFormat(), bigBlat(), cgiParseMultipart(), checkWordCount(), dgConnectWithVal(), dnaMotifSequenceProb(), emblRecord(), errCatchFinish(), expandRelativePath(), faMixedSpeedReadNext(), faReadMixedNext(), filterPoorGenes(), findSymIx(), fofMake(), fofOpen(), getCurrentDir(), gffOpen(), gffReadDna(), gffReadGenes(), gfServerWarn(), htmlHeaderRead(), htmlPageForwardedNoAbort(), htmlPageParse(), htmlPageValidateOrAbort(), htmlStatusParse(), htmlTagScan(), internetDottedQuadToIp(), internetHostIp(), internetIpToDottedQuad(), lineFileParseHttpHeader(), lineFileSlurpHttpBody(), makeHits8(), makeIndividualHits16(), maskFromOut(), maskQuerySeq(), mergeWithinCluster(), mgSaveToGif(), netAcceptingSocketFrom(), netConnect(), netGetHugeString(), netGetLongString(), netGetString(), netLineFileMayOpen(), netLineFileMayOpenCatchError(), netSendHugeString(), netSendLongString(), netSendString(), netSkipHttpHeaderLines(), netStreamSocket(), parseCookie(), parseGtfEnd(), parseQuotedString(), pslxFileOpen(), pslxFileOpenWithMetaConfig(), pwarn(), readPslToBinKeeper(), readReadyWait(), repeatMaskOutStaticLoad(), rudpOpen(), rudpOpenBound(), rudpReceiveTimeOut(), rudpSend(), setCurrentDir(), startServer(), statusServer(), tagVaWarn(), timeDiff(), warnAboutDupes(), and writeString().

00042 {
00043 va_list args;
00044 va_start(args, format);
00045 vaWarn(format, args);
00046 va_end(args);
00047 }

Here is the caller graph for this function:

boolean wildMatch ( char *  wildCard,
char *  string 
)

Definition at line 31 of file wildcmp.c.

References FALSE, subMatch(), and TRUE.

Referenced by blastFileOpenVerify(), listDir(), listDirX(), and rkeyEval().

00036 {
00037 boolean matchStar = 0;
00038 int starMatchSize;
00039 
00040 for(;;)
00041     {
00042 NEXT_WILD:
00043     switch(*wildCard)
00044         {
00045         case 0: /* end of wildcard */
00046             {
00047             if(matchStar)
00048                 {
00049                 while(*string++)
00050                     ;
00051                 return TRUE;
00052                 }
00053             else if(*string)
00054                 return FALSE;
00055             else
00056                 return TRUE;
00057             }
00058         case '*':
00059             matchStar = TRUE;
00060             break;
00061         case '?': /* anything will do */
00062             {
00063             if(*string == 0)
00064                 return FALSE; /* out of string, no match for ? */
00065             ++string;
00066             break;
00067             }
00068         default:
00069             {
00070             if(matchStar)
00071                 {
00072                 for(;;)
00073                     {
00074                     if(*string == 0) /* if out of string no match */
00075                         return FALSE;
00076 
00077                     /* note matchStar is re-used here for substring
00078                      * after star match length */
00079                     if((starMatchSize = subMatch(string,wildCard)) != 0)
00080                         {
00081                         string += starMatchSize;
00082                         wildCard += starMatchSize;
00083                         matchStar = FALSE;
00084                         goto NEXT_WILD;
00085                         }
00086                     ++string;
00087                     }
00088                 }
00089 
00090             /* default: they must be equal or no match */
00091             if(toupper(*string) != toupper(*wildCard))
00092                 return FALSE;
00093             ++string;
00094             break;
00095             }
00096         }
00097     ++wildCard;
00098     }
00099 }

Here is the call graph for this function:

Here is the caller graph for this function:

void writeBits64 ( FILE *  f,
bits64  x 
)

Definition at line 1584 of file common.c.

References mustWrite(), and UBYTE.

01586 {
01587 int i;
01588 UBYTE buf[8];
01589 for (i=7; i>=0; --i)
01590     {
01591     buf[i] = (UBYTE)(x&0xff);
01592     x >>= 8;
01593     }
01594 mustWrite(f, buf, 8);
01595 }

Here is the call graph for this function:

void writeString ( FILE *  f,
char *  s 
)

Definition at line 1525 of file common.c.

References mustWrite(), UBYTE, warn(), and writeOne.

Referenced by twoBitWriteHeader().

01529 {
01530 UBYTE bLen;
01531 int len = strlen(s);
01532 
01533 if (len > 255)
01534     {
01535     warn("String too long in writeString (%d chars):\n%s", len, s);
01536     len = 255;
01537     }
01538 bLen = len;
01539 writeOne(f, bLen);
01540 mustWrite(f, s, len);
01541 }

Here is the call graph for this function:

Here is the caller graph for this function:

void zeroBytes ( void *  vpt,
int  count 
)

Definition at line 49 of file common.c.

Referenced by bitClear(), dnaBaseHistogram(), dnaMark0(), dnaMark1(), dnaMarkTriple(), ffShNeedle(), flyFaCommentIntoInfo(), gffClose(), gffOpen(), init_table(), initNtChars(), initNtCompTable(), initNtMixedCaseChars(), internetIpToDottedQuad(), makeIndex(), mgClearPixels(), mgFree(), mgSaveToGif(), saveNt4(), wormFaCommentIntoInfo(), and wormFreeCdnaInfo().

00050 {
00051 char *pt = (char*)vpt;
00052 while (--count>=0)
00053     *pt++=0;
00054 }

Here is the caller graph for this function:


Variable Documentation

char crLfChopper[]

Definition at line 1274 of file common.c.

char whiteSpaceChopper[]

Definition at line 1275 of file common.c.

Referenced by wormGeneToOrfNames().


Generated on Tue Dec 25 18:50:01 2007 for blat by  doxygen 1.5.2