-
Notifications
You must be signed in to change notification settings - Fork 0
/
sapucrfc.h
4365 lines (3803 loc) · 180 KB
/
sapucrfc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* @(#) $Id: //bas/753_REL/src/include/sapucrfc.h#4 $ SAP*/
/* CCQ_CCU_FILE_OFF */ /* CCQ_COV_FILE_OFF */ /* CCQ_IPV6_SUPPORT_FILE_OK */ /* CCQ_USE_TIME_T_FILE_OK */
#ifndef SAPUCRFC_H
#define SAPUCRFC_H "$Id: //bas/753_REL/src/include/sapucrfc.h#4 $"
/*****************************************************************************/
/* */
/* sapucrfc.h */
/* */
/* This file consists of two parts: */
/* */
/* Part 1 : Copy from sapucx.h, which is a subset of saptype*.h. */
/* Part 2 : Copy from sapuc.h and unnecessary lines are deleted. */
/* */
/* This file is organised to be used the RFC SDK. Therefore it is */
/* self-contained and it requires no other saptype*.h or sapuc*.h. */
/* */
/* There are some ground rules: */
/* */
/* 1. It must not be included in any SAP programs except sapnwrfc.h. */
/* 2. It must not be included if sapuc.h is included. Compilation errors */
/* will happen if both are included. */
/* 3. It can be edited but any addition/deletion of functions must be */
/* synchronised with flat/ux_nt_portlib.def. */
/* */
/*****************************************************************************/
/*
* This file is dedicated to the RFC SDK and it can be included in sapnwrfc.h only.
*/
#ifndef SAPNWRFC_H
#error "wrong usage of sapucrfc.h"
#endif
/*****************************************************************************/
/* */
/* */
/* Part 1 : Copied from sapucx.h */
/* */
/* */
/*****************************************************************************/
#ifndef SAPUCX_H
#define SAPUCX_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* #defines taken from saptype.h
*/
#if defined(__cplusplus) && !defined(SAPccQC)
#ifndef externC
#define externC extern "C"
#endif
#ifndef BEGIN_externC
#define BEGIN_externC extern "C" {
#define END_externC }
#endif
#else
#ifndef externC
#define externC extern
#endif
#ifndef BEGIN_externC
#define BEGIN_externC
#define END_externC
#endif
#endif
#if defined(CPP_USE_NEW_C_HEADERS)
#define NS_STD_C_HEADER std ::
#define BEGIN_NS_STD_C_HEADER namespace std {
#define END_NS_STD_C_HEADER }
#else
#define NS_STD_C_HEADER
#define BEGIN_NS_STD_C_HEADER
#define END_NS_STD_C_HEADER
#endif
#ifndef CCQ_CAST
#define CCQ_CAST(p) /* saptypeb.h */
#endif
/*
* switches set in saptype.h (by SAP compile):
*
* Selection is by switch(es) set by the native compilers to indicate
* the compilation environment.
*/
#if defined(__OS400__)
#ifndef SAPonOS400
#define SAPonOS400
#endif
#define SAPwithINT_BIGENDIAN 1
#define SAPwithFLOAT_IEEE 1
#if !defined(SAPwithCHAR_ASCII) && !defined(SAPwithCHAR_EBCDIC)
#define SAPwithCHAR_EBCDIC
#endif
#elif defined(_WIN32)
#ifndef SAPonNT
#define SAPonNT
#endif
#define SAPwithINT_LITTLEENDIAN 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#elif defined(__OS2__)
#ifndef SAPonOS2_2x
#define SAPonOS2_2x
#endif
#define SAPwithINT_LITTLEENDIAN 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#elif defined(_WINDOWS)
#ifndef _WIN32
#ifndef SAPonWINDOWS
#define SAPonWINDOWS
#endif
#endif /* _WIN16 */
#elif defined(__linux__) || defined(__linux)
#if !( defined(__i386__) || defined(__ia64__) || defined(__s390x__) || \
defined(__x86_64__) || defined(__PPC64__) || defined(__BYTE_ORDER__) )
#error "sapucx.h STANDALONE on this Linux platform not yet implemented"
#endif
#if defined(__s390x__) || defined(__PPC64__) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN) )
#define SAPwithINT_BIGENDIAN 1
#else
#define SAPwithINT_LITTLEENDIAN 1
#endif
#ifndef SAPonLINUX
#define SAPonLINUX
#endif
#ifndef SAPonLIN
#define SAPonLIN 1
#endif
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#define SAPonSYS5 1
#define SAPonSYS5_4 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#if defined(__GNUC__) || defined(__xlC__)
typedef double SAP_DOUBLE __attribute__ ((aligned (8)));
#else
typedef double SAP_DOUBLE;
#endif
#define SAP_DOUBLE_MIN DBL_MIN
#define SAP_DOUBLE_MAX DBL_MAX
#define SAP_DOUBLE_DEFINED
#if ( defined(__ia64__) || defined(__s390x__) || defined(__x86_64__) || \
defined(__PPC64__) || defined(__LP64__) )
#define SAPwith64_BIT
#endif
#elif defined(_AIX)
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#define SAPonSYS5 1
#define SAPonSYS5_2 1
#define SAPonAIX
#define SAPwithINT_BIGENDIAN 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#if defined(__64BIT__)
#define SAPwith64_BIT
#endif
#elif defined(__alpha) && defined(__osf__)
#ifndef SAPonOSF1
#define SAPonOSF1 1
#endif
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#define SAPonSYS5 1
#define SAPonSYS5_2 1
#define SAPwithINT_LITTLEENDIAN 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#define SAPwith64_BIT /* always. */
#elif defined(__hppa) || (defined(__hpux) && defined(__ia64))
#ifndef SAPonUNIX
#define SAPonUNIX
#endif
#ifndef SAPonHP_UX
#define SAPonHP_UX
#endif
#define SAPwithINT_BIGENDIAN 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#if defined(__LP64__)
#define SAPwith64_BIT
#endif
#elif defined(__sun)
/* for above switches cf cc(1): -D predefinitions. */
#ifndef SAPonSUN
#define SAPonSUN
#endif
#define SAPonSYS5 1
#define SAPonSYS5_4 1
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#define SAPwithCHAR_ASCII 1
#define SAPwithFLOAT_IEEE 1
#if defined(_BIG_ENDIAN)
#define SAPwithINT_BIGENDIAN 1
#else
#define SAPwithINT_LITTLEENDIAN 1
#endif
#if defined (_LP64)
#define SAPwith64_BIT
#endif
#elif defined(__MVS__)
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#define SAPonSYS5 1
#define SAPonMVSOE 1
#define SAPonOS390 1
#define SAPwithINT_BIGENDIAN 1
#define SAPwithFLOAT_IEEE 1
#if __STRING_CODE_SET__==ISO8859-1
#define SAPwithCHAR_ASCII 1
#else
#define SAPwithCHAR_EBCDIC 1
#endif
#if defined(_LP64)
#define SAPwith64_BIT
#endif
#elif defined(sinix)
/* for above switch cf cc(1) */
#ifndef SAPonRM600
#define SAPonRM600
#endif
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#define SAPonSYS5 1
#define SAPonSYS5_2 1
#define SAPonSYS5_4 1
#define SAPonSINIX 1
#define SAPonSINIX5_42 1
#define SAPwithINT_BIGENDIAN 1
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#if defined(__LP64__)
#define SAPwith64_BIT
#endif
#elif defined(__APPLE__)
#ifndef SAPonUNIX
#define SAPonUNIX 1
#endif
#ifndef SAPonDARW
#define SAPonDARW 1
#endif
#define SAPwithFLOAT_IEEE 1
#define SAPwithCHAR_ASCII 1
#if defined __x86_64__
#define SAPwithINT_LITTLEENDIAN 1
#define SAPwith64_BIT
#elif defined __i386__
#define SAPwithINT_LITTLEENDIAN 1
#define SAPonBSD 1
#else
#define SAPwithINT_BIGENDIAN 1
#define SAPonBSD 1
#endif
#else
#error "sapucx.h STANDALONE not yet implemented"
#endif
/* Some function pointers declared in sapuc.h (example: toupperU())
* need __declspec(dllimport) on Windows, because they will be
* imported from libsapucum.dll
*/
#if defined(SAPonNT)
#define __SAP_DLL_DECLSPEC __declspec(dllimport)
#else
#define __SAP_DLL_DECLSPEC
#endif
/*
* Non-SAP compile: Types
* (See saptypeb.h)
*/
#ifdef SAPonAIX
#ifdef SAPonRS6000withXLCLANG
#if defined(SAPccQ) && (__GNUC__ == 3)
/* current ccQ (based on gcc-3.3.3) does not yet know char16_t */
typedef unsigned short char16_t;
#else
#ifndef __cplusplus
#include <uchar.h>
#endif
#define SAP_UC_is_char16
#endif
#else
#if defined(_AIX51) && defined(SAPwith64_BIT)
#define SAPonAIX_wchar_is_4B
#elif defined(SAPccQ)
#define SAPonAIX_wchar_is_4B
#else
#define SAPonAIX_wchar_is_2B
#endif
#endif
#endif
#if defined(SAPonNT) || \
defined(SAPonOS400) || \
(defined(SAPonOS390) && !defined(_LP64)) || \
defined(SAPonAIX) && defined(SAPonAIX_wchar_is_2B)
#define WCHAR_is_2B
#else
#define WCHAR_is_4B
#endif
#if defined(SAPonLIN)
#if defined(SAPccQ) && (__GNUC__ == 3)
/* current ccQ (based on gcc-3.3.3) does not yet know char16_t */
typedef unsigned short char16_t;
#else
#include <uchar.h>
#endif
#define SAP_UC_is_char16
#endif
#if defined(SAPonDARW) && !defined(CPP_USE_STLPORT)
#ifndef __CHAR16_TYPE__
typedef unsigned short __CHAR16_TYPE__;
typedef unsigned long __CHAR32_TYPE__;
#endif
#ifndef __cplusplus
typedef __CHAR16_TYPE__ char16_t;
typedef __CHAR32_TYPE__ char32_t;
#elif __cplusplus == 1
typedef unsigned short char16_t;
#endif
#define SAP_UC_is_char16
#endif
#if defined(SAPonHPIA64)
#if (defined(__HP_aCC) && __HP_aCC >= 62800 && __cplusplus >= 201103L)
#define SAP_UC_is_char16
#endif
#endif
/* Starting with z/OS release 1.11 the compiler supports UTF-16 */
/* and UTF-32 strings and literals similar to Linux */
/* UTF-16 characters representing Unicode are of type char16_t */
#if defined(SAPonOS390) && defined(_LP64) && (__COMPILER_VER__ >= 0x410B0000)
/* for C++ the compile option KEYWORD(char16_t,char32_t) */
/* makes including of uchar.h surplus */
#ifndef __cplusplus
#include <uchar.h>
#endif
#define SAP_UC_is_char16
#endif
#ifndef SAPwithUNICODE
#define SAP_UC_is_1B
typedef char SAP_CHAR;
typedef char SAP_UC;
#else /* SAPwithUNICODE */
#if defined(WCHAR_is_2B)
#define SAP_UC_is_wchar
typedef wchar_t SAP_CHAR;
typedef wchar_t SAP_UC;
#elif defined(SAP_UC_is_char16)
typedef char16_t SAP_CHAR;
typedef char16_t SAP_UC;
#else
#define SAP_UC_is_UTF16_without_wchar
typedef unsigned short SAP_CHAR;
typedef unsigned short SAP_UC;
#endif
#endif /* SAPwithUNICODE or not */
/*
* RFCSDKwith(out)UTF16_LITERALS
* for RFC SDK applications: controls use of UTF-16
* literal enabled compilers.
*/
#if defined(RFCSDKwithUTF16_LITERALS)
#elif defined(RFCSDKwithoutUTF16_LITERALS)
#define SAPwithoutUTF16_LITERALS
#elif defined(WCHAR_is_2B) || \
defined(SAPonHP_UX) || \
defined(SAPonLIN) || \
(defined(SAPonDARW) && !defined(CPP_USE_STLPORT)) || \
defined(SAPonSUN) || defined(SAPonAIX) || \
(defined(SAPonOS390) && (__COMPILER_VER__ >= 0x410B0000))
/* we have literals for UTF-16 */
#else
#define SAPwithoutUTF16_LITERALS
#endif
/*
* General Headers:
*
* defines required by sapuc.h included next.
* Note:
* Some of these declarations may be unused in Unicode mode,
* others (e.g. memcpy) may be used to implement U functions
* (e.g. memcpyU) in Unicode mode.
*/
#ifdef __cplusplus
}
#endif
#include <stddef.h> /* saptypeb.h. size_t */
#include <stdio.h> /* saptypeb.h. FILE */
#include <ctype.h> /* is...() */
#include <string.h> /* str...() mem...() */
#ifdef __cplusplus
extern "C" {
#endif
/*
* SAP_RAW
* SAP_SRAW
* SAP_USHORT
*/
typedef unsigned char SAP_RAW;
typedef signed char SAP_SRAW;
typedef unsigned short SAP_USHORT;
/*
* Numeric Types:
*/
#ifdef __cplusplus
}
#endif
#include <limits.h> /* need _MAX values to define numeric types: */
#ifdef __cplusplus
extern "C" {
#endif
#if UINT_MAX == 0xFFFFFFFFu
typedef unsigned int SAP_UINT;
#elif ULONG_MAX == 0xFFFFFFFFu
typedef unsigned long SAP_UINT;
#else
#error "We need an unsigned int type with 4 bytes"
#endif
#if INT_MAX == 0x7FFFFFFF
typedef int SAP_INT;
#elif LONG_MAX == 0x7FFFFFFF
typedef long SAP_INT;
#else
#error "We need an int type with 4 bytes"
#endif
/*
* SAP_SHORT:
*/
#if SHRT_MAX == 0x7FFF
typedef short SAP_SHORT; /* Value range: SHRT_MIN .. SHRT_MAX */
#define SAP_SHORT_MIN SHRT_MIN
#define SAP_SHORT_MAX SHRT_MAX
#else
#error "We need a short type with 2 bytes"
#endif
#define SAP_SHORT_BYTES 2
#ifndef CCQ_FMT
#define CCQ_FMT(x)
#endif // !CCQ_FMT
#if defined SAPwith64_BIT && \
! defined SAPonNT && \
! defined SAPonOS400 && \
! defined SAPccQ
typedef long SAP_LLONG;
typedef unsigned long SAP_ULLONG;
#define SAP_LLONG_IS_LONG
#define SAP_Flld CCQ_FMT("Flld") cU("ld")
#define SAP_Fllu CCQ_FMT("Fllu") cU("lu")
#define SAP_Fllx CCQ_FMT("Fllx") cU("lx")
#elif defined SAPonHPPA || \
defined SAPonRS6000 || \
defined SAPonSUN || \
defined SAPonOS390 || \
defined SAPonOS400 || \
defined SAPonRM600 || \
defined SAPonApple || \
defined SAPonDARW || \
defined SAPonLIN || \
defined SAPonPTX || \
defined SAPccQ
typedef long long SAP_LLONG;
typedef unsigned long long SAP_ULLONG;
#define SAP_LLONG_IS_LONG_LONG
#define SAP_Flld CCQ_FMT("Flld") cU("lld")
#define SAP_Fllu CCQ_FMT("Fllu") cU("llu")
#define SAP_Fllx CCQ_FMT("Fllx") cU("llx")
#elif defined SAPonOS2_2x
typedef long SAP_LLONG;
#define SAP_LLONG_IS_LONG
#define SAP_Flld CCQ_FMT("Flld") cU("ld")
#define SAP_Fllu CCQ_FMT("Fllu") cU("lu")
#define SAP_Fllx CCQ_FMT("Fllx") cU("lx")
#elif defined SAPonNT
typedef __int64 SAP_LLONG;
typedef unsigned __int64 SAP_ULLONG;
#define SAP_LLONG_IS_LONG_LONG // __int64 is "long long" on 32 and 64 bit
#define SAP_Flld CCQ_FMT("Flld") cU("I64d")
#define SAP_Fllu CCQ_FMT("Fllu") cU("I64u")
#define SAP_Fllx CCQ_FMT("Fllx") cU("I64x")
#endif
#define SAP_LLONG_BYTES 8
#define SAP_ULLONG_BYTES 8
/**********************************************************************/
/* SAP_BOOL: boolean value (TRUE or FALSE) */
/**********************************************************************/
#ifdef SAP_BOOL_ENUM
typedef enum { FALSE = 0, TRUE = 1 } SAP_BOOL;
#else
typedef unsigned char SAP_BOOL;
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#endif
/* ts: on AS/400, SAP_BOOL must be char, only char is guaranteed to be the
* same size on ILE and PASE */
#if ( defined(SAPonOS400) || defined(SAPwithPASE400) ) && defined(SAP_BOOL_ENUM)
#error SAP_BOOL must be char on iSeries, do not define SAP_BOOL_ENUM
#endif
/*
* SAP_DOUBLE:
*/
#ifndef SAP_DOUBLE_DEFINED
#define SAP_DOUBLE_DEFINED
typedef double SAP_DOUBLE; /* Value range is at least */
/* +- 10**37, 15 digits precision */
#define SAP_DOUBLE_MIN DBL_MIN
#define SAP_DOUBLE_MAX DBL_MAX
#endif
/**********************************************************************/
/* LINE_USING_PROC */
/* The type for generalized dump routines: */
/* a pointer to a procedure, which will be called for (and with) */
/* every line, that shall be output. The parameters of each such */
/* procedure must be: */
/* 1st: address of text data. */
/* 2nd: length of that data. Counted in number of basic characters. */
/**********************************************************************/
typedef void (* LINE_USING_PROC) (SAP_CHAR * buffer,
int number_of_chars );
/**********************************************************************/
/* C standard types */
/* classified if they count character length or byte length */
/**********************************************************************/
/*SAPUNICODEOK_CHARLEN*/ typedef int intU;
/*SAPUNICODEOK_RAWLEN*/ typedef int intR;
/*SAPUNICODEOK_CHARLEN*/ typedef unsigned int unsigned_intU;
/*SAPUNICODEOK_RAWLEN*/ typedef unsigned int unsigned_intR;
/*SAPUNICODEOK_CHARLEN*/ typedef short shortU;
/*SAPUNICODEOK_RAWLEN*/ typedef short shortR;
/*SAPUNICODEOK_CHARLEN*/ typedef unsigned short unsigned_shortU;
/*SAPUNICODEOK_RAWLEN*/ typedef unsigned short unsigned_shortR;
/*SAPUNICODEOK_CHARLEN*/ typedef long longU;
/*SAPUNICODEOK_RAWLEN*/ typedef long longR;
/*SAPUNICODEOK_CHARLEN*/ typedef unsigned long unsigned_longU;
/*SAPUNICODEOK_RAWLEN*/ typedef unsigned long unsigned_longR;
/*SAPUNICODEOK_CHARLEN*/ typedef size_t size_tU;
/*SAPUNICODEOK_RAWLEN*/ typedef size_t size_tR;
/*SAPUNICODEOK_CHARLEN*/ typedef SAP_USHORT SAP_USHORT_U;
/*SAPUNICODEOK_RAWLEN*/ typedef SAP_USHORT SAP_USHORT_R;
/*SAPUNICODEOK_CHARLEN*/ typedef SAP_SHORT SAP_SHORT_U;
/*SAPUNICODEOK_RAWLEN*/ typedef SAP_SHORT SAP_SHORT_R;
/*SAPUNICODEOK_CHARLEN*/ typedef SAP_UINT SAP_UINT_U;
/*SAPUNICODEOK_RAWLEN*/ typedef SAP_UINT SAP_UINT_R;
/*SAPUNICODEOK_CHARLEN*/ typedef SAP_INT SAP_INT_U;
/*SAPUNICODEOK_RAWLEN*/ typedef SAP_INT SAP_INT_R;
/*SAPUNICODEOK_CHARLEN*/ typedef SAP_ULLONG SAP_ULLONG_U;
/*SAPUNICODEOK_RAWLEN*/ typedef SAP_ULLONG SAP_ULLONG_R;
/*SAPUNICODEOK_CHARLEN*/ typedef SAP_LLONG SAP_LLONG_U;
/*SAPUNICODEOK_RAWLEN*/ typedef SAP_LLONG SAP_LLONG_R;
/*
* SAP_DATE (saptypeb.h)
* SAP_TIME
* SAP_BCD
*/
/* date: YYYYMMDD */
#define SAP_DATE_LN 8
typedef SAP_CHAR SAP_DATE [SAP_DATE_LN];
/* time: HHMMSS */
#define SAP_TIME_LN 6
typedef SAP_CHAR SAP_TIME [SAP_TIME_LN];
/* BCD numbers */
typedef SAP_RAW SAP_BCD;
/*
* SAP_UUID (saptypec.h)
*/
#ifndef SAP_UUID_TYPEDEFD
#define SAP_UUID_TYPEDEFD
typedef struct SAP_UUID
{
SAP_UINT a;
SAP_USHORT b;
SAP_USHORT c;
SAP_RAW d[8];
}
SAP_UUID;
#endif
#ifndef __midl
#if defined (SAPonHPPA)
/* saptype.h */
/**********************************************************************/
/* */
/* IA64 generally needs 16 byte alignment for the spilled floating */
/* point registers in structures like jmp_buf and ucontext_t. */
/* */
/* Intel's IA64 ABI specifies 'long double' to be 16 byte for LP64. */
/* */
/* Conventions: */
/* see saptypeb.h */
/* */
/**********************************************************************/
#ifdef SAPonHPIA64
#define PLATFORM_MAX_T platform_max_t
typedef long double platform_max_t;
#endif
#elif defined (SAPonLIN)
/**********************************************************************/
/* */
/* IA64 generally needs 16 byte alignment for the spilled floating */
/* point registers in structures like jmp_buf and ucontext_t. */
/* */
/* Intel's IA64 ABI specifies 'long double' to be 16 byte for LP64. */
/* */
/* Conventions: */
/* see saptypeb.h */
/* */
/**********************************************************************/
#if defined(__ia64__)
#define PLATFORM_MAX_T platform_max_t
typedef long double platform_max_t;
#else
#define PLATFORM_MAX_T SAP_DOUBLE
#endif
#elif defined (SAPonNT)
/**********************************************************************/
/* */
/* IA64 generally needs 16 byte alignment for the spilled floating */
/* point registers in structures like jmp_buf and ucontext_t. */
/* */
/* There's no 16 byte fundamental type on NT so we align an array. */
/* */
/* Conventions: */
/* see saptypeb.h */
/* */
/**********************************************************************/
#if defined(_M_IA64) || defined(_M_AMD64)
#define PLATFORM_MAX_T platform_max_t
/* typedef __declspec(align(16)) char platform_max_t[16];*/
typedef __declspec(align(16)) SAP_SRAW platform_max_t[16];
#endif
#elif defined (SAPonRS6000)
/********************************************************************/
/* define 16 byte alignment on rs6000 */
/********************************************************************/
#define PLATFORM_MAX_T platform_max_t
typedef struct{ char d[16]; } __attribute__((aligned(16))) platform_max_t;
#endif
/* SAP_MAX_ALIGN_T from saptypeb.h */
/**********************************************************************/
/* */
/* SAP_MAX_ALIGN_T: */
/* structure with maximum possible size, used for alignment */
/* */
/* SAP_MAX_ALIGN: */
/* maximum alignment required for any integral data type */
/* */
/* If a certain platform contains a type that exceeds the size of */
/* the C-defined integral data types, define PLATFORM_MAX_T in the */
/* platform dependent part of saptype.h */
/* */
/* Example: (in saptype.h) */
/* */
/* #ifdef SAPon<platform> */
/* union */
/* { */
/* longlong my_largest_type; */
/* } PLATFORM_MAX_T */
/* #endif */
/* */
/**********************************************************************/
#ifndef SAP_MAX_ALIGN_T_DEFINED
#define SAP_MAX_ALIGN_T_DEFINED
#ifndef PLATFORM_MAX_T
typedef void * PLATFORM_MAX_T;
#endif
typedef union
{
long align_1;
double align_2;
void * align_3;
PLATFORM_MAX_T align_4;
} SAP_MAX_ALIGN_T;
#endif /*SAP_MAX_ALIGN_T_DEFINED*/
/**********************************************************************/
/* IEEE 754r decimal floating point types */
/* DecFloat16 and DecFloat34 */
/* See sapdecf.h for more details */
/**********************************************************************/
#ifndef SAP_DecFloat_DEFINED
#define SAP_DecFloat_DEFINED
/* ABAP kernel representation of the IEEE 754r decimal floating point
type with 64 bits. */
typedef union
{
SAP_RAW bytes[8];
SAP_DOUBLE align;
} DecFloat16;
/* ABAP kernel representation of the IEEE 754r decimal floating point
type with 128 bits. */
typedef union
{
SAP_RAW bytes[16];
SAP_MAX_ALIGN_T align;
} DecFloat34;
/* Length definition for the binary sortable decimal floating point types */
enum DecFloatRawLen{
/* Length of binary sortable IEEE 754r 64-bit variant in bytes. */
DecFloat16RawLen = 8,
/* Length of binary sortable IEEE 754r 128-bit variant in bytes. */
DecFloat34RawLen = 16
};
/* Binary sortable variant of the IEEE 754r with 64-bits. */
typedef SAP_RAW DecFloat16Raw [DecFloat16RawLen];
/* Binary sortable variant of the IEEE 754r with 128-bits. */
typedef SAP_RAW DecFloat34Raw [DecFloat34RawLen];
/* Length definition for ABAP kernel representation of the IEEE 754r
decimal floating point types */
enum DecFloatLen {
/* Length of the IEEE 754r 64-bit type in bytes. */
DecFloat16Len = 8,
/* Length of the IEEE 754r 128-bit type in bytes. */
DecFloat34Len = 16
};
#define DECF_16_MAX_STRLEN 25 /* maximum string length, +1 */
#define DECF_34_MAX_STRLEN 43 /* maximum string length, +1 */
/* String buffer type for DecFloat34 numeric strings. */
typedef SAP_UC DecFloat34Buff [DECF_34_MAX_STRLEN];
/* String buffer type for DecFloat16 numeric strings. */
typedef SAP_UC DecFloat16Buff [DECF_16_MAX_STRLEN];
#endif /*SAP_DecFloat_DEFINED*/
/**********************************************************************/
/* __w64 is a new Microsoft compiler (>= 13.00) specific keyword. It */
/* is necessary to detect 64 Bit porting issues using the /wp64 */
/* compiler switch correctly during 32 Bit compilation. */
/**********************************************************************/
#if defined(SAPonNT) && (_MSC_VER < 1300)
#define __SAPW64
#else
#define __SAPW64 __w64
#endif
/**********************************************************************/
/* SAP_UINT_PTR: unsigned integer type with pointer precision */
/**********************************************************************/
#if defined (SAPonNT) && defined (WIN64)
typedef unsigned __int64 SAP_UINT_PTR;
#elif defined SAPonOS400
typedef unsigned long long SAP_UINT_PTR;
#elif defined SAPonNT
typedef unsigned long __SAPW64 SAP_UINT_PTR;
#else
typedef unsigned long SAP_UINT_PTR;
#endif
#endif /* __midl */
#ifdef __cplusplus
}
#endif
#endif /* SAPUCX_H */
/*****************************************************************************/
/* */
/* */
/* Part 2 : Copied from sapuc.h and reduced */
/* */
/* */
/*****************************************************************************/
#ifndef SAPUC_H
#define SAPUC_H
#if defined(SAPonAIX) || \
defined(SAPonHP_UX) || \
defined(SAPonLIN) || \
defined(SAPonSUN) || \
defined(SAPonOSF1) || \
defined(SAPonOS390) || \
(defined(SAPonOS400) && defined(SAPwithUNICODE) ) || \
defined(SAPonNT) || \
defined(SAPonDARW)
/* platforms where ICU is available */
#if defined(SAPwithUNICODE)
#define SAPwithICU_CTYPE
#endif
#define SAPwithICU_COLL
#define SAPwithICU_BIDI
#define SAPwithICU_SHAPING
#define SAPwithICU_BREAK
#define SAPwithICU_NORM
#define SAPwithICU_TRANS
#define SAPwithICU_IDNA
#define SAPwithICU_CAL
#endif
#if defined(SAPwithICU_CTYPE) || \
defined(SAPwithICU_COLL) || \
defined(SAPwithICU_BIDI) || \
defined(SAPwithICU_SHAPING) || \
defined(SAPwithICU_BREAK) || \
defined(SAPwithICU_NORM) || \
defined(SAPwithICU_TRANS) || \
defined(SAPwithICU_IDNA) || \
defined(SAPwithICU_CAL)
#define SAPwithICU
#endif
#if defined( SAPwithICU_CTYPE ) || \
defined( SAPwithICU_I18N )
#define SAPwithNLSUI_INITIALIZE
#endif
#if defined(SAPwithUNICODE)
#define SAPwithU16LIB
#define SAPwithU16LIBLinked
#endif
#if !defined(SAPwithUNICODE)
#define SAPwithOS_LOCALE
#endif
/*-----------------------------------------------------------------------------
* sapuc.h - derive further compilation switches for convenience
*
* Length of Unicode in bytes: Little endian or big endian byte order:
*
* SAP_UC_is_2B, SAP_UC_is_4B SAP_UC_is_2B_L, SAP_UC_is_4B_B etc.
*
* What kind of Unicode is used:
*
* SAP_UC_is_UCS2L UCS-2, little endian format
* SAP_UC_is_UCS4B UCS-4, big endian format
* etc.
*
* Remark: Using two bytes is regarded as identical to using either
* UCS-2 or UTF-16. If it should become necessary to distinguish between
* UCS-4 and 4-byte UCS2, the following case distinctions must be extended.
*
*----------------------------------------------------------------------------*/
#if defined(SAPwithUNICODE)
#define SAP_UC_is_2B
#define SAP_UC_is_UTF16
#if defined(SAPwithINT_LITTLEENDIAN)
#define SAP_UC_is_2B_L
#define SAP_UC_is_UTF16_L
#else
#define SAP_UC_is_2B_B
#define SAP_UC_is_UTF16_B
#endif
#endif
/*-----------------------------------------------------------------------------
* sapuc.h - further includes
*
* Via saptype.h most neccessary headers are known, including
* <limits.h>, <stddef.h>, <stdio.h>, <stdlib.h>, and <string.h>
*----------------------------------------------------------------------------*/
#include <stdarg.h>
#if defined(CPP_USE_NEW_C_HEADERS)
#include <cstdarg>
#endif
#ifdef SAPonNT
#if defined(CPP_USE_NEW_C_HEADERS)
#include <cwchar>
#else
#include <wchar.h>
#endif
#include <sys/utime.h>
#elif defined(SAPonOS400) /* wchar.h does not include time.h. */
#ifndef _POSIX_LOCALE
#define _POSIX_LOCALE
#endif
#if defined(CPP_USE_NEW_C_HEADERS)
#include <cwchar>
#include <cwctype>
#include <clocale>
#else
#include <wchar.h>
#include <wctype.h>
#include <locale.h>
#endif
#include <dirent.h>
#include <ifs.h>
#include <time.h>
#include <spawn.h>
#elif defined(SAPonAIX)
#ifndef _XOPEN_SOURCE
#define not_XOPEN_SOURCE
#define _XOPEN_SOURCE 1
#endif
#if defined(CPP_USE_NEW_C_HEADERS)
#include <cwchar>
/* struct tm forward declaration does not work because of compiler bug */
#define CPP_SUPPRESS_TM_FORWARD
#else
#include <wchar.h>
#endif
#ifdef not_XOPEN_SOURCE
#undef _XOPEN_SOURCE
#undef not_XOPEN_SOURCE
#endif
#include <dirent.h>
#elif defined(SAPonOSF1)
#if defined(CPP_USE_NEW_C_HEADERS)
#include <cwchar>
#else
#include <wchar.h>
#endif
#include <dirent.h>