source: trunk/src/NTDLL/crt.cpp@ 376

Last change on this file since 376 was 376, checked in by sandervl, 26 years ago

VAC 3.6.5 changes

File size: 21.6 KB
Line 
1/* $Id: crt.cpp,v 1.4 1999-07-23 18:06:25 sandervl 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 <stdio.h>
12#include <string.h>
13#include <math.h>
14#include <ctype.h>
15#include <wchar.h>
16#include <wcstr.h>
17#include <wctype.h>
18
19#include "ntdll.h"
20
21/*
22NTDLL.sprintf
23NTDLL._itoa
24NTDLL._wcsicmp
25*/
26
27
28/*****************************************************************************
29 * Name :
30 * Purpose :
31 * Parameters:
32 * Variables :
33 * Result :
34 * Remark : NTDLL.882
35 * Status :
36 *
37 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
38 *****************************************************************************/
39
40LPWSTR CDECL OS2_wcsupr(LPWSTR str)
41{
42 DWORD dwIndex;
43
44 dprintf(("NTDLL: _wcsupr(%08xh)\n",
45 str));
46
47 for (dwIndex = wcslen((const wchar_t*)str);
48 dwIndex;
49 dwIndex--)
50 {
51 towupper(str[dwIndex]);
52 }
53
54 return (str);
55}
56
57
58
59/*****************************************************************************
60 * Name :
61 * Purpose :
62 * Parameters:
63 * Variables :
64 * Result :
65 * Remark : NTDLL.883
66 * Status :
67 *
68 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
69 *****************************************************************************/
70
71double CDECL OS2abs(double d)
72{
73 dprintf(("NTDLL: abs(%f)\n",
74 d));
75
76 return (abs(d));
77}
78
79
80/*****************************************************************************
81 * Name :
82 * Purpose :
83 * Parameters:
84 * Variables :
85 * Result :
86 * Remark : NTDLL.884
87 * Status :
88 *
89 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
90 *****************************************************************************/
91
92double CDECL OS2atan(double d)
93{
94 dprintf(("NTDLL: atan(%f)\n",
95 d));
96
97 return (atan(d));
98}
99
100
101/*****************************************************************************
102 * Name :
103 * Purpose :
104 * Parameters:
105 * Variables :
106 * Result :
107 * Remark : NTDLL.885
108 * Status :
109 *
110 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
111 *****************************************************************************/
112
113int CDECL OS2atoi(LPSTR str)
114{
115 dprintf(("NTDLL: atoi(%s)\n",
116 str));
117
118 return (atoi(str));
119}
120
121
122/*****************************************************************************
123 * Name :
124 * Purpose :
125 * Parameters:
126 * Variables :
127 * Result :
128 * Remark : NTDLL.886
129 * Status :
130 *
131 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
132 *****************************************************************************/
133
134long CDECL OS2atol(LPSTR str)
135{
136 dprintf(("NTDLL: atol(%s)\n",
137 str));
138
139 return (atol(str));
140}
141
142
143/*****************************************************************************
144 * Name :
145 * Purpose :
146 * Parameters:
147 * Variables :
148 * Result :
149 * Remark : NTDLL.887
150 * Status :
151 *
152 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
153 *****************************************************************************/
154
155double CDECL OS2ceil(double d)
156{
157 dprintf(("NTDLL: ceil(%f)\n",
158 d));
159
160 return (ceil(d));
161}
162
163
164/*****************************************************************************
165 * Name :
166 * Purpose :
167 * Parameters:
168 * Variables :
169 * Result :
170 * Remark : NTDLL.888
171 * Status :
172 *
173 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
174 *****************************************************************************/
175
176double CDECL OS2cos(double d)
177{
178 dprintf(("NTDLL: cos(%f)\n",
179 d));
180
181 return (cos(d));
182}
183
184
185/*****************************************************************************
186 * Name :
187 * Purpose :
188 * Parameters:
189 * Variables :
190 * Result :
191 * Remark : NTDLL.889
192 * Status :
193 *
194 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
195 *****************************************************************************/
196
197double CDECL OS2fabs(double d)
198{
199 dprintf(("NTDLL: fabs(%f)\n",
200 d));
201
202 return (fabs(d));
203}
204
205
206/*****************************************************************************
207 * Name :
208 * Purpose :
209 * Parameters:
210 * Variables :
211 * Result :
212 * Remark : NTDLL.890
213 * Status :
214 *
215 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
216 *****************************************************************************/
217
218double CDECL OS2floor(double d)
219{
220 dprintf(("NTDLL: floor(%f)\n",
221 d));
222
223 return (floor(d));
224}
225
226
227/*****************************************************************************
228 * Name :
229 * Purpose :
230 * Parameters:
231 * Variables :
232 * Result :
233 * Remark : NTDLL.891
234 * Status :
235 *
236 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
237 *****************************************************************************/
238
239int CDECL OS2isalpha(int i)
240{
241 dprintf(("NTDLL: isalpha(%08xh)\n",
242 i));
243
244 return (isalpha(i));
245}
246
247
248/*****************************************************************************
249 * Name :
250 * Purpose :
251 * Parameters:
252 * Variables :
253 * Result :
254 * Remark : NTDLL.892
255 * Status :
256 *
257 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
258 *****************************************************************************/
259
260int CDECL OS2isdigit(int i)
261{
262 dprintf(("NTDLL: isdigit(%08xh)\n",
263 i));
264
265 return (isdigit(i));
266}
267
268
269/*****************************************************************************
270 * Name :
271 * Purpose :
272 * Parameters:
273 * Variables :
274 * Result :
275 * Remark : NTDLL.893
276 * Status :
277 *
278 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
279 *****************************************************************************/
280
281int CDECL OS2islower(int i)
282{
283 dprintf(("NTDLL: islower(%08xh)\n",
284 i));
285
286 return (islower(i));
287}
288
289
290/*****************************************************************************
291 * Name :
292 * Purpose :
293 * Parameters:
294 * Variables :
295 * Result :
296 * Remark : NTDLL.894
297 * Status :
298 *
299 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
300 *****************************************************************************/
301
302int CDECL OS2isprint(int i)
303{
304 dprintf(("NTDLL: isprint(%08xh)\n",
305 i));
306
307 return (isprint(i));
308}
309
310
311/*****************************************************************************
312 * Name :
313 * Purpose :
314 * Parameters:
315 * Variables :
316 * Result :
317 * Remark : NTDLL.895
318 * Status :
319 *
320 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
321 *****************************************************************************/
322
323int CDECL OS2isspace(int i)
324{
325 dprintf(("NTDLL: isspace(%08xh)\n",
326 i));
327
328 return (isspace(i));
329}
330
331
332/*****************************************************************************
333 * Name :
334 * Purpose :
335 * Parameters:
336 * Variables :
337 * Result :
338 * Remark : NTDLL.896
339 * Status :
340 *
341 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
342 *****************************************************************************/
343
344int CDECL OS2isupper(int i)
345{
346 dprintf(("NTDLL: isupper(%08xh)\n",
347 i));
348
349 return (isupper(i));
350}
351
352
353/*****************************************************************************
354 * Name :
355 * Purpose :
356 * Parameters:
357 * Variables :
358 * Result :
359 * Remark : NTDLL.911
360 * Status :
361 *
362 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
363 *****************************************************************************/
364
365LPSTR CDECL OS2sprintf(LPSTR lpstrBuffer,
366 LPSTR lpstrFormat,
367 ...)
368{
369 va_list argptr; /* -> variable argument list */
370
371 dprintf(("NTDLL: sprintf(%08xh,%s)\n",
372 lpstrBuffer,
373 lpstrFormat));
374
375 va_start(argptr,
376 lpstrFormat); /* get pointer to argument list */
377 vsprintf(lpstrBuffer,
378 lpstrFormat,
379 argptr);
380 va_end(argptr); /* done with variable arguments */
381
382 return (lpstrBuffer);
383}
384
385
386
387/*****************************************************************************
388 * Name :
389 * Purpose :
390 * Parameters:
391 * Variables :
392 * Result :
393 * Remark : NTDLL.914
394 * Status :
395 *
396 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
397 *****************************************************************************/
398
399LPSTR CDECL OS2strcat( LPSTR str1,
400 const LPSTR str2)
401{
402 dprintf(("NTDLL: strcat(%s,%s)\n",
403 str1,
404 str2));
405
406 return (strcat(str1, str2));
407}
408
409
410/*****************************************************************************
411 * Name :
412 * Purpose :
413 * Parameters:
414 * Variables :
415 * Result :
416 * Remark : NTDLL.915
417 * Status :
418 *
419 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
420 *****************************************************************************/
421
422LPSTR CDECL OS2strchr(const LPSTR str,
423 int i)
424{
425 dprintf(("NTDLL: strchr(%s,%08xh)\n",
426 str,
427 i));
428
429 return (strchr(str, i));
430}
431
432
433/*****************************************************************************
434 * Name :
435 * Purpose :
436 * Parameters:
437 * Variables :
438 * Result :
439 * Remark : NTDLL.916
440 * Status :
441 *
442 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
443 *****************************************************************************/
444
445int CDECL OS2strcmp(const LPSTR str1,
446 const LPSTR str2)
447{
448 dprintf(("NTDLL: strcmp(%s,%s)\n",
449 str1,
450 str2));
451
452 return (strcmp(str1, str2));
453}
454
455
456/*****************************************************************************
457 * Name :
458 * Purpose :
459 * Parameters:
460 * Variables :
461 * Result :
462 * Remark : NTDLL.917
463 * Status :
464 *
465 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
466 *****************************************************************************/
467
468LPSTR CDECL OS2strcpy( LPSTR str1,
469 const LPSTR str2)
470{
471 dprintf(("NTDLL: strcpy(%s,%s)\n",
472 str1,
473 str2));
474
475 return (strcpy(str1, str2));
476}
477
478
479/*****************************************************************************
480 * Name :
481 * Purpose :
482 * Parameters:
483 * Variables :
484 * Result :
485 * Remark : NTDLL.918
486 * Status :
487 *
488 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
489 *****************************************************************************/
490
491size_t CDECL OS2strcspn(const LPSTR str1,
492 LPSTR str2)
493{
494 dprintf(("NTDLL: strcspn(%s,%s)\n",
495 str1,
496 str2));
497
498 return (strcspn(str1, str2));
499}
500
501
502/*****************************************************************************
503 * Name :
504 * Purpose :
505 * Parameters:
506 * Variables :
507 * Result :
508 * Remark : NTDLL.919
509 * Status :
510 *
511 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
512 *****************************************************************************/
513
514size_t CDECL OS2strlen(const LPSTR str)
515{
516 dprintf(("NTDLL: strlen(%s)\n",
517 str));
518
519 return (strlen(str));
520}
521
522
523/*****************************************************************************
524 * Name :
525 * Purpose :
526 * Parameters:
527 * Variables :
528 * Result :
529 * Remark : NTDLL.920
530 * Status :
531 *
532 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
533 *****************************************************************************/
534
535LPSTR CDECL OS2strncat( LPSTR str1,
536 const LPSTR str2,
537 size_t i)
538{
539 dprintf(("NTDLL: strncat(%s,%s,%08xh)\n",
540 str1,
541 str2,
542 i));
543
544 return (strncat(str1, str2, i));
545}
546
547
548/*****************************************************************************
549 * Name :
550 * Purpose :
551 * Parameters:
552 * Variables :
553 * Result :
554 * Remark : NTDLL.921
555 * Status :
556 *
557 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
558 *****************************************************************************/
559
560int CDECL OS2strncmp(const LPSTR str1,
561 const LPSTR str2,
562 size_t i)
563{
564 dprintf(("NTDLL: strncmp(%s,%s,%08xh)\n",
565 str1,
566 str2,
567 i));
568
569 return (strncmp(str1, str2, i));
570}
571
572
573/*****************************************************************************
574 * Name :
575 * Purpose :
576 * Parameters:
577 * Variables :
578 * Result :
579 * Remark : NTDLL.922
580 * Status :
581 *
582 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
583 *****************************************************************************/
584
585LPSTR CDECL OS2strncpy(const LPSTR str1,
586 const LPSTR str2,
587 size_t i)
588{
589 dprintf(("NTDLL: strncpy(%s,%s,%08xh)\n",
590 str1,
591 str2,
592 i));
593
594 return (strncpy(str1, str2, i));
595}
596
597
598/*****************************************************************************
599 * Name :
600 * Purpose :
601 * Parameters:
602 * Variables :
603 * Result :
604 * Remark : NTDLL.923
605 * Status :
606 *
607 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
608 *****************************************************************************/
609
610LPSTR CDECL OS2strpbrk(const LPSTR str1,
611 const LPSTR str2)
612{
613 dprintf(("NTDLL: strpbrk(%s,%s)\n",
614 str1,
615 str2));
616
617 return (strpbrk(str1, str2));
618}
619
620
621/*****************************************************************************
622 * Name :
623 * Purpose :
624 * Parameters:
625 * Variables :
626 * Result :
627 * Remark : NTDLL.924
628 * Status :
629 *
630 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
631 *****************************************************************************/
632
633LPSTR CDECL OS2strrchr(const LPSTR str,
634 size_t i)
635{
636 dprintf(("NTDLL: strrchr(%s,%08xh)\n",
637 str,
638 i));
639
640 return (strrchr(str, i));
641}
642
643
644/*****************************************************************************
645 * Name :
646 * Purpose :
647 * Parameters:
648 * Variables :
649 * Result :
650 * Remark : NTDLL.925
651 * Status :
652 *
653 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
654 *****************************************************************************/
655
656size_t CDECL OS2strspn(const LPSTR str1,
657 const LPSTR str2)
658{
659 dprintf(("NTDLL: strspn(%s,%s)\n",
660 str1,
661 str2));
662
663 return (strspn(str1, str2));
664}
665
666
667/*****************************************************************************
668 * Name :
669 * Purpose :
670 * Parameters:
671 * Variables :
672 * Result :
673 * Remark : NTDLL.926
674 * Status :
675 *
676 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
677 *****************************************************************************/
678
679LPSTR CDECL OS2strstr(const LPSTR str1,
680 const LPSTR str2)
681{
682 dprintf(("NTDLL: strstr(%s,%s)\n",
683 str1,
684 str2));
685
686 return (strstr(str1, str2));
687}
688
689
690
691
692
693
694
695
696
697/*****************************************************************************
698 * Name :
699 * Purpose :
700 * Parameters:
701 * Variables :
702 * Result :
703 * Remark : NTDLL.934
704 * Status :
705 *
706 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
707 *****************************************************************************/
708
709wchar_t* CDECL OS2wcscat( wchar_t* str1,
710 const wchar_t* str2)
711{
712 dprintf(("NTDLL: wcscat(%08xh,%08xh)\n",
713 str1,
714 str2));
715
716 return (wcscat(str1, str2));
717}
718
719
720/*****************************************************************************
721 * Name :
722 * Purpose :
723 * Parameters:
724 * Variables :
725 * Result :
726 * Remark : NTDLL.935
727 * Status :
728 *
729 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
730 *****************************************************************************/
731
732wchar_t* CDECL OS2wcschr(const wchar_t* str,
733 int i)
734{
735 dprintf(("NTDLL: wcschr(%08xh,%08xh)\n",
736 str,
737 i));
738
739 return (wcschr(str, i));
740}
741
742
743/*****************************************************************************
744 * Name :
745 * Purpose :
746 * Parameters:
747 * Variables :
748 * Result :
749 * Remark : NTDLL.936
750 * Status :
751 *
752 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
753 *****************************************************************************/
754
755int CDECL OS2wcscmp(const wchar_t* str1,
756 const wchar_t* str2)
757{
758 dprintf(("NTDLL: wcscmp(%08xh,%08xh)\n",
759 str1,
760 str2));
761
762 return (wcscmp(str1, str2));
763}
764
765
766/*****************************************************************************
767 * Name :
768 * Purpose :
769 * Parameters:
770 * Variables :
771 * Result :
772 * Remark : NTDLL.937
773 * Status :
774 *
775 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
776 *****************************************************************************/
777
778wchar_t* CDECL OS2wcscpy( wchar_t* str1,
779 const wchar_t* str2)
780{
781 dprintf(("NTDLL: wcscpy(%08xh,%08xh)\n",
782 str1,
783 str2));
784
785 return (wcscpy(str1, str2));
786}
787
788
789/*****************************************************************************
790 * Name :
791 * Purpose :
792 * Parameters:
793 * Variables :
794 * Result :
795 * Remark : NTDLL.938
796 * Status :
797 *
798 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
799 *****************************************************************************/
800
801size_t CDECL OS2wcscspn(const wchar_t* str1,
802 wchar_t* str2)
803{
804 dprintf(("NTDLL: wcscspn(%08xh,%08xh)\n",
805 str1,
806 str2));
807
808 return (wcscspn(str1, str2));
809}
810
811
812/*****************************************************************************
813 * Name :
814 * Purpose :
815 * Parameters:
816 * Variables :
817 * Result :
818 * Remark : NTDLL.939
819 * Status :
820 *
821 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
822 *****************************************************************************/
823
824size_t CDECL OS2wcslen(const wchar_t* str)
825{
826 dprintf(("NTDLL: wcslen(%08xh)\n",
827 str));
828
829 return (wcslen(str));
830}
831
832
833/*****************************************************************************
834 * Name :
835 * Purpose :
836 * Parameters:
837 * Variables :
838 * Result :
839 * Remark : NTDLL.940
840 * Status :
841 *
842 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
843 *****************************************************************************/
844
845wchar_t* CDECL OS2wcsncat( wchar_t* str1,
846 const wchar_t* str2,
847 size_t i)
848{
849 dprintf(("NTDLL: wcsncat(%08xh,%08xh,%08xh)\n",
850 str1,
851 str2,
852 i));
853
854 return (wcsncat(str1, str2, i));
855}
856
857
858/*****************************************************************************
859 * Name :
860 * Purpose :
861 * Parameters:
862 * Variables :
863 * Result :
864 * Remark : NTDLL.941
865 * Status :
866 *
867 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
868 *****************************************************************************/
869
870int CDECL OS2wcsncmp(const wchar_t* str1,
871 const wchar_t* str2,
872 size_t i)
873{
874 dprintf(("NTDLL: wcsncmp(%08xh,%08xh,%08xh)\n",
875 str1,
876 str2,
877 i));
878
879 return (wcsncmp(str1, str2, i));
880}
881
882
883/*****************************************************************************
884 * Name :
885 * Purpose :
886 * Parameters:
887 * Variables :
888 * Result :
889 * Remark : NTDLL.942
890 * Status :
891 *
892 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
893 *****************************************************************************/
894
895wchar_t* CDECL OS2wcsncpy( wchar_t* str1,
896 const wchar_t* str2,
897 size_t i)
898{
899 dprintf(("NTDLL: wcsncpy(%s,%s,%08xh)\n",
900 str1,
901 str2,
902 i));
903
904 return (wcsncpy(str1, str2, i));
905}
906
907
908/*****************************************************************************
909 * Name :
910 * Purpose :
911 * Parameters:
912 * Variables :
913 * Result :
914 * Remark : NTDLL.943
915 * Status :
916 *
917 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
918 *****************************************************************************/
919
920wchar_t* CDECL OS2wcspbrk(const wchar_t* str1,
921 const wchar_t* str2)
922{
923 dprintf(("NTDLL: wcspbrk(%08xh,%08xh)\n",
924 str1,
925 str2));
926
927 return (wcspbrk(str1, str2));
928}
929
930
931/*****************************************************************************
932 * Name :
933 * Purpose :
934 * Parameters:
935 * Variables :
936 * Result :
937 * Remark : NTDLL.944
938 * Status :
939 *
940 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
941 *****************************************************************************/
942
943wchar_t* CDECL OS2wcsrchr(const wchar_t* str,
944 size_t i)
945{
946 dprintf(("NTDLL: wcsrchr(%08xh,%08xh)\n",
947 str,
948 i));
949
950 return (wcsrchr(str, i));
951}
952
953
954/*****************************************************************************
955 * Name :
956 * Purpose :
957 * Parameters:
958 * Variables :
959 * Result :
960 * Remark : NTDLL.945
961 * Status :
962 *
963 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
964 *****************************************************************************/
965
966size_t CDECL OS2wcsspn(const wchar_t* str1,
967 const wchar_t* str2)
968{
969 dprintf(("NTDLL: wcsspn(%08xh,%08xh)\n",
970 str1,
971 str2));
972
973 return (wcsspn(str1, str2));
974}
975
976
977/*****************************************************************************
978 * Name :
979 * Purpose :
980 * Parameters:
981 * Variables :
982 * Result :
983 * Remark : NTDLL.946
984 * Status :
985 *
986 * Author : Patrick Haller [Thu, 1999/06/22 20:44]
987 *****************************************************************************/
988
989wchar_t* CDECL OS2wcsstr(const wchar_t* str1,
990 const wchar_t* str2)
991{
992 dprintf(("NTDLL: wcsstr(%s,%s)\n",
993 str1,
994 str2));
995
996 return (wcsstr(str1, str2));
997}
998
Note: See TracBrowser for help on using the repository browser.