Changeset 12885
- Timestamp:
- Apr 18, 2007, 9:37:31 AM (19 years ago)
- Location:
- trunk/psLib
- Files:
-
- 4 edited
-
configure.ac (modified) (1 diff)
-
src/db/psDB.c (modified) (7 diffs)
-
src/sys/psString.h (modified) (2 diffs)
-
src/sys/strcasestr.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/configure.ac
r12502 r12885 84 84 dnl check the systems endianness 85 85 AC_C_BIGENDIAN 86 87 dnl set NO_STRCASESTR if we can't find strcasestr88 AC_CHECK_FUNC([strcasestr], [], [AC_SUBST(NO_STRCASESTR, [1])])89 86 90 87 AC_PREFIX_DEFAULT([/usr/local]) -
trunk/psLib/src/db/psDB.c
r12552 r12885 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.14 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-0 3-22 22:48:34$14 * @version $Revision: 1.142 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-04-18 19:37:31 $ 16 16 * 17 17 * Copyright (C) 2005-2006 Joshua Hoblitt, University of Hawaii … … 1530 1530 } 1531 1531 1532 if ( strcasestr(item->comment, "AUTO_INCREMENT")) {1532 if (psStrcasestr(item->comment, "AUTO_INCREMENT")) { 1533 1533 psStringAppend(&query, " %s", "AUTO_INCREMENT"); 1534 1534 } 1535 if ( strcasestr(item->comment, "Unique")) {1535 if (psStrcasestr(item->comment, "Unique")) { 1536 1536 psStringAppend(&query, " %s", "UNIQUE"); 1537 1537 } 1538 if ( strcasestr(item->comment, "NOT NULL")) {1538 if (psStrcasestr(item->comment, "NOT NULL")) { 1539 1539 psStringAppend(&query, " %s", "NOT NULL"); 1540 1540 } … … 1554 1554 psArray *pKeys = psArrayAllocEmpty(1); 1555 1555 while ((item = psListGetAndIncrement(cursor))) { 1556 if ( strcasestr(item->comment, "Primary Key")) {1556 if (psStrcasestr(item->comment, "Primary Key")) { 1557 1557 psArrayAdd(pKeys, 0, item->name); 1558 1558 } … … 1576 1576 while ((item = psListGetAndIncrement(cursor))) { 1577 1577 // it's just a regular key if it matchs "Key" but not "Primary Key" 1578 if ( strcasestr(item->comment, "Key")1579 && ( strcasestr(item->comment, "Primary Key") == NULL)) {1578 if (psStrcasestr(item->comment, "Key") 1579 && (psStrcasestr(item->comment, "Primary Key") == NULL)) { 1580 1580 psStringAppend(&query, ", KEY(%s)", item->name); 1581 } else if ( strcasestr(item->comment, "AUTO_INCREMENT")) {1581 } else if (psStrcasestr(item->comment, "AUTO_INCREMENT")) { 1582 1582 // this needs to be recognized as a key if it wasn't already 1583 1583 psStringAppend(&query, ", KEY(%s)", item->name); … … 1590 1590 while ((item = psListGetAndIncrement(cursor))) { 1591 1591 // don't compile a regex unless we have too 1592 if ( strcasestr(item->comment, "FKEY") == NULL) {1592 if (psStrcasestr(item->comment, "FKEY") == NULL) { 1593 1593 continue; 1594 1594 } … … 1872 1872 psMetadataItem *mItem = NULL; 1873 1873 while ((mItem = psListGetAndIncrement(mCursor))) { 1874 if (mItem->comment && strcasestr(mItem->comment, "==")) {1874 if (mItem->comment && psStrcasestr(mItem->comment, "==")) { 1875 1875 logicalOp = "OR"; 1876 1876 break; … … 2096 2096 psStringAppend(&query, "%s IS NULL", itemName); 2097 2097 } else { 2098 if (item->comment && strcasestr(item->comment, "LIKE")) {2098 if (item->comment && psStrcasestr(item->comment, "LIKE")) { 2099 2099 // XXX ASC NOTE: we should have a better match for 2100 2100 // char & varchar columns than this. LIKE is OK for -
trunk/psLib/src/sys/psString.h
r12517 r12885 11 11 * @author Joshua Hoblitt, University of Hawaii 12 12 * 13 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2007-0 3-21 21:37:58 $13 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2007-04-18 19:37:08 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 309 309 } 310 310 311 #ifndef DOXYGEN 312 #if NO_STRCASESTR 313 // this means that the system's libc does not provide strcasestr() 314 #define strcasestr(...) p_psstrcasestr(__VA_ARGS__) 315 extern char *p_psstrcasestr (const char *haystack, const char *needle) 316 __THROW __attribute_pure__ __nonnull ((1, 2)); 317 #endif // if NO_STRCASESTR 318 #endif // ifndef DOXYGEN 319 311 char *psStrcasestr (const char *haystack, const char *needle); 320 312 321 313 /// @} -
trunk/psLib/src/sys/strcasestr.c
r10949 r12885 49 49 #undef __strcasestr 50 50 51 // was named __strcasestr (phaystack, pneedle)52 51 char * 53 p_psstrcasestr (phaystack, pneedle) 54 const char *phaystack; 55 const char *pneedle; 52 psStrcasestr(const char *phaystack, 53 const char *pneedle) 56 54 { 57 55 register const unsigned char *haystack, *needle; … … 134 132 return 0; 135 133 } 136 137 //weak_alias (__strcasestr, strcasestr)
Note:
See TracChangeset
for help on using the changeset viewer.
