inc/subText.h File Reference

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

Go to the source code of this file.

Data Structures

struct  subText

Functions

subTextsubTextNew (char *in, char *out)
void subTextFree (struct subText **pSub)
void subTextFreeList (struct subText **pList)
int subTextSizeAfter (struct subText *subList, char *in)
void subTextStatic (struct subText *subList, char *in, char *out, int outMaxSize)
char * subTextString (struct subText *subList, char *in)


Function Documentation

void subTextFree ( struct subText **  pSub  ) 

Definition at line 23 of file subText.c.

References freeMem(), freez(), subText::in, and subText::out.

Referenced by subTextFreeList().

00025 {
00026 struct subText *sub = *pSub;
00027 if (sub != NULL)
00028     {
00029     freeMem(sub->in);
00030     freeMem(sub->out);
00031     freez(pSub);
00032     }
00033 }

Here is the call graph for this function:

Here is the caller graph for this function:

void subTextFreeList ( struct subText **  pList  ) 

Definition at line 35 of file subText.c.

References subText::next, and subTextFree().

00037 {
00038 struct subText *el, *next;
00039 
00040 for (el = *pList; el != NULL; el = next)
00041     {
00042     next = el->next;
00043     subTextFree(&el);
00044     }
00045 *pList = NULL;
00046 }

Here is the call graph for this function:

struct subText* subTextNew ( char *  in,
char *  out 
) [read]

Definition at line 11 of file subText.c.

References AllocVar, cloneString(), subText::in, subText::inSize, subText::out, and subText::outSize.

00013 {
00014 struct subText *sub;
00015 AllocVar(sub);
00016 sub->in = cloneString(in);
00017 sub->out = cloneString(out);
00018 sub->inSize = strlen(in);
00019 sub->outSize = strlen(out);
00020 return sub;
00021 }

Here is the call graph for this function:

int subTextSizeAfter ( struct subText subList,
char *  in 
)

Definition at line 85 of file subText.c.

References firstInList(), subText::inSize, and subText::outSize.

Referenced by subTextStatic(), and subTextString().

00087 {
00088 struct subText *sub;
00089 char *s;
00090 int size = 0;
00091 
00092 s = in;
00093 while (*s)
00094     {
00095     if ((sub = firstInList(subList, s)) != NULL)
00096         {
00097         s += sub->inSize;
00098         size += sub->outSize;
00099         }
00100     else
00101         {
00102         size += 1;
00103         s += 1;
00104         }
00105     }
00106 return size;
00107 }

Here is the call graph for this function:

Here is the caller graph for this function:

void subTextStatic ( struct subText subList,
char *  in,
char *  out,
int  outMaxSize 
)

Definition at line 135 of file subText.c.

References doSub(), errAbort(), and subTextSizeAfter().

00138 {
00139 int newSize = subTextSizeAfter(subList, in);
00140 if (newSize >= outMaxSize)
00141     errAbort("%s would expand to more than %d bytes", in, outMaxSize);
00142 doSub(in, out, subList);
00143 }

Here is the call graph for this function:

char* subTextString ( struct subText subList,
char *  in 
)

Definition at line 145 of file subText.c.

References doSub(), needMem(), subText::out, and subTextSizeAfter().

00148 {
00149 int size = subTextSizeAfter(subList, in);
00150 char *out = needMem(size+1);
00151 doSub(in, out, subList);
00152 return out;
00153 }

Here is the call graph for this function:


Generated on Tue Dec 25 19:16:45 2007 for blat by  doxygen 1.5.2