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