17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 237c478bd9Sstevel@tonic-gate * Copyright (c) 1995, 1996, by Sun Microsystems, Inc. 247c478bd9Sstevel@tonic-gate * All rights reserved. 257c478bd9Sstevel@tonic-gate */ 26*2d08521bSGarrett D'Amore /* 27*2d08521bSGarrett D'Amore * Copyright 2013 Garrett D'Amore <garrett@damore.org> 28*2d08521bSGarrett D'Amore */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef _STRINGS_H 317c478bd9Sstevel@tonic-gate #define _STRINGS_H 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #include <sys/types.h> 347c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h> 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) 377c478bd9Sstevel@tonic-gate #include <string.h> 387c478bd9Sstevel@tonic-gate #endif 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #ifdef __cplusplus 417c478bd9Sstevel@tonic-gate extern "C" { 427c478bd9Sstevel@tonic-gate #endif 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #if defined(__STDC__) 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate extern int bcmp(const void *, const void *, size_t); 477c478bd9Sstevel@tonic-gate extern void bcopy(const void *, void *, size_t); 487c478bd9Sstevel@tonic-gate extern void bzero(void *, size_t); 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate extern char *index(const char *, int); 517c478bd9Sstevel@tonic-gate extern char *rindex(const char *, int); 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate /* 547c478bd9Sstevel@tonic-gate * X/Open System Interfaces and Headers, Issue 4, Version 2, defines 557c478bd9Sstevel@tonic-gate * both <string.h> and <strings.h>. The namespace requirements 567c478bd9Sstevel@tonic-gate * do not permit the visibility of anything other than what is 577c478bd9Sstevel@tonic-gate * specifically defined for each of these headers. As a result, 587c478bd9Sstevel@tonic-gate * inclusion of <string.h> would result in declarations not allowed 597c478bd9Sstevel@tonic-gate * in <strings.h>, and making the following prototypes visible for 607c478bd9Sstevel@tonic-gate * anything other than X/Open UNIX Extension would result in 617c478bd9Sstevel@tonic-gate * conflicts with what is now in <string.h>. 627c478bd9Sstevel@tonic-gate */ 637c478bd9Sstevel@tonic-gate #if defined(_XPG4_2) && !defined(__EXTENSIONS__) 647c478bd9Sstevel@tonic-gate extern int ffs(int); 657c478bd9Sstevel@tonic-gate extern int strcasecmp(const char *, const char *); 667c478bd9Sstevel@tonic-gate extern int strncasecmp(const char *, const char *, size_t); 67*2d08521bSGarrett D'Amore #if defined(_XPG7) 68*2d08521bSGarrett D'Amore #ifndef _LOCALE_T 69*2d08521bSGarrett D'Amore #define _LOCALE_T 70*2d08521bSGarrett D'Amore typedef struct locale *locale_t; 71*2d08521bSGarrett D'Amore #endif 72*2d08521bSGarrett D'Amore extern int strcasecmp_l(const char *, const char *, locale_t); 73*2d08521bSGarrett D'Amore extern int strncasecmp_l(const char *, const char *, size_t, locale_t); 74*2d08521bSGarrett D'Amore #endif /* defined(_XPG7) */ 757c478bd9Sstevel@tonic-gate #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */ 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate #else 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate extern int bcmp(); 807c478bd9Sstevel@tonic-gate extern void bcopy(); 817c478bd9Sstevel@tonic-gate extern void bzero(); 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate extern char *index(); 847c478bd9Sstevel@tonic-gate extern char *rindex(); 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate #if defined(_XPG4_2) && !defined(__EXTENSIONS__) 877c478bd9Sstevel@tonic-gate extern int ffs(); 887c478bd9Sstevel@tonic-gate extern int strcasecmp(); 897c478bd9Sstevel@tonic-gate extern int strncasecmp(); 90*2d08521bSGarrett D'Amore #if defined(_XPG7) 91*2d08521bSGarrett D'Amore extern int strcasecmp_l(); 92*2d08521bSGarrett D'Amore extern int strncasecmp_l(); 93*2d08521bSGarrett D'Amore #endif 947c478bd9Sstevel@tonic-gate #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */ 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate #endif /* __STDC__ */ 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate #ifdef __cplusplus 997c478bd9Sstevel@tonic-gate } 1007c478bd9Sstevel@tonic-gate #endif 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate #endif /* _STRINGS_H */ 103