andre@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #include "plstr.h" andre@0: #include andre@0: andre@0: PR_IMPLEMENT(PRIntn) andre@0: PL_strcmp(const char *a, const char *b) andre@0: { andre@0: if( ((const char *)0 == a) || (const char *)0 == b ) andre@0: return (PRIntn)(a-b); andre@0: andre@0: return (PRIntn)strcmp(a, b); andre@0: } andre@0: andre@0: PR_IMPLEMENT(PRIntn) andre@0: PL_strncmp(const char *a, const char *b, PRUint32 max) andre@0: { andre@0: if( ((const char *)0 == a) || (const char *)0 == b ) andre@0: return (PRIntn)(a-b); andre@0: andre@0: return (PRIntn)strncmp(a, b, (size_t)max); andre@0: }