VirtualBox

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

Last change on this file since 53401 was 44529, checked in by vboxsync, 12 years ago

header (C) fixes

  • 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 44529 2013-02-04 15:54:15Z vboxsync $ */
2/** @file
3 * kHlpString - String And Memory Routines, IPRT based implementation.
4 */
5
6/*
7 * Copyright (C) 2007-2010 Oracle Corporation
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 (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18/*******************************************************************************
19* Header Files *
20*******************************************************************************/
21#include <k/kHlpString.h>
22#include <iprt/string.h>
23
24
25#ifndef kHlpMemChr
26void *kHlpMemChr(const void *pv, int ch, KSIZE cb)
27{
28 return (void *)memchr(pv, ch, cb);
29}
30#endif
31
32
33#ifndef kHlpMemComp
34int kHlpMemComp(const void *pv1, const void *pv2, KSIZE cb)
35{
36 return memcmp(pv1, pv2, cb);
37}
38#endif
39
40
41#ifndef kHlpMemCopy
42void *kHlpMemCopy(void *pv1, const void *pv2, KSIZE cb)
43{
44 return memcpy(pv1, pv2, cb);
45}
46#endif
47
48
49#ifndef kHlpMemPCopy
50void *kHlpMemPCopy(void *pv1, const void *pv2, KSIZE cb)
51{
52 return (KU8 *)memcpy(pv1, pv2, cb) + cb;
53}
54#endif
55
56
57#ifndef kHlpMemMove
58void *kHlpMemMove(void *pv1, const void *pv2, KSIZE cb)
59{
60 return memmove(pv1, pv2, cb);
61}
62#endif
63
64
65#ifndef kHlpMemPMove
66void *kHlpMemPMove(void *pv1, const void *pv2, KSIZE cb)
67{
68 return (KU8 *)memmove(pv1, pv2, cb) + cb;
69}
70#endif
71
72
73#ifndef kHlpMemSet
74void *kHlpMemSet(void *pv1, int ch, KSIZE cb)
75{
76 return memset(pv1, ch, cb);
77}
78#endif
79
80
81#ifndef kHlpMemPSet
82void *kHlpMemPSet(void *pv1, int ch, KSIZE cb)
83{
84 return (KU8 *)memset(pv1, ch, cb) + cb;
85}
86#endif
87
88
89#ifndef kHlpStrCat
90char *kHlpStrCat(char *psz1, const char *psz2)
91{
92 return strcat(psz1, psz2);
93}
94#endif
95
96
97#ifndef kHlpStrNCat
98char *kHlpStrNCat(char *psz1, const char *psz2, KSIZE cb)
99{
100 return strncat(psz1, psz2, cb);
101}
102#endif
103
104
105#ifndef kHlpStrChr
106char *kHlpStrChr(const char *psz, int ch)
107{
108 return (char *)strchr(psz, ch);
109}
110#endif
111
112
113#ifndef kHlpStrRChr
114char *kHlpStrRChr(const char *psz, int ch)
115{
116 return (char *)strrchr(psz, ch);
117}
118#endif
119
120
121#ifndef kHlpStrComp
122int kHlpStrComp(const char *psz1, const char *psz2)
123{
124 return strcmp(psz1, psz2);
125}
126#endif
127
128
129#ifndef kHlpStrNComp
130int kHlpStrNComp(const char *psz1, const char *psz2, KSIZE cch)
131{
132 return strncmp(psz1, psz2, cch);
133}
134#endif
135
136
137#ifndef kHlpStrCopy
138char *kHlpStrCopy(char *psz1, const char *psz2)
139{
140 return strcpy(psz1, psz2);
141}
142#endif
143
144
145#ifndef kHlpStrLen
146KSIZE kHlpStrLen(const char *psz1)
147{
148 return strlen(psz1);
149}
150#endif
151
152
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