| 1 | /* $Id: crt.cpp,v 1.1 1999-06-22 16:18:14 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 5 | * Win32 NT Runtime / NTDLL for OS/2
|
|---|
| 6 | * Copyright 1999 Patrick Haller (phaller@gmx.net)
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | #include <odin.h>
|
|---|
| 10 | #include <stdlib.h>
|
|---|
| 11 | #include <string.h>
|
|---|
| 12 | #include "ntdll.h"
|
|---|
| 13 |
|
|---|
| 14 | /*
|
|---|
| 15 | NTDLL.sprintf
|
|---|
| 16 | NTDLL.wcslen
|
|---|
| 17 | NTDLL._itoa
|
|---|
| 18 | NTDLL._wcsicmp
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | /*****************************************************************************
|
|---|
| 23 | * Name :
|
|---|
| 24 | * Purpose :
|
|---|
| 25 | * Parameters:
|
|---|
| 26 | * Variables :
|
|---|
| 27 | * Result :
|
|---|
| 28 | * Remark : NTDLL.914
|
|---|
| 29 | * Status :
|
|---|
| 30 | *
|
|---|
| 31 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 32 | *****************************************************************************/
|
|---|
| 33 |
|
|---|
| 34 | LPSTR CDECL OS2strcat( LPSTR str1,
|
|---|
| 35 | const LPSTR str2)
|
|---|
| 36 | {
|
|---|
| 37 | dprintf(("NTDLL: strcat(%s,%s)\n",
|
|---|
| 38 | str1,
|
|---|
| 39 | str2));
|
|---|
| 40 |
|
|---|
| 41 | return (strcat(str1, str2));
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | /*****************************************************************************
|
|---|
| 46 | * Name :
|
|---|
| 47 | * Purpose :
|
|---|
| 48 | * Parameters:
|
|---|
| 49 | * Variables :
|
|---|
| 50 | * Result :
|
|---|
| 51 | * Remark : NTDLL.915
|
|---|
| 52 | * Status :
|
|---|
| 53 | *
|
|---|
| 54 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 55 | *****************************************************************************/
|
|---|
| 56 |
|
|---|
| 57 | LPSTR CDECL OS2strchr(const LPSTR str,
|
|---|
| 58 | int i)
|
|---|
| 59 | {
|
|---|
| 60 | dprintf(("NTDLL: strchr(%s,%08xh)\n",
|
|---|
| 61 | str,
|
|---|
| 62 | i));
|
|---|
| 63 |
|
|---|
| 64 | return (strchr(str, i));
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 | /*****************************************************************************
|
|---|
| 69 | * Name :
|
|---|
| 70 | * Purpose :
|
|---|
| 71 | * Parameters:
|
|---|
| 72 | * Variables :
|
|---|
| 73 | * Result :
|
|---|
| 74 | * Remark : NTDLL.916
|
|---|
| 75 | * Status :
|
|---|
| 76 | *
|
|---|
| 77 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 78 | *****************************************************************************/
|
|---|
| 79 |
|
|---|
| 80 | int CDECL OS2strcmp(const LPSTR str1,
|
|---|
| 81 | const LPSTR str2)
|
|---|
| 82 | {
|
|---|
| 83 | dprintf(("NTDLL: strcmp(%s,%s)\n",
|
|---|
| 84 | str1,
|
|---|
| 85 | str2));
|
|---|
| 86 |
|
|---|
| 87 | return (strcmp(str1, str2));
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | /*****************************************************************************
|
|---|
| 92 | * Name :
|
|---|
| 93 | * Purpose :
|
|---|
| 94 | * Parameters:
|
|---|
| 95 | * Variables :
|
|---|
| 96 | * Result :
|
|---|
| 97 | * Remark : NTDLL.917
|
|---|
| 98 | * Status :
|
|---|
| 99 | *
|
|---|
| 100 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 101 | *****************************************************************************/
|
|---|
| 102 |
|
|---|
| 103 | LPSTR CDECL OS2strcpy( LPSTR str1,
|
|---|
| 104 | const LPSTR str2)
|
|---|
| 105 | {
|
|---|
| 106 | dprintf(("NTDLL: strcpy(%s,%s)\n",
|
|---|
| 107 | str1,
|
|---|
| 108 | str2));
|
|---|
| 109 |
|
|---|
| 110 | return (strcpy(str1, str2));
|
|---|
| 111 | }
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 | /*****************************************************************************
|
|---|
| 115 | * Name :
|
|---|
| 116 | * Purpose :
|
|---|
| 117 | * Parameters:
|
|---|
| 118 | * Variables :
|
|---|
| 119 | * Result :
|
|---|
| 120 | * Remark : NTDLL.918
|
|---|
| 121 | * Status :
|
|---|
| 122 | *
|
|---|
| 123 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 124 | *****************************************************************************/
|
|---|
| 125 |
|
|---|
| 126 | size_t CDECL OS2strcspn(const LPSTR str1,
|
|---|
| 127 | LPSTR str2)
|
|---|
| 128 | {
|
|---|
| 129 | dprintf(("NTDLL: strcspn(%s,%s)\n",
|
|---|
| 130 | str1,
|
|---|
| 131 | str2));
|
|---|
| 132 |
|
|---|
| 133 | return (strcspn(str1, str2));
|
|---|
| 134 | }
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 | /*****************************************************************************
|
|---|
| 138 | * Name :
|
|---|
| 139 | * Purpose :
|
|---|
| 140 | * Parameters:
|
|---|
| 141 | * Variables :
|
|---|
| 142 | * Result :
|
|---|
| 143 | * Remark : NTDLL.919
|
|---|
| 144 | * Status :
|
|---|
| 145 | *
|
|---|
| 146 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 147 | *****************************************************************************/
|
|---|
| 148 |
|
|---|
| 149 | size_t CDECL OS2strlen(const LPSTR str)
|
|---|
| 150 | {
|
|---|
| 151 | dprintf(("NTDLL: strlen(%s)\n",
|
|---|
| 152 | str));
|
|---|
| 153 |
|
|---|
| 154 | return (strlen(str));
|
|---|
| 155 | }
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 | /*****************************************************************************
|
|---|
| 159 | * Name :
|
|---|
| 160 | * Purpose :
|
|---|
| 161 | * Parameters:
|
|---|
| 162 | * Variables :
|
|---|
| 163 | * Result :
|
|---|
| 164 | * Remark : NTDLL.920
|
|---|
| 165 | * Status :
|
|---|
| 166 | *
|
|---|
| 167 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 168 | *****************************************************************************/
|
|---|
| 169 |
|
|---|
| 170 | LPSTR CDECL OS2strncat( LPSTR str1,
|
|---|
| 171 | const LPSTR str2,
|
|---|
| 172 | size_t i)
|
|---|
| 173 | {
|
|---|
| 174 | dprintf(("NTDLL: strncat(%s,%s,%08xh)\n",
|
|---|
| 175 | str1,
|
|---|
| 176 | str2,
|
|---|
| 177 | i));
|
|---|
| 178 |
|
|---|
| 179 | return (strncat(str1, str2, i));
|
|---|
| 180 | }
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 | /*****************************************************************************
|
|---|
| 184 | * Name :
|
|---|
| 185 | * Purpose :
|
|---|
| 186 | * Parameters:
|
|---|
| 187 | * Variables :
|
|---|
| 188 | * Result :
|
|---|
| 189 | * Remark : NTDLL.921
|
|---|
| 190 | * Status :
|
|---|
| 191 | *
|
|---|
| 192 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 193 | *****************************************************************************/
|
|---|
| 194 |
|
|---|
| 195 | int CDECL OS2strncmp(const LPSTR str1,
|
|---|
| 196 | const LPSTR str2,
|
|---|
| 197 | size_t i)
|
|---|
| 198 | {
|
|---|
| 199 | dprintf(("NTDLL: strncmp(%s,%s,%08xh)\n",
|
|---|
| 200 | str1,
|
|---|
| 201 | str2,
|
|---|
| 202 | i));
|
|---|
| 203 |
|
|---|
| 204 | return (strncmp(str1, str2, i));
|
|---|
| 205 | }
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 | /*****************************************************************************
|
|---|
| 209 | * Name :
|
|---|
| 210 | * Purpose :
|
|---|
| 211 | * Parameters:
|
|---|
| 212 | * Variables :
|
|---|
| 213 | * Result :
|
|---|
| 214 | * Remark : NTDLL.922
|
|---|
| 215 | * Status :
|
|---|
| 216 | *
|
|---|
| 217 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 218 | *****************************************************************************/
|
|---|
| 219 |
|
|---|
| 220 | LPSTR CDECL OS2strncpy(const LPSTR str1,
|
|---|
| 221 | const LPSTR str2,
|
|---|
| 222 | size_t i)
|
|---|
| 223 | {
|
|---|
| 224 | dprintf(("NTDLL: strncpy(%s,%s,%08xh)\n",
|
|---|
| 225 | str1,
|
|---|
| 226 | str2,
|
|---|
| 227 | i));
|
|---|
| 228 |
|
|---|
| 229 | return (strncpy(str1, str2, i));
|
|---|
| 230 | }
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 | /*****************************************************************************
|
|---|
| 234 | * Name :
|
|---|
| 235 | * Purpose :
|
|---|
| 236 | * Parameters:
|
|---|
| 237 | * Variables :
|
|---|
| 238 | * Result :
|
|---|
| 239 | * Remark : NTDLL.923
|
|---|
| 240 | * Status :
|
|---|
| 241 | *
|
|---|
| 242 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 243 | *****************************************************************************/
|
|---|
| 244 |
|
|---|
| 245 | LPSTR CDECL OS2strpbrk(const LPSTR str1,
|
|---|
| 246 | const LPSTR str2)
|
|---|
| 247 | {
|
|---|
| 248 | dprintf(("NTDLL: strpbrk(%s,%s)\n",
|
|---|
| 249 | str1,
|
|---|
| 250 | str2));
|
|---|
| 251 |
|
|---|
| 252 | return (strpbrk(str1, str2));
|
|---|
| 253 | }
|
|---|
| 254 |
|
|---|
| 255 |
|
|---|
| 256 | /*****************************************************************************
|
|---|
| 257 | * Name :
|
|---|
| 258 | * Purpose :
|
|---|
| 259 | * Parameters:
|
|---|
| 260 | * Variables :
|
|---|
| 261 | * Result :
|
|---|
| 262 | * Remark : NTDLL.924
|
|---|
| 263 | * Status :
|
|---|
| 264 | *
|
|---|
| 265 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 266 | *****************************************************************************/
|
|---|
| 267 |
|
|---|
| 268 | LPSTR CDECL OS2strrchr(const LPSTR str,
|
|---|
| 269 | size_t i)
|
|---|
| 270 | {
|
|---|
| 271 | dprintf(("NTDLL: strrchr(%s,%08xh)\n",
|
|---|
| 272 | str,
|
|---|
| 273 | i));
|
|---|
| 274 |
|
|---|
| 275 | return (strrchr(str, i));
|
|---|
| 276 | }
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 | /*****************************************************************************
|
|---|
| 280 | * Name :
|
|---|
| 281 | * Purpose :
|
|---|
| 282 | * Parameters:
|
|---|
| 283 | * Variables :
|
|---|
| 284 | * Result :
|
|---|
| 285 | * Remark : NTDLL.925
|
|---|
| 286 | * Status :
|
|---|
| 287 | *
|
|---|
| 288 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 289 | *****************************************************************************/
|
|---|
| 290 |
|
|---|
| 291 | size_t CDECL OS2strspn(const LPSTR str1,
|
|---|
| 292 | const LPSTR str2)
|
|---|
| 293 | {
|
|---|
| 294 | dprintf(("NTDLL: strspn(%s,%s)\n",
|
|---|
| 295 | str1,
|
|---|
| 296 | str2));
|
|---|
| 297 |
|
|---|
| 298 | return (strspn(str1, str2));
|
|---|
| 299 | }
|
|---|
| 300 |
|
|---|
| 301 |
|
|---|
| 302 | /*****************************************************************************
|
|---|
| 303 | * Name :
|
|---|
| 304 | * Purpose :
|
|---|
| 305 | * Parameters:
|
|---|
| 306 | * Variables :
|
|---|
| 307 | * Result :
|
|---|
| 308 | * Remark : NTDLL.926
|
|---|
| 309 | * Status :
|
|---|
| 310 | *
|
|---|
| 311 | * Author : Patrick Haller [Thu, 1999/06/22 20:44]
|
|---|
| 312 | *****************************************************************************/
|
|---|
| 313 |
|
|---|
| 314 | LPSTR CDECL OS2strstr(const LPSTR str1,
|
|---|
| 315 | const LPSTR str2)
|
|---|
| 316 | {
|
|---|
| 317 | dprintf(("NTDLL: strstr(%s,%s)\n",
|
|---|
| 318 | str1,
|
|---|
| 319 | str2));
|
|---|
| 320 |
|
|---|
| 321 | return (strstr(str1, str2));
|
|---|
| 322 | }
|
|---|
| 323 |
|
|---|