inc/sqlList.h File Reference

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

Go to the source code of this file.

Functions

int sqlDoubleArray (char *s, double *array, int maxArraySize)
int sqlFloatArray (char *s, float *array, int maxArraySize)
int sqlUnsignedArray (char *s, unsigned *array, int maxArraySize)
int sqlSignedArray (char *s, int *array, int maxArraySize)
int sqlShortArray (char *s, short *array, int arraySize)
int sqlUshortArray (char *s, unsigned short *array, int arraySize)
int sqlByteArray (char *s, signed char *array, int arraySize)
int sqlUbyteArray (char *s, unsigned char *array, int arraySize)
int sqlCharArray (char *s, char *array, int arraySize)
int sqlLongLongArray (char *s, long long *array, int arraySize)
void sqlDoubleStaticArray (char *s, double **retArray, int *retSize)
void sqlFloatStaticArray (char *s, float **retArray, int *retSize)
void sqlUnsignedStaticArray (char *s, unsigned **retArray, int *retSize)
void sqlSignedStaticArray (char *s, int **retArray, int *retSize)
void sqlShortStaticArray (char *s, short **retArray, int *retSize)
void sqlUshortStaticArray (char *s, unsigned short **retArray, int *retSize)
void sqlByteStaticArray (char *s, signed char **retArray, int *retSize)
void sqlUbyteStaticArray (char *s, unsigned char **retArray, int *retSize)
void sqlCharStaticArray (char *s, char **retArray, int *retSize)
void sqlLongLongStaticArray (char *s, long long **array, int *retSize)
void sqlDoubleDynamicArray (char *s, double **retArray, int *retSize)
void sqlFloatDynamicArray (char *s, float **retArray, int *retSize)
void sqlUnsignedDynamicArray (char *s, unsigned **retArray, int *retSize)
void sqlSignedDynamicArray (char *s, int **retArray, int *retSize)
void sqlShortDynamicArray (char *s, short **retArray, int *retSize)
void sqlUshortDynamicArray (char *s, unsigned short **retArray, int *retSize)
void sqlByteDynamicArray (char *s, signed char **retArray, int *retSize)
void sqlUbyteDynamicArray (char *s, unsigned char **retArray, int *retSize)
void sqlCharDynamicArray (char *s, char **retArray, int *retSize)
void sqlLongLongDynamicArray (char *s, long long **retArray, int *retSize)
int sqlStringArray (char *s, char **array, int maxArraySize)
void sqlStringStaticArray (char *s, char ***retArray, int *retSize)
void sqlStringDynamicArray (char *s, char ***retArray, int *retSize)
void sqlStringFreeDynamicArray (char ***pArray)
char * sqlDoubleArrayToString (double *array, int arraySize)
char * sqlFloatArrayToString (float *array, int arraySize)
char * sqlUnsignedArrayToString (unsigned *array, int arraySize)
char * sqlSignedArrayToString (int *array, int arraySize)
char * sqlShortArrayToString (short *array, int arraySize)
char * sqlUshortArrayToString (unsigned short *array, int arraySize)
char * sqlByteArrayToString (signed char *array, int arraySize)
char * sqlUbyteArrayToString (unsigned char *array, int arraySize)
char * sqlCharArrayToString (char *array, int arraySize)
char * sqlLongLongArrayToString (long long *array, int arraySize)
char * sqlStringArrayToString (char **array, int arraySize)
char * sqlEscapeString (const char *orig)
char * sqlEscapeString2 (char *to, const char *from)
int sqlUnsignedComma (char **pS)
int sqlSignedComma (char **pS)
char sqlCharComma (char **pS)
long long sqlLongLongComma (char **pS)
double sqlDoubleComma (char **pS)
float sqlFloatComma (char **pS)
char * sqlStringComma (char **pS)
void sqlFixedStringComma (char **pS, char *buf, int bufSize)
char * sqlEatChar (char *s, char c)
unsigned sqlEnumParse (char *valStr, char **values, struct hash **valHashPtr)
unsigned sqlEnumComma (char **pS, char **values, struct hash **valHashPtr)
void sqlEnumPrint (FILE *f, unsigned value, char **values)
unsigned sqlSetParse (char *valStr, char **values, struct hash **valHashPtr)
unsigned sqlSetComma (char **pS, char **values, struct hash **valHashPtr)
void sqlSetPrint (FILE *f, unsigned value, char **values)


Function Documentation

int sqlByteArray ( char *  s,
signed char *  array,
int  arraySize 
)

Definition at line 16 of file sqlList.c.

References sqlSigned().

00019 {
00020 unsigned count = 0;
00021 for (;;)
00022     {
00023     char *e;
00024     if (s == NULL || s[0] == 0 || count == arraySize)
00025         break;
00026     e = strchr(s, ',');
00027     if (e != NULL)
00028         *e++ = 0;
00029     array[count++] = sqlSigned(s);
00030     s = e;
00031     }
00032 return count;
00033 }

Here is the call graph for this function:

char* sqlByteArrayToString ( signed char *  array,
int  arraySize 
)

Definition at line 872 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00873 {
00874 int i;
00875 struct dyString *string = newDyString(256);
00876 char *toRet = NULL;
00877 for( i = 0 ; i < arraySize; i++ )
00878     {
00879     dyStringPrintf(string, "%d,", array[i]);
00880     }
00881 toRet = cloneString(string->string);
00882 dyStringFree(&string);
00883 return toRet;
00884 }

Here is the call graph for this function:

void sqlByteDynamicArray ( char *  s,
signed char **  retArray,
int *  retSize 
)

Definition at line 66 of file sqlList.c.

References AllocArray, CopyArray, and sqlByteStaticArray().

00069 {
00070 signed char *sArray, *dArray = NULL;
00071 int size;
00072 
00073 sqlByteStaticArray(s, &sArray, &size);
00074 if (size > 0)
00075     {
00076     AllocArray(dArray,size);
00077     CopyArray(sArray, dArray, size);
00078     }
00079 *retArray = dArray;
00080 *retSize = size;
00081 }

Here is the call graph for this function:

void sqlByteStaticArray ( char *  s,
signed char **  retArray,
int *  retSize 
)

Definition at line 35 of file sqlList.c.

References ExpandArray, and sqlSigned().

Referenced by sqlByteDynamicArray().

00038 {
00039 static signed char *array = NULL;
00040 static unsigned alloc = 0;
00041 unsigned count = 0;
00042 
00043 for (;;)
00044     {
00045     char *e;
00046     if (s == NULL || s[0] == 0)
00047         break;
00048     e = strchr(s, ',');
00049     if (e != NULL)
00050         *e++ = 0;
00051     if (count >= alloc)
00052         {
00053         if (alloc == 0)
00054             alloc = 64;
00055         else
00056             alloc <<= 1;
00057         ExpandArray(array, count, alloc);
00058         }
00059     array[count++] = sqlSigned(s);
00060     s = e;
00061     }
00062 *retSize = count;
00063 *retArray = array;
00064 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlCharArray ( char *  s,
char *  array,
int  arraySize 
)

Definition at line 154 of file sqlList.c.

00157 {
00158 unsigned count = 0;
00159 for (;;)
00160     {
00161     char *e;
00162     if (s == NULL || s[0] == 0 || count == arraySize)
00163         break;
00164     e = strchr(s, ',');
00165     if (e != NULL)
00166         *e++ = 0;
00167     array[count++] = s[0];
00168     s = e;
00169     }
00170 return count;
00171 }

char* sqlCharArrayToString ( char *  array,
int  arraySize 
)

Definition at line 900 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00901 {
00902 int i;
00903 struct dyString *string = newDyString(256);
00904 char *toRet = NULL;
00905 for( i = 0 ; i < arraySize; i++ )
00906     {
00907     dyStringPrintf(string, "%c,", array[i]);
00908     }
00909 toRet = cloneString(string->string);
00910 dyStringFree(&string);
00911 return toRet;
00912 }

Here is the call graph for this function:

char sqlCharComma ( char **  pS  ) 

Definition at line 985 of file sqlList.c.

00987 {
00988 char *s = *pS;
00989 char *e = strchr(s, ',');
00990 int ret;
00991 
00992 *e++ = 0;
00993 *pS = e;
00994 ret = s[0];
00995 return ret;
00996 }

void sqlCharDynamicArray ( char *  s,
char **  retArray,
int *  retSize 
)

Definition at line 204 of file sqlList.c.

References AllocArray, CopyArray, and sqlCharStaticArray().

00207 {
00208 char *sArray, *dArray = NULL;
00209 int size;
00210 
00211 sqlCharStaticArray(s, &sArray, &size);
00212 if (size > 0)
00213     {
00214     AllocArray(dArray,size);
00215     CopyArray(sArray, dArray, size);
00216     }
00217 *retArray = dArray;
00218 *retSize = size;
00219 }

Here is the call graph for this function:

void sqlCharStaticArray ( char *  s,
char **  retArray,
int *  retSize 
)

Definition at line 173 of file sqlList.c.

References ExpandArray.

Referenced by sqlCharDynamicArray().

00176 {
00177 static char *array = NULL;
00178 static unsigned alloc = 0;
00179 unsigned count = 0;
00180 
00181 for (;;)
00182     {
00183     char *e;
00184     if (s == NULL || s[0] == 0)
00185         break;
00186     e = strchr(s, ',');
00187     if (e != NULL)
00188         *e++ = 0;
00189     if (count >= alloc)
00190         {
00191         if (alloc == 0)
00192             alloc = 64;
00193         else
00194             alloc <<= 1;
00195         ExpandArray(array, count, alloc);
00196         }
00197     array[count++] = s[0];
00198     s = e;
00199     }
00200 *retSize = count;
00201 *retArray = array;
00202 }

Here is the caller graph for this function:

int sqlDoubleArray ( char *  s,
double *  array,
int  maxArraySize 
)

Definition at line 360 of file sqlList.c.

00363 {
00364 unsigned count = 0;
00365 for (;;)
00366     {
00367     char *e;
00368     if (s == NULL || s[0] == 0 || count == maxArraySize)
00369         break;
00370     e = strchr(s, ',');
00371     if (e != NULL)
00372         *e++ = 0;
00373     array[count++] = atof(s);
00374     s = e;
00375     }
00376 return count;
00377 }

char* sqlDoubleArrayToString ( double *  array,
int  arraySize 
)

Definition at line 788 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00789 {
00790 int i;
00791 struct dyString *string = newDyString(256);
00792 char *toRet = NULL;
00793 for( i = 0 ; i < arraySize; i++ )
00794     {
00795     dyStringPrintf(string, "%f,", array[i]);
00796     }
00797 toRet = cloneString(string->string);
00798 dyStringFree(&string);
00799 return toRet;
00800 }

Here is the call graph for this function:

double sqlDoubleComma ( char **  pS  ) 

Definition at line 1025 of file sqlList.c.

01027 {
01028 char *s = *pS;
01029 char *e = strchr(s, ',');
01030 double ret;
01031 
01032 *e++ = 0;
01033 *pS = e;
01034 ret = atof(s);
01035 return ret;
01036 }

void sqlDoubleDynamicArray ( char *  s,
double **  retArray,
int *  retSize 
)

Definition at line 461 of file sqlList.c.

References AllocArray, CopyArray, and sqlDoubleStaticArray().

00464 {
00465 double *sArray, *dArray = NULL;
00466 int size;
00467 
00468 sqlDoubleStaticArray(s, &sArray, &size);
00469 if (size > 0)
00470     {
00471     AllocArray(dArray,size);
00472     CopyArray(sArray, dArray, size);
00473     }
00474 *retArray = dArray;
00475 *retSize = size;
00476 }

Here is the call graph for this function:

void sqlDoubleStaticArray ( char *  s,
double **  retArray,
int *  retSize 
)

Definition at line 399 of file sqlList.c.

References ExpandArray.

Referenced by sqlDoubleDynamicArray().

00402 {
00403 static double *array = NULL;
00404 static unsigned alloc = 0;
00405 unsigned count = 0;
00406 
00407 for (;;)
00408     {
00409     char *e;
00410     if (s == NULL || s[0] == 0)
00411         break;
00412     e = strchr(s, ',');
00413     if (e != NULL)
00414         *e++ = 0;
00415     if (count >= alloc)
00416         {
00417         if (alloc == 0)
00418             alloc = 64;
00419         else
00420             alloc <<= 1;
00421         ExpandArray(array, count, alloc);
00422         }
00423     array[count++] = atof(s);
00424     s = e;
00425     }
00426 *retSize = count;
00427 *retArray = array;
00428 }

Here is the caller graph for this function:

char* sqlEatChar ( char *  s,
char  c 
)

Definition at line 1092 of file sqlList.c.

References errAbort().

Referenced by dnaMotifCommaIn(), pslCommaIn(), and xAliCommaIn().

01094 {
01095 if (*s++ != c)
01096     errAbort("Expecting %c got %c (%d) in database", c, s[-1], s[-1]);
01097 return s;
01098 }

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned sqlEnumComma ( char **  pS,
char **  values,
struct hash **  valHashPtr 
)

Definition at line 1127 of file sqlList.c.

References sqlEnumParse(), and sqlGetOptQuoteString().

01129 {
01130 return sqlEnumParse(sqlGetOptQuoteString(pS), values, valHashPtr);
01131 }

Here is the call graph for this function:

unsigned sqlEnumParse ( char *  valStr,
char **  values,
struct hash **  valHashPtr 
)

Definition at line 1119 of file sqlList.c.

References buildSymHash(), hashIntVal(), and TRUE.

Referenced by sqlEnumComma().

01121 {
01122 if (*valHashPtr == NULL)
01123     *valHashPtr = buildSymHash(values, TRUE);
01124 return hashIntVal(*valHashPtr, valStr);
01125 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlEnumPrint ( FILE *  f,
unsigned  value,
char **  values 
)

Definition at line 1133 of file sqlList.c.

01135 {
01136 fputs(values[value], f);
01137 }

char* sqlEscapeString ( const char *  orig  ) 

char* sqlEscapeString2 ( char *  to,
const char *  from 
)

void sqlFixedStringComma ( char **  pS,
char *  buf,
int  bufSize 
)

Definition at line 1086 of file sqlList.c.

References sqlGetOptQuoteString().

Referenced by pslCommaIn(), repeatMaskOutCommaIn(), and xAliCommaIn().

01088 {
01089 strncpy(buf, sqlGetOptQuoteString(pS), bufSize);
01090 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlFloatArray ( char *  s,
float *  array,
int  maxArraySize 
)

Definition at line 380 of file sqlList.c.

00383 {
00384 unsigned count = 0;
00385 for (;;)
00386     {
00387     char *e;
00388     if (s == NULL || s[0] == 0 || count == maxArraySize)
00389         break;
00390     e = strchr(s, ',');
00391     if (e != NULL)
00392         *e++ = 0;
00393     array[count++] = atof(s);
00394     s = e;
00395     }
00396 return count;
00397 }

char* sqlFloatArrayToString ( float *  array,
int  arraySize 
)

Definition at line 802 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00803 {
00804 int i;
00805 struct dyString *string = newDyString(256);
00806 char *toRet = NULL;
00807 for( i = 0 ; i < arraySize; i++ )
00808     {
00809     dyStringPrintf(string, "%f,", array[i]);
00810     }
00811 toRet = cloneString(string->string);
00812 dyStringFree(&string);
00813 return toRet;
00814 }

Here is the call graph for this function:

float sqlFloatComma ( char **  pS  ) 

Definition at line 1012 of file sqlList.c.

01014 {
01015 char *s = *pS;
01016 char *e = strchr(s, ',');
01017 float ret;
01018 
01019 *e++ = 0;
01020 *pS = e;
01021 ret = atof(s);
01022 return ret;
01023 }

void sqlFloatDynamicArray ( char *  s,
float **  retArray,
int *  retSize 
)

Definition at line 478 of file sqlList.c.

References AllocArray, CopyArray, and sqlFloatStaticArray().

00481 {
00482 float *sArray, *dArray = NULL;
00483 int size;
00484 
00485 sqlFloatStaticArray(s, &sArray, &size);
00486 if (size > 0)
00487     {
00488     AllocArray(dArray,size);
00489     CopyArray(sArray, dArray, size);
00490     }
00491 *retArray = dArray;
00492 *retSize = size;
00493 }

Here is the call graph for this function:

void sqlFloatStaticArray ( char *  s,
float **  retArray,
int *  retSize 
)

Definition at line 430 of file sqlList.c.

References ExpandArray.

Referenced by sqlFloatDynamicArray().

00433 {
00434 static float *array = NULL;
00435 static unsigned alloc = 0;
00436 unsigned count = 0;
00437 
00438 for (;;)
00439     {
00440     char *e;
00441     if (s == NULL || s[0] == 0)
00442         break;
00443     e = strchr(s, ',');
00444     if (e != NULL)
00445         *e++ = 0;
00446     if (count >= alloc)
00447         {
00448         if (alloc == 0)
00449             alloc = 128;
00450         else
00451             alloc <<= 1;
00452         ExpandArray(array, count, alloc);
00453         }
00454     array[count++] = atof(s);
00455     s = e;
00456     }
00457 *retSize = count;
00458 *retArray = array;
00459 }

Here is the caller graph for this function:

int sqlLongLongArray ( char *  s,
long long *  array,
int  arraySize 
)

Definition at line 635 of file sqlList.c.

References sqlLongLong().

00638 {
00639 unsigned count = 0;
00640 for (;;)
00641     {
00642     char *e;
00643     if (s == NULL || s[0] == 0 || count == arraySize)
00644         break;
00645     e = strchr(s, ',');
00646     if (e != NULL)
00647         *e++ = 0;
00648     array[count++] = sqlLongLong(s);
00649     s = e;
00650     }
00651 return count;
00652 }

Here is the call graph for this function:

char* sqlLongLongArrayToString ( long long *  array,
int  arraySize 
)

Definition at line 914 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00915 {
00916 int i;
00917 struct dyString *string = newDyString(256);
00918 char *toRet = NULL;
00919 for( i = 0 ; i < arraySize; i++ )
00920     {
00921     dyStringPrintf(string, "%lld,", array[i]);
00922     }
00923 toRet = cloneString(string->string);
00924 dyStringFree(&string);
00925 return toRet;
00926 }

Here is the call graph for this function:

long long sqlLongLongComma ( char **  pS  ) 

Definition at line 998 of file sqlList.c.

References sqlLongLong().

01001 {
01002 char *s = *pS;
01003 char *e = strchr(s, ',');
01004 long long ret;
01005 
01006 *e++ = 0;
01007 *pS = e;
01008 ret = sqlLongLong(s);
01009 return ret;
01010 }

Here is the call graph for this function:

void sqlLongLongDynamicArray ( char *  s,
long long **  retArray,
int *  retSize 
)

Definition at line 685 of file sqlList.c.

References AllocArray, CopyArray, and sqlLongLongStaticArray().

00688 {
00689 long long *sArray, *dArray = NULL;
00690 int size;
00691 
00692 sqlLongLongStaticArray(s, &sArray, &size);
00693 if (size > 0)
00694     {
00695     AllocArray(dArray,size);
00696     CopyArray(sArray, dArray, size);
00697     }
00698 *retArray = dArray;
00699 *retSize = size;
00700 }

Here is the call graph for this function:

void sqlLongLongStaticArray ( char *  s,
long long **  array,
int *  retSize 
)

Definition at line 654 of file sqlList.c.

References ExpandArray, and sqlLongLong().

Referenced by sqlLongLongDynamicArray().

00657 {
00658 static long long *array = NULL;
00659 static unsigned alloc = 0;
00660 unsigned count = 0;
00661 
00662 for (;;)
00663     {
00664     char *e;
00665     if (s == NULL || s[0] == 0)
00666         break;
00667     e = strchr(s, ',');
00668     if (e != NULL)
00669         *e++ = 0;
00670     if (count >= alloc)
00671         {
00672         if (alloc == 0)
00673             alloc = 64;
00674         else
00675             alloc <<= 1;
00676         ExpandArray(array, count, alloc);
00677         }
00678     array[count++] = sqlLongLong(s);
00679     s = e;
00680     }
00681 *retSize = count;
00682 *retArray = array;
00683 }

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned sqlSetComma ( char **  pS,
char **  values,
struct hash **  valHashPtr 
)

Definition at line 1156 of file sqlList.c.

References sqlGetOptQuoteString(), and sqlSetParse().

01158 {
01159 return sqlSetParse(sqlGetOptQuoteString(pS), values, valHashPtr);
01160 }

Here is the call graph for this function:

unsigned sqlSetParse ( char *  valStr,
char **  values,
struct hash **  valHashPtr 
)

Definition at line 1139 of file sqlList.c.

References buildSymHash(), FALSE, and hashIntVal().

Referenced by sqlSetComma().

01141 {
01142 if (*valHashPtr == NULL)
01143     *valHashPtr = buildSymHash(values, FALSE);
01144 /* parse comma separated string */
01145 unsigned value = 0;
01146 char *val = strtok(valStr, ",");
01147 while (val != NULL)
01148     {
01149     value |= hashIntVal(*valHashPtr, val);
01150     val = strtok(NULL, ",");
01151     }
01152 
01153 return value;
01154 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlSetPrint ( FILE *  f,
unsigned  value,
char **  values 
)

Definition at line 1162 of file sqlList.c.

01164 {
01165 int iVal;
01166 unsigned curVal = 1;
01167 int cnt = 0;
01168 for (iVal = 0; values[iVal] != NULL; iVal++, curVal = curVal << 1)
01169     {
01170     if (curVal & value)
01171         {
01172         if (cnt > 0)
01173             fputc(',', f);
01174         fputs(values[iVal], f);
01175         cnt++;
01176         }
01177     }
01178 }

int sqlShortArray ( char *  s,
short *  array,
int  arraySize 
)

Definition at line 223 of file sqlList.c.

References sqlSigned().

00226 {
00227 unsigned count = 0;
00228 for (;;)
00229     {
00230     char *e;
00231     if (s == NULL || s[0] == 0 || count == arraySize)
00232         break;
00233     e = strchr(s, ',');
00234     if (e != NULL)
00235         *e++ = 0;
00236     array[count++] = sqlSigned(s);
00237     s = e;
00238     }
00239 return count;
00240 }

Here is the call graph for this function:

char* sqlShortArrayToString ( short *  array,
int  arraySize 
)

Definition at line 844 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00845 {
00846 int i;
00847 struct dyString *string = newDyString(256);
00848 char *toRet = NULL;
00849 for( i = 0 ; i < arraySize; i++ )
00850     {
00851     dyStringPrintf(string, "%d,", array[i]);
00852     }
00853 toRet = cloneString(string->string);
00854 dyStringFree(&string);
00855 return toRet;
00856 }

Here is the call graph for this function:

void sqlShortDynamicArray ( char *  s,
short **  retArray,
int *  retSize 
)

Definition at line 273 of file sqlList.c.

References AllocArray, CopyArray, and sqlShortStaticArray().

00276 {
00277 short *sArray, *dArray = NULL;
00278 int size;
00279 
00280 sqlShortStaticArray(s, &sArray, &size);
00281 if (size > 0)
00282     {
00283     AllocArray(dArray,size);
00284     CopyArray(sArray, dArray, size);
00285     }
00286 *retArray = dArray;
00287 *retSize = size;
00288 }

Here is the call graph for this function:

void sqlShortStaticArray ( char *  s,
short **  retArray,
int *  retSize 
)

Definition at line 242 of file sqlList.c.

References ExpandArray, and sqlSigned().

Referenced by sqlShortDynamicArray().

00245 {
00246 static short *array = NULL;
00247 static unsigned alloc = 0;
00248 unsigned count = 0;
00249 
00250 for (;;)
00251     {
00252     char *e;
00253     if (s == NULL || s[0] == 0)
00254         break;
00255     e = strchr(s, ',');
00256     if (e != NULL)
00257         *e++ = 0;
00258     if (count >= alloc)
00259         {
00260         if (alloc == 0)
00261             alloc = 64;
00262         else
00263             alloc <<= 1;
00264         ExpandArray(array, count, alloc);
00265         }
00266     array[count++] = sqlSigned(s);
00267     s = e;
00268     }
00269 *retSize = count;
00270 *retArray = array;
00271 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlSignedArray ( char *  s,
int *  array,
int  maxArraySize 
)

Definition at line 566 of file sqlList.c.

References sqlSigned().

00569 {
00570 int count = 0;
00571 for (;;)
00572     {
00573     char *e;
00574     if (s == NULL || s[0] == 0 || count == arraySize)
00575         break;
00576     e = strchr(s, ',');
00577     if (e != NULL)
00578         *e++ = 0;
00579     array[count++] = sqlSigned(s);
00580     s = e;
00581     }
00582 return count;
00583 }

Here is the call graph for this function:

char* sqlSignedArrayToString ( int *  array,
int  arraySize 
)

Definition at line 830 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00831 {
00832 int i;
00833 struct dyString *string = newDyString(256);
00834 char *toRet = NULL;
00835 for( i = 0 ; i < arraySize; i++ )
00836     {
00837     dyStringPrintf(string, "%d,", array[i]);
00838     }
00839 toRet = cloneString(string->string);
00840 dyStringFree(&string);
00841 return toRet;
00842 }

Here is the call graph for this function:

int sqlSignedComma ( char **  pS  ) 

Definition at line 972 of file sqlList.c.

References sqlSigned().

Referenced by dnaMotifCommaIn(), pslCommaIn(), repeatMaskOutCommaIn(), and xAliCommaIn().

00974 {
00975 char *s = *pS;
00976 char *e = strchr(s, ',');
00977 int ret;
00978 
00979 *e++ = 0;
00980 *pS = e;
00981 ret = sqlSigned(s);
00982 return ret;
00983 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlSignedDynamicArray ( char *  s,
int **  retArray,
int *  retSize 
)

Definition at line 616 of file sqlList.c.

References AllocArray, CopyArray, and sqlSignedStaticArray().

00619 {
00620 int *sArray, *dArray = NULL;
00621 int size;
00622 
00623 sqlSignedStaticArray(s, &sArray, &size);
00624 if (size > 0)
00625     {
00626     AllocArray(dArray,size);
00627     CopyArray(sArray, dArray, size);
00628     }
00629 *retArray = dArray;
00630 *retSize = size;
00631 }

Here is the call graph for this function:

void sqlSignedStaticArray ( char *  s,
int **  retArray,
int *  retSize 
)

Definition at line 585 of file sqlList.c.

References ExpandArray, and sqlSigned().

Referenced by sqlSignedDynamicArray().

00588 {
00589 static int *array = NULL;
00590 static int alloc = 0;
00591 int count = 0;
00592 
00593 for (;;)
00594     {
00595     char *e;
00596     if (s == NULL || s[0] == 0)
00597         break;
00598     e = strchr(s, ',');
00599     if (e != NULL)
00600         *e++ = 0;
00601     if (count >= alloc)
00602         {
00603         if (alloc == 0)
00604             alloc = 64;
00605         else
00606             alloc <<= 1;
00607         ExpandArray(array, count, alloc);
00608         }
00609     array[count++] = sqlSigned(s);
00610     s = e;
00611     }
00612 *retSize = count;
00613 *retArray = array;
00614 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlStringArray ( char *  s,
char **  array,
int  maxArraySize 
)

Definition at line 705 of file sqlList.c.

Referenced by pslxLoadLm().

00708 {
00709 int count = 0;
00710 for (;;)
00711     {
00712     char *e;
00713     if (s == NULL || s[0] == 0 || count == maxArraySize)
00714         break;
00715     e = strchr(s, ',');
00716     if (e != NULL)
00717         *e++ = 0;
00718     array[count++] = s;
00719     s = e;
00720     }
00721 return count;
00722 }

Here is the caller graph for this function:

char* sqlStringArrayToString ( char **  array,
int  arraySize 
)

Definition at line 928 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00929 {
00930 int i;
00931 struct dyString *string = newDyString(256);
00932 char *toRet = NULL;
00933 for( i = 0 ; i < arraySize; i++ )
00934     {
00935     dyStringPrintf(string, "%s,", array[i]);
00936     }
00937 toRet = cloneString(string->string);
00938 dyStringFree(&string);
00939 return toRet;
00940 }

Here is the call graph for this function:

char* sqlStringComma ( char **  pS  ) 

Definition at line 1080 of file sqlList.c.

References cloneString(), and sqlGetOptQuoteString().

Referenced by dnaMotifCommaIn(), pslCommaIn(), repeatMaskOutCommaIn(), and xAliCommaIn().

01082 {
01083 return cloneString(sqlGetOptQuoteString(pS));
01084 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlStringDynamicArray ( char *  s,
char ***  retArray,
int *  retSize 
)

Definition at line 756 of file sqlList.c.

References AllocArray, cloneString(), CopyArray, and sqlStringStaticArray().

Referenced by pslxLoad(), and xAliLoad().

00761                              :
00762  * sqlStringDynamicArray(s, &retArray, &retSize);
00763  * DoSomeFunction(retArray, retSize);
00764  * freeMem(retArray[0]);
00765  * freeMem(retArray);
00766  */
00767 {
00768 char **sArray, **dArray = NULL;
00769 int size;
00770 
00771 if (s == NULL)
00772     {
00773     *retArray = NULL;
00774     *retSize = 0;
00775     return;
00776     }
00777 s = cloneString(s);
00778 sqlStringStaticArray(s, &sArray, &size);
00779 if (size > 0)
00780     {
00781     AllocArray(dArray,size);
00782     CopyArray(sArray, dArray, size);
00783     }
00784 *retArray = dArray;
00785 *retSize = size;
00786 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlStringFreeDynamicArray ( char ***  pArray  ) 

Definition at line 947 of file sqlList.c.

References freeMem(), and freez().

00949 {
00950 char **array;
00951 if ((array = *pArray) != NULL)
00952     {
00953     freeMem(array[0]);
00954     freez(pArray);
00955     }
00956 }

Here is the call graph for this function:

void sqlStringStaticArray ( char *  s,
char ***  retArray,
int *  retSize 
)

Definition at line 724 of file sqlList.c.

References ExpandArray.

Referenced by sqlStringDynamicArray().

00728 {
00729 static char **array = NULL;
00730 static int alloc = 0;
00731 int count = 0;
00732 
00733 for (;;)
00734     {
00735     char *e;
00736     if (s == NULL || s[0] == 0)
00737         break;
00738     e = strchr(s, ',');
00739     if (e != NULL)
00740         *e++ = 0;
00741     if (count >= alloc)
00742         {
00743         if (alloc == 0)
00744             alloc = 64;
00745         else
00746             alloc <<= 1;
00747         ExpandArray(array, count, alloc);
00748         }
00749     array[count++] = s;
00750     s = e;
00751     }
00752 *retSize = count;
00753 *retArray = array;
00754 }

Here is the caller graph for this function:

int sqlUbyteArray ( char *  s,
unsigned char *  array,
int  arraySize 
)

Definition at line 85 of file sqlList.c.

References sqlUnsigned().

00088 {
00089 unsigned count = 0;
00090 for (;;)
00091     {
00092     char *e;
00093     if (s == NULL || s[0] == 0 || count == arraySize)
00094         break;
00095     e = strchr(s, ',');
00096     if (e != NULL)
00097         *e++ = 0;
00098     array[count++] = sqlUnsigned(s);
00099     s = e;
00100     }
00101 return count;
00102 }

Here is the call graph for this function:

char* sqlUbyteArrayToString ( unsigned char *  array,
int  arraySize 
)

Definition at line 886 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00887 {
00888 int i;
00889 struct dyString *string = newDyString(256);
00890 char *toRet = NULL;
00891 for( i = 0 ; i < arraySize; i++ )
00892     {
00893     dyStringPrintf(string, "%u,", array[i]);
00894     }
00895 toRet = cloneString(string->string);
00896 dyStringFree(&string);
00897 return toRet;
00898 }

Here is the call graph for this function:

void sqlUbyteDynamicArray ( char *  s,
unsigned char **  retArray,
int *  retSize 
)

Definition at line 135 of file sqlList.c.

References AllocArray, CopyArray, and sqlUbyteStaticArray().

00138 {
00139 unsigned char *sArray, *dArray = NULL;
00140 int size;
00141 
00142 sqlUbyteStaticArray(s, &sArray, &size);
00143 if (size > 0)
00144     {
00145     AllocArray(dArray,size);
00146     CopyArray(sArray, dArray, size);
00147     }
00148 *retArray = dArray;
00149 *retSize = size;
00150 }

Here is the call graph for this function:

void sqlUbyteStaticArray ( char *  s,
unsigned char **  retArray,
int *  retSize 
)

Definition at line 104 of file sqlList.c.

References ExpandArray, and sqlUnsigned().

Referenced by sqlUbyteDynamicArray().

00107 {
00108 static unsigned char *array = NULL;
00109 static unsigned alloc = 0;
00110 unsigned count = 0;
00111 
00112 for (;;)
00113     {
00114     char *e;
00115     if (s == NULL || s[0] == 0)
00116         break;
00117     e = strchr(s, ',');
00118     if (e != NULL)
00119         *e++ = 0;
00120     if (count >= alloc)
00121         {
00122         if (alloc == 0)
00123             alloc = 64;
00124         else
00125             alloc <<= 1;
00126         ExpandArray(array, count, alloc);
00127         }
00128     array[count++] = sqlUnsigned(s);
00129     s = e;
00130     }
00131 *retSize = count;
00132 *retArray = array;
00133 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlUnsignedArray ( char *  s,
unsigned *  array,
int  maxArraySize 
)

Definition at line 497 of file sqlList.c.

References sqlUnsigned().

Referenced by pslLoadLm().

00500 {
00501 unsigned count = 0;
00502 for (;;)
00503     {
00504     char *e;
00505     if (s == NULL || s[0] == 0 || count == arraySize)
00506         break;
00507     e = strchr(s, ',');
00508     if (e != NULL)
00509         *e++ = 0;
00510     array[count++] = sqlUnsigned(s);
00511     s = e;
00512     }
00513 return count;
00514 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* sqlUnsignedArrayToString ( unsigned *  array,
int  arraySize 
)

Definition at line 816 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00817 {
00818 int i;
00819 struct dyString *string = newDyString(256);
00820 char *toRet = NULL;
00821 for( i = 0 ; i < arraySize; i++ )
00822     {
00823     dyStringPrintf(string, "%u,", array[i]);
00824     }
00825 toRet = cloneString(string->string);
00826 dyStringFree(&string);
00827 return toRet;
00828 }

Here is the call graph for this function:

int sqlUnsignedComma ( char **  pS  ) 

Definition at line 958 of file sqlList.c.

References sqlUnsigned().

Referenced by pslCommaIn(), repeatMaskOutCommaIn(), and xAliCommaIn().

00960 {
00961 char *s = *pS;
00962 char *e = strchr(s, ',');
00963 unsigned ret;
00964 
00965 *e++ = 0;
00966 *pS = e;
00967 ret = sqlUnsigned(s);
00968 return ret;
00969 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlUnsignedDynamicArray ( char *  s,
unsigned **  retArray,
int *  retSize 
)

Definition at line 547 of file sqlList.c.

References AllocArray, CopyArray, and sqlUnsignedStaticArray().

Referenced by pslLoad(), and xAliLoad().

00550 {
00551 unsigned *sArray, *dArray = NULL;
00552 int size;
00553 
00554 sqlUnsignedStaticArray(s, &sArray, &size);
00555 if (size > 0)
00556     {
00557     AllocArray(dArray,size);
00558     CopyArray(sArray, dArray, size);
00559     }
00560 *retArray = dArray;
00561 *retSize = size;
00562 }

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlUnsignedStaticArray ( char *  s,
unsigned **  retArray,
int *  retSize 
)

Definition at line 516 of file sqlList.c.

References ExpandArray, and sqlUnsigned().

Referenced by sqlUnsignedDynamicArray().

00519 {
00520 static unsigned *array = NULL;
00521 static unsigned alloc = 0;
00522 unsigned count = 0;
00523 
00524 for (;;)
00525     {
00526     char *e;
00527     if (s == NULL || s[0] == 0)
00528         break;
00529     e = strchr(s, ',');
00530     if (e != NULL)
00531         *e++ = 0;
00532     if (count >= alloc)
00533         {
00534         if (alloc == 0)
00535             alloc = 64;
00536         else
00537             alloc <<= 1;
00538         ExpandArray(array, count, alloc);
00539         }
00540     array[count++] = sqlUnsigned(s);
00541     s = e;
00542     }
00543 *retSize = count;
00544 *retArray = array;
00545 }

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlUshortArray ( char *  s,
unsigned short *  array,
int  arraySize 
)

Definition at line 292 of file sqlList.c.

References sqlUnsigned().

00295 {
00296 unsigned count = 0;
00297 for (;;)
00298     {
00299     char *e;
00300     if (s == NULL || s[0] == 0 || count == arraySize)
00301         break;
00302     e = strchr(s, ',');
00303     if (e != NULL)
00304         *e++ = 0;
00305     array[count++] = sqlUnsigned(s);
00306     s = e;
00307     }
00308 return count;
00309 }

Here is the call graph for this function:

char* sqlUshortArrayToString ( unsigned short *  array,
int  arraySize 
)

Definition at line 858 of file sqlList.c.

References cloneString(), dyStringFree, dyStringPrintf(), newDyString(), and dyString::string.

00859 {
00860 int i;
00861 struct dyString *string = newDyString(256);
00862 char *toRet = NULL;
00863 for( i = 0 ; i < arraySize; i++ )
00864     {
00865     dyStringPrintf(string, "%u,", array[i]);
00866     }
00867 toRet = cloneString(string->string);
00868 dyStringFree(&string);
00869 return toRet;
00870 }

Here is the call graph for this function:

void sqlUshortDynamicArray ( char *  s,
unsigned short **  retArray,
int *  retSize 
)

Definition at line 342 of file sqlList.c.

References AllocArray, CopyArray, and sqlUshortStaticArray().

00345 {
00346 unsigned short *sArray, *dArray = NULL;
00347 int size;
00348 
00349 sqlUshortStaticArray(s, &sArray, &size);
00350 if (size > 0)
00351     {
00352     AllocArray(dArray,size);
00353     CopyArray(sArray, dArray, size);
00354     }
00355 *retArray = dArray;
00356 *retSize = size;
00357 }

Here is the call graph for this function:

void sqlUshortStaticArray ( char *  s,
unsigned short **  retArray,
int *  retSize 
)

Definition at line 311 of file sqlList.c.

References ExpandArray, and sqlUnsigned().

Referenced by sqlUshortDynamicArray().

00314 {
00315 static unsigned short *array = NULL;
00316 static unsigned alloc = 0;
00317 unsigned count = 0;
00318 
00319 for (;;)
00320     {
00321     char *e;
00322     if (s == NULL || s[0] == 0)
00323         break;
00324     e = strchr(s, ',');
00325     if (e != NULL)
00326         *e++ = 0;
00327     if (count >= alloc)
00328         {
00329         if (alloc == 0)
00330             alloc = 64;
00331         else
00332             alloc <<= 1;
00333         ExpandArray(array, count, alloc);
00334         }
00335     array[count++] = sqlUnsigned(s);
00336     s = e;
00337     }
00338 *retSize = count;
00339 *retArray = array;
00340 }

Here is the call graph for this function:

Here is the caller graph for this function:


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