VirtualBox

source: vbox/trunk/src/libs/kStuff/iprt/kHlpString-iprt.cpp@ 5568

Last change on this file since 5568 was 5568, checked in by vboxsync, 17 years ago

export

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 2.8 KB
Line 
1/* $Id: kHlpString-iprt.cpp 5568 2007-10-30 18:38:37Z vboxsync $ */
2/** @file
3 * kHlpString - String And Memory Routines, IPRT based implementation.
4 */
5
6/*
7 * Copyright (c) 2007 knut st. osmundsen <bird-kStuff-spam@anduin.net>
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 */
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include <k/kHlpString.h>
23#include <iprt/string.h>
24
25
26#ifndef kHlpMemChr
27void *kHlpMemChr(const void *pv, int ch, KSIZE cb)
28{
29 return (void *)memchr(pv, ch, cb);
30}
31#endif
32
33
34#ifndef kHlpMemComp
35int kHlpMemComp(const void *pv1, const void *pv2, KSIZE cb)
36{
37 return memcmp(pv1, pv2, cb);
38}
39#endif
40
41
42#ifndef kHlpMemCopy
43void *kHlpMemCopy(void *pv1, const void *pv2, KSIZE cb)
44{
45 return memcpy(pv1, pv2, cb);
46}
47#endif
48
49
50#ifndef kHlpMemPCopy
51void *kHlpMemPCopy(void *pv1, const void *pv2, KSIZE cb)
52{
53 return (KU8 *)memcpy(pv1, pv2, cb) + cb;
54}
55#endif
56
57
58#ifndef kHlpMemMove
59void *kHlpMemMove(void *pv1, const void *pv2, KSIZE cb)
60{
61 return memmove(pv1, pv2, cb);
62}
63#endif
64
65
66#ifndef kHlpMemPMove
67void *kHlpMemPMove(void *pv1, const void *pv2, KSIZE cb)
68{
69 return (KU8 *)memmove(pv1, pv2, cb) + cb;
70}
71#endif
72
73
74#ifndef kHlpMemSet
75void *kHlpMemSet(void *pv1, int ch, KSIZE cb)
76{
77 return memset(pv1, ch, cb);
78}
79#endif
80
81
82#ifndef kHlpMemPSet
83void *kHlpMemPSet(void *pv1, int ch, KSIZE cb)
84{
85 return (KU8 *)memset(pv1, ch, cb) + cb;
86}
87#endif
88
89
90#ifndef kHlpStrCat
91char *kHlpStrCat(char *psz1, const char *psz2)
92{
93 return strcat(psz1, psz2);
94}
95#endif
96
97
98#ifndef kHlpStrNCat
99char *kHlpStrNCat(char *psz1, const char *psz2, KSIZE cb)
100{
101 return strncat(psz1, psz2, cb);
102}
103#endif
104
105
106#ifndef kHlpStrChr
107char *kHlpStrChr(const char *psz, int ch)
108{
109 return (char *)strchr(psz, ch);
110}
111#endif
112
113
114#ifndef kHlpStrRChr
115char *kHlpStrRChr(const char *psz, int ch)
116{
117 return (char *)strrchr(psz, ch);
118}
119#endif
120
121
122#ifndef kHlpStrComp
123int kHlpStrComp(const char *psz1, const char *psz2)
124{
125 return strcmp(psz1, psz2);
126}
127#endif
128
129
130#ifndef kHlpStrNComp
131int kHlpStrNComp(const char *psz1, const char *psz2, KSIZE cch)
132{
133 return strncmp(psz1, psz2, cch);
134}
135#endif
136
137
138#ifndef kHlpStrCopy
139char *kHlpStrCopy(char *psz1, const char *psz2)
140{
141 return strcpy(psz1, psz2);
142}
143#endif
144
145
146#ifndef kHlpStrLen
147KSIZE kHlpStrLen(const char *psz1)
148{
149 return strlen(psz1);
150}
151#endif
152
153
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette