IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12885


Ignore:
Timestamp:
Apr 18, 2007, 9:37:31 AM (19 years ago)
Author:
rhl
Message:

strcasestr isn't in posix (and is in C namespace). Use psStrcasestr

Location:
trunk/psLib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r12502 r12885  
    8484dnl check the systems endianness
    8585AC_C_BIGENDIAN
    86 
    87 dnl set NO_STRCASESTR if we can't find strcasestr
    88 AC_CHECK_FUNC([strcasestr], [], [AC_SUBST(NO_STRCASESTR, [1])])
    8986
    9087AC_PREFIX_DEFAULT([/usr/local])
  • trunk/psLib/src/db/psDB.c

    r12552 r12885  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.141 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2007-03-22 22:48:34 $
     14 *  @version $Revision: 1.142 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2007-04-18 19:37:31 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    15301530        }
    15311531
    1532         if (strcasestr(item->comment, "AUTO_INCREMENT")) {
     1532        if (psStrcasestr(item->comment, "AUTO_INCREMENT")) {
    15331533            psStringAppend(&query, " %s", "AUTO_INCREMENT");
    15341534        }
    1535         if (strcasestr(item->comment, "Unique")) {
     1535        if (psStrcasestr(item->comment, "Unique")) {
    15361536            psStringAppend(&query, " %s", "UNIQUE");
    15371537        }
    1538         if (strcasestr(item->comment, "NOT NULL")) {
     1538        if (psStrcasestr(item->comment, "NOT NULL")) {
    15391539            psStringAppend(&query, " %s", "NOT NULL");
    15401540        }
     
    15541554    psArray *pKeys = psArrayAllocEmpty(1);
    15551555    while ((item = psListGetAndIncrement(cursor))) {
    1556         if (strcasestr(item->comment, "Primary Key")) {
     1556        if (psStrcasestr(item->comment, "Primary Key")) {
    15571557            psArrayAdd(pKeys, 0, item->name);
    15581558        }
     
    15761576    while ((item = psListGetAndIncrement(cursor))) {
    15771577        // 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)) {
    15801580            psStringAppend(&query, ", KEY(%s)", item->name);
    1581         } else if (strcasestr(item->comment, "AUTO_INCREMENT")) {
     1581        } else if (psStrcasestr(item->comment, "AUTO_INCREMENT")) {
    15821582            // this needs to be recognized as a key if it wasn't already
    15831583            psStringAppend(&query, ", KEY(%s)", item->name);
     
    15901590    while ((item = psListGetAndIncrement(cursor))) {
    15911591        // don't compile a regex unless we have too
    1592         if (strcasestr(item->comment, "FKEY") == NULL) {
     1592        if (psStrcasestr(item->comment, "FKEY") == NULL) {
    15931593            continue;
    15941594        }
     
    18721872            psMetadataItem *mItem = NULL;
    18731873            while ((mItem = psListGetAndIncrement(mCursor))) {
    1874                 if (mItem->comment && strcasestr(mItem->comment, "==")) {
     1874                if (mItem->comment && psStrcasestr(mItem->comment, "==")) {
    18751875                    logicalOp = "OR";
    18761876                    break;
     
    20962096            psStringAppend(&query, "%s IS NULL", itemName);
    20972097        } else {
    2098             if (item->comment && strcasestr(item->comment, "LIKE")) {
     2098            if (item->comment && psStrcasestr(item->comment, "LIKE")) {
    20992099                // XXX ASC NOTE: we should have a better match for
    21002100                // char & varchar columns than this.  LIKE is OK for
  • trunk/psLib/src/sys/psString.h

    r12517 r12885  
    1111 * @author Joshua Hoblitt, University of Hawaii
    1212 *
    13  * @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    14  * @date $Date: 2007-03-21 21:37:58 $
     13 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     14 * @date $Date: 2007-04-18 19:37:08 $
    1515 *
    1616 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    309309}
    310310
    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 
     311char *psStrcasestr (const char *haystack, const char *needle);
    320312
    321313/// @}
  • trunk/psLib/src/sys/strcasestr.c

    r10949 r12885  
    4949#undef __strcasestr
    5050
    51 // was named __strcasestr (phaystack, pneedle)
    5251char *
    53 p_psstrcasestr (phaystack, pneedle)
    54 const char *phaystack;
    55 const char *pneedle;
     52psStrcasestr(const char *phaystack,
     53             const char *pneedle)
    5654{
    5755    register const unsigned char *haystack, *needle;
     
    134132    return 0;
    135133}
    136 
    137 //weak_alias (__strcasestr, strcasestr)
Note: See TracChangeset for help on using the changeset viewer.