1*a3f66598SOliver Tappe /* 2*a3f66598SOliver Tappe * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3*a3f66598SOliver Tappe * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de. 4*a3f66598SOliver Tappe * All rights reserved. Distributed under the terms of the MIT License. 5*a3f66598SOliver Tappe */ 6*a3f66598SOliver Tappe 7*a3f66598SOliver Tappe #define B_USE_POSITIVE_POSIX_ERRORS 8*a3f66598SOliver Tappe #include <errno.h> 9*a3f66598SOliver Tappe #include <string.h> 10*a3f66598SOliver Tappe 11*a3f66598SOliver Tappe #include "LocaleBackend.h" 12*a3f66598SOliver Tappe 13*a3f66598SOliver Tappe 14*a3f66598SOliver Tappe using BPrivate::gLocaleBackend; 15*a3f66598SOliver Tappe 16*a3f66598SOliver Tappe 17*a3f66598SOliver Tappe extern "C" int 18*a3f66598SOliver Tappe strcoll(const char *a, const char *b) 19*a3f66598SOliver Tappe { 20*a3f66598SOliver Tappe if (gLocaleBackend != NULL) { 21*a3f66598SOliver Tappe int result = 0; 22*a3f66598SOliver Tappe status_t status = gLocaleBackend->Strcoll(a, b, result); 23*a3f66598SOliver Tappe 24*a3f66598SOliver Tappe if (status != B_OK) 25*a3f66598SOliver Tappe errno = EINVAL; 26*a3f66598SOliver Tappe 27*a3f66598SOliver Tappe return result; 28*a3f66598SOliver Tappe } 29*a3f66598SOliver Tappe 30*a3f66598SOliver Tappe return strcmp(a, b); 31*a3f66598SOliver Tappe } 32