include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949
This commit is contained in:
Jérôme Duval 2014-08-07 23:12:54 +02:00
parent 1c9081d343
commit 3aeed6607c
125 changed files with 184 additions and 96 deletions

View File

@ -56,10 +56,6 @@ extern size_t strxfrm(char *string1, const char *string2, size_t length);
extern char *strerror(int errorCode);
extern int strerror_r(int errorCode, char *buffer, size_t bufferSize);
/* non-standard string functions */
extern int strcasecmp(const char *string1, const char *string2);
extern int strncasecmp(const char *string1, const char *string2, size_t length);
extern char *strcasestr(const char *string, const char *searchString);
extern char *strdup(const char *string);
@ -78,15 +74,6 @@ extern char *strupr(char *string);
extern const char *strsignal(int signum);
/* legacy compatibility -- might be removed one day */
#define bcmp(a, b, length) memcmp((a), (b), (length))
#define bcopy(source, dest, length) memmove((dest), (source), (length))
#define bzero(buffer, length) memset((buffer), 0, (length))
extern int ffs(int i);
extern char *index(const char *s, int c);
extern char *rindex(char const *s, int c);
#ifdef __cplusplus
}
#endif

View File

@ -1,6 +1,34 @@
/*
* Copyright 2014 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _STRINGS_H_
#define _STRINGS_H_
#include <string.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int ffs(int i);
extern int strcasecmp(const char *string1, const char *string2);
extern int strncasecmp(const char *string1, const char *string2,
size_t length);
/* legacy compatibility -- might be removed one day */
#define bcmp(a, b, length) memcmp((a), (b), (length))
#define bcopy(source, dest, length) memmove((dest), (source), (length))
#define bzero(buffer, length) memset((buffer), 0, (length))
extern char *index(const char *s, int c);
extern char *rindex(char const *s, int c);
#ifdef __cplusplus
}
#endif
#endif /* _STRINGS_H_ */

View File

@ -5,12 +5,14 @@
* Authors:
* JiSheng Zhang
*/
#ifndef _FW_GLUE_H
#define _FW_GLUE_H
#include <stdint.h>
#include <dpc.h>
#include <stdint.h>
#include <strings.h>
#define device_printf(dev, a...) dprintf("firewire:" a)
#define printf(a...) dprintf(a)

View File

@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <OS.h>

View File

@ -22,6 +22,7 @@
#include <Screen.h>
#include <new>
#include <strings.h>
#include <syslog.h>

View File

@ -13,7 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <String.h>
#include <Roster.h>

View File

@ -12,7 +12,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <InterfaceDefs.h>

View File

@ -9,6 +9,8 @@
#include "pci.h"
#include "pci_private.h"
#include <strings.h>
#include <arch/x86/msi.h>
#include <debug.h>

View File

@ -8,7 +8,7 @@
#include <new>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <util/AutoLock.h>

View File

@ -7,7 +7,7 @@
#include "VirtioSCSIPrivate.h"
#include <string.h>
#include <strings.h>
VirtioSCSIRequest::VirtioSCSIRequest(bool hasLock)

View File

@ -13,6 +13,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
struct cdtext_pack_data {

View File

@ -4,6 +4,7 @@
#include <list>
#include <algorithm>
#include <cstring>
#include <strings.h>
#define stricmp strcasecmp

View File

@ -2,6 +2,7 @@
// Y.Takagi
#include <string.h>
#include <strings.h>
#include <Button.h>
#include <Rect.h>

View File

@ -9,6 +9,7 @@
#include <pwd.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include "URL.h"

View File

@ -7,7 +7,7 @@
# include <net/socket.h>
#endif
#include <iostream>
#include <string.h>
#include <strings.h>
#include <stdio.h>
char *itoa(int i, char *buf, int unit)
{

View File

@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
//#define TRACE(x) printf x

View File

@ -7,6 +7,7 @@
#include "table/TableColumns.h"
#include <stdio.h>
#include <strings.h>
#include "util/TimeUtils.h"

View File

@ -37,6 +37,7 @@ All rights reserved.
#include "BarApp.h"
#include <locale.h>
#include <strings.h>
#include <AppFileInfo.h>
#include <Autolock.h>

View File

@ -36,7 +36,7 @@ All rights reserved.
#include "ExpandoMenuBar.h"
#include <string.h>
#include <strings.h>
#include <Autolock.h>
#include <Bitmap.h>

View File

@ -38,7 +38,7 @@ All rights reserved.
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <Debug.h>
#include <Roster.h>

View File

@ -36,9 +36,9 @@ All rights reserved.
#include "Switcher.h"
#include <string.h>
#include <stdlib.h>
#include <float.h>
#include <stdlib.h>
#include <strings.h>
#include <Bitmap.h>
#include <Debug.h>

View File

@ -36,7 +36,7 @@ All rights reserved.
#include "TeamMenu.h"
#include <string.h>
#include <strings.h>
#include <Application.h>
#include <Debug.h>

View File

@ -38,7 +38,7 @@ All rights reserved.
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <Catalog.h>
#include <Locale.h>

View File

@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Alert.h>
#include <Application.h>

View File

@ -11,7 +11,7 @@
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Message.h>

View File

@ -8,6 +8,8 @@
#include "SVGImporter.h"
#include <strings.h>
#include <Alert.h>
#include <Catalog.h>
#include <Entry.h>

View File

@ -8,7 +8,7 @@
#include "InstallerWindow.h"
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <Alert.h>
#include <Application.h>

View File

@ -11,6 +11,7 @@
#include <set>
#include <string>
#include <strings.h>
#include <Alert.h>
#include <Autolock.h>

View File

@ -33,10 +33,10 @@ of their respective holders. All rights reserved.
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <Alert.h>
#include <Beep.h>

View File

@ -66,7 +66,7 @@ of their respective holders. All rights reserved.
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <time.h>

View File

@ -35,13 +35,13 @@ of their respective holders. All rights reserved.
#include "MailWindow.h"
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <strings.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <Autolock.h>
#include <Clipboard.h>

View File

@ -37,7 +37,7 @@ of their respective holders. All rights reserved.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Application.h>
#include <CharacterSet.h>

View File

@ -36,7 +36,7 @@ of their respective holders. All rights reserved.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Clipboard.h>
#include <InterfaceKit.h>

View File

@ -26,6 +26,7 @@
#include <debugger.h>
#include <new>
#include <stdio.h>
#include <strings.h>
#include <AppFileInfo.h>
#include <Application.h>

View File

@ -18,7 +18,7 @@
#include <net/if.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <unistd.h>

View File

@ -50,7 +50,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
//#include <syslog.h>
#include <unistd.h>
#include <stdarg.h>

View File

@ -15,7 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <AppDefs.h>
#include <Bitmap.h>

View File

@ -32,7 +32,7 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>

View File

@ -12,6 +12,7 @@
#include <ctype.h>
#include <stdio.h>
#include <strings.h>
#include <Application.h>
#include <Catalog.h>

View File

@ -18,7 +18,7 @@
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <time.h>
#include <Alert.h>

View File

@ -17,6 +17,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>

View File

@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <signal.h>

View File

@ -3,11 +3,15 @@
* (c) 2002, Carlos Hasan, for OpenBeOS.
*/
#include <string.h>
#include <app/Application.h>
#include <interface/InterfaceDefs.h>
int main(int argc, char *argv[])
#include <strings.h>
#include <Application.h>
#include <InterfaceDefs.h>
int
main(int argc, char *argv[])
{
BApplication app("application/x-vnd.Haiku-ffm");
bool follow;
@ -17,8 +21,7 @@ int main(int argc, char *argv[])
follow = true;
else
follow = false;
}
else {
} else {
follow = true;
}

View File

@ -59,6 +59,7 @@ __FBSDID("$FreeBSD: src/sys/dev/firewire/fwcrom.c,v 1.14 2006/02/04 21:37:39 imp
#include <KernelExport.h>
#include <ByteOrder.h>
#include <string.h>
#include <strings.h>
#include "fwglue.h"
#endif
#else

View File

@ -104,6 +104,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <AppKit.h>
#include <Path.h>
#include <SupportDefs.h>

View File

@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <syslog.h>
#include <unistd.h>

View File

@ -467,9 +467,10 @@
/* Standard C Library. */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <strings.h>
/* Standard C++ library. */

View File

@ -33,6 +33,7 @@ THE SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include "fat.h"

View File

@ -8,6 +8,7 @@
#include <OS.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <InterfaceDefs.h>

View File

@ -19,7 +19,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Entry.h>
#include <List.h>

View File

@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Alert.h>
#include <Application.h>

View File

@ -12,7 +12,7 @@
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <vector>
#include <Application.h>

View File

@ -17,10 +17,10 @@
#include <Mime.h>
#include <NodeInfo.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <strings.h>
extern const char *__progname;

View File

@ -16,6 +16,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <Alert.h>

View File

@ -25,7 +25,7 @@
#include <new>
#include <stdio.h>
#include <string.h>
#include <strings.h>
// debugging

View File

@ -14,7 +14,7 @@
#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <AppFileInfo.h>

View File

@ -9,6 +9,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <strings.h>
class _EXPORT BMailComponent;
class _EXPORT BTextMailComponent;

View File

@ -9,7 +9,7 @@
#include <Mime.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
class _EXPORT BMIMEMultipartMailContainer;

View File

@ -20,12 +20,12 @@
#include <Messenger.h>
#include <Path.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/utsname.h>
#include <ctype.h>
#include <parsedate.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <sys/utsname.h>
#include <MailMessage.h>
#include <MailAttachment.h>

View File

@ -15,6 +15,7 @@ class _EXPORT BMailMessage;
#include <MailMessage.h>
#include <stdio.h>
#include <strings.h>
struct CharsetConversionEntry
{

View File

@ -6,6 +6,7 @@
#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <SupportDefs.h>

View File

@ -7,7 +7,7 @@
#include <mail_util.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#define __USE_GNU
#include <regex.h>

View File

@ -20,6 +20,11 @@
#ifndef port_after_h
#define port_after_h
#ifdef __HAIKU__
#ifdef _STRING_H_
#include <strings.h>
#endif
#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>

View File

@ -12,6 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <File.h>
#include <String.h>

View File

@ -14,7 +14,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <m_apm.h>

View File

@ -11,6 +11,7 @@
#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <StorageDefs.h>
#include <SupportDefs.h>

View File

@ -12,6 +12,7 @@
#include "AddOnMonitorHandler.h"
#include <string.h>
#include <strings.h>
#include <Autolock.h>
#include <Directory.h>

View File

@ -23,7 +23,7 @@
#include <ctype.h>
#include <new>
#include <stdio.h>
#include <string.h>
#include <strings.h>
using namespace BPrivate;

View File

@ -20,6 +20,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <Debug.h>
#include <StringList.h>

View File

@ -1,4 +1,5 @@
#include <string.h>
#include <strings.h>
#include <CharacterSet.h>
#include <CharacterSetRoster.h>
#include "character_sets.h"

View File

@ -59,7 +59,7 @@ All rights reserved.
#include <fs_attr.h>
#include <image.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <algorithm>

View File

@ -47,7 +47,7 @@ respective holders. All rights reserved.
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <Alert.h>

View File

@ -69,7 +69,7 @@ All rights reserved.
#include <fs_attr.h>
#include <parsedate.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <utility>
#include "Attributes.h"

View File

@ -34,6 +34,8 @@ All rights reserved.
#include <Mime.h>
#include <strings.h>
#include "AutoLock.h"
#include "MimeTypeList.h"
#include "Thread.h"

View File

@ -42,7 +42,7 @@ All rights reserved.
#include "Model.h"
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <fs_info.h>
#include <fs_attr.h>

View File

@ -35,8 +35,8 @@ their respective holders. All rights reserved.
// NavMenu is a hierarchical menu of volumes, folders, files and queries
// displays icons, uses the SlowMenu API for full interruptability
#include <string.h>
#include <stdlib.h>
#include <strings.h>
#include "NavMenu.h"

View File

@ -55,7 +55,7 @@ All rights reserved.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
const char* kDefaultOpenWithTemplate = "OpenWithSettings";

View File

@ -43,7 +43,7 @@ All rights reserved.
#include <float.h>
#include <map>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <compat/sys/stat.h>

View File

@ -39,7 +39,7 @@ All rights reserved.
#include <fs_info.h>
#include <image.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/resource.h>
#include <unistd.h>

View File

@ -36,6 +36,7 @@ All rights reserved.
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
// #pragma mark - TrackerString

View File

@ -37,7 +37,7 @@ All rights reserved.
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <fs_attr.h>
#include <parsedate.h>

View File

@ -32,6 +32,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
using namespace BPrivate;

View File

@ -16,7 +16,7 @@
#include <TranslatorRoster.h>
#include <new>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -7,7 +7,6 @@
#include <stddef.h>
#include <string.h>
#include <sys/haiku-module.h>

View File

@ -10,6 +10,7 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <machine/atomic.h>
#include <machine/cpufunc.h>

View File

@ -39,7 +39,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#undef B_TRANSLATION_CONTEXT

View File

@ -36,6 +36,7 @@
#include <VolumeRoster.h>
#include <stdio.h>
#include <strings.h>
// TODO: think about adopting Tracker's info window style here (pressable path)

View File

@ -26,7 +26,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#undef B_TRANSLATION_CONTEXT

View File

@ -20,7 +20,7 @@
#include <String.h>
#include <TextControl.h>
#include <string.h>
#include <strings.h>
#undef B_TRANSLATION_CONTEXT

View File

@ -24,7 +24,7 @@
#include <Resources.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#undef B_TRANSLATION_CONTEXT

View File

@ -44,6 +44,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#undef B_TRANSLATION_CONTEXT

View File

@ -8,7 +8,7 @@
#include <new>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Application.h>
#include <AppFileInfo.h>

View File

@ -10,6 +10,8 @@
#include <Bitmap.h>
#include <MessageRunner.h>
#include <strings.h>
// TODO: lazy type collecting (super types only at startup)

View File

@ -18,7 +18,7 @@
#include <String.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#undef B_TRANSLATION_CONTEXT

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <Alert.h>
#include <Application.h>

View File

@ -13,6 +13,7 @@
#include "ScreenSaverWindow.h"
#include <stdio.h>
#include <strings.h>
#include <Alignment.h>
#include <Application.h>

View File

@ -8,6 +8,7 @@
#include <new>
#include <string.h>
#include <strings.h>
#include <Message.h>

View File

@ -26,7 +26,7 @@
#include <safemode_defs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/ioctl.h>
#include <syscalls.h>
#include <syslog.h>

View File

@ -10,7 +10,7 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <Alert.h>

View File

@ -32,6 +32,7 @@
#include <String.h>
#include <stdio.h>
#include <strings.h>
#include "SystemKeymap.h"
// this is an automatically generated file

Some files were not shown because too many files have changed in this diff Show More