Wheefun I/O Library  0.0.5
Useful I/O Primitives.
endian.h
Go to the documentation of this file.
1 /* WFIO - the Wheefun IO Library
2  Copyright (C) 2018 Phillip Kilgore
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even t implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <https://www.gnu.org/licenses/>.
16 
17  Additionally, you should have recieved a copy of the GNU Classpath
18  exception, which amends the license to generally permit linking against
19  the software provided herein.
20 */
21 
30 /* This file was generated by contrib/meta/endian.pl */
31 
32 #ifndef WFIO_ENDIAN_H
33 #define WFIO_ENDIAN_H
34 
35 #include <wfio/type.h>
36 
54  const wfio_sint16_t* src, wfio_endian_t srcEndian,
55  wfio_sint16_t* dest, wfio_endian_t destEndian,
56  size_t len);
57 
71  const wfio_sint16_t* src, wfio_sint16_t* dest,
72  wfio_endian_t destEndian, size_t len) {
73  wfio_convertEndianSI16V2(src, WFIO_ENDIAN_HOST, dest, destEndian, len);
74 }
75 
89  const wfio_sint16_t* src, wfio_sint16_t* dest,
90  wfio_endian_t srcEndian, size_t len) {
91  wfio_convertEndianSI16V2(src, srcEndian, dest, WFIO_ENDIAN_HOST, len);
92 }
93 
110  wfio_endian_t src, wfio_endian_t dest,
111  size_t len) {
112  wfio_convertEndianSI16V2(buf, src, buf, dest, len);
113 }
114 
115 
129  wfio_sint16_t* buf, wfio_endian_t destEndian, size_t len) {
130  wfio_convertEndianSI16V2(buf, WFIO_ENDIAN_HOST, buf, destEndian, len);
131 }
132 
146  wfio_sint16_t* buf, wfio_endian_t srcEndian, size_t len) {
147  wfio_convertEndianSI16V2(buf, srcEndian, buf, WFIO_ENDIAN_HOST, len);
148 }
149 
163 WFIO_ALWAYS_INLINE wfio_sint16_t wfio_convertEndianSI16(wfio_sint16_t x,
164  wfio_endian_t src, wfio_endian_t dest) {
165  wfio_convertEndianSI16V2(&x, src, &x, dest, 1);
166  return x;
167 }
168 
180  wfio_sint16_t x, wfio_endian_t destEndian) {
181  wfio_convertEndianSI16V2(&x, WFIO_ENDIAN_HOST, &x, destEndian, 1);
182  return x;
183 }
184 
196  wfio_sint16_t x, wfio_endian_t srcEndian) {
197  wfio_convertEndianSI16V2(&x, srcEndian, &x, WFIO_ENDIAN_HOST, 1);
198  return x;
199 }
200 
218  const wfio_uint16_t* src, wfio_endian_t srcEndian,
219  wfio_uint16_t* dest, wfio_endian_t destEndian,
220  size_t len) {
222  (const wfio_sint16_t*) src, srcEndian,
223  (wfio_sint16_t*) dest, destEndian,
224  len);
225 }
226 
240  const wfio_uint16_t* src, wfio_uint16_t* dest,
241  wfio_endian_t destEndian, size_t len) {
242  wfio_convertEndianUI16V2(src, WFIO_ENDIAN_HOST, dest, destEndian, len);
243 }
244 
258  const wfio_uint16_t* src, wfio_uint16_t* dest,
259  wfio_endian_t srcEndian, size_t len) {
260  wfio_convertEndianUI16V2(src, srcEndian, dest, WFIO_ENDIAN_HOST, len);
261 }
262 
279  wfio_endian_t src, wfio_endian_t dest,
280  size_t len) {
281  wfio_convertEndianUI16V2(buf, src, buf, dest, len);
282 }
283 
284 
298  wfio_uint16_t* buf, wfio_endian_t destEndian, size_t len) {
299  wfio_convertEndianUI16V2(buf, WFIO_ENDIAN_HOST, buf, destEndian, len);
300 }
301 
315  wfio_uint16_t* buf, wfio_endian_t srcEndian, size_t len) {
316  wfio_convertEndianUI16V2(buf, srcEndian, buf, WFIO_ENDIAN_HOST, len);
317 }
318 
332 WFIO_ALWAYS_INLINE wfio_uint16_t wfio_convertEndianUI16(wfio_uint16_t x,
333  wfio_endian_t src, wfio_endian_t dest) {
334  wfio_convertEndianUI16V2(&x, src, &x, dest, 1);
335  return x;
336 }
337 
349  wfio_uint16_t x, wfio_endian_t destEndian) {
350  wfio_convertEndianUI16V2(&x, WFIO_ENDIAN_HOST, &x, destEndian, 1);
351  return x;
352 }
353 
365  wfio_uint16_t x, wfio_endian_t srcEndian) {
366  wfio_convertEndianUI16V2(&x, srcEndian, &x, WFIO_ENDIAN_HOST, 1);
367  return x;
368 }
369 
387  const wfio_sint32_t* src, wfio_endian_t srcEndian,
388  wfio_sint32_t* dest, wfio_endian_t destEndian,
389  size_t len);
390 
404  const wfio_sint32_t* src, wfio_sint32_t* dest,
405  wfio_endian_t destEndian, size_t len) {
406  wfio_convertEndianSI32V2(src, WFIO_ENDIAN_HOST, dest, destEndian, len);
407 }
408 
422  const wfio_sint32_t* src, wfio_sint32_t* dest,
423  wfio_endian_t srcEndian, size_t len) {
424  wfio_convertEndianSI32V2(src, srcEndian, dest, WFIO_ENDIAN_HOST, len);
425 }
426 
443  wfio_endian_t src, wfio_endian_t dest,
444  size_t len) {
445  wfio_convertEndianSI32V2(buf, src, buf, dest, len);
446 }
447 
448 
462  wfio_sint32_t* buf, wfio_endian_t destEndian, size_t len) {
463  wfio_convertEndianSI32V2(buf, WFIO_ENDIAN_HOST, buf, destEndian, len);
464 }
465 
479  wfio_sint32_t* buf, wfio_endian_t srcEndian, size_t len) {
480  wfio_convertEndianSI32V2(buf, srcEndian, buf, WFIO_ENDIAN_HOST, len);
481 }
482 
496 WFIO_ALWAYS_INLINE wfio_sint32_t wfio_convertEndianSI32(wfio_sint32_t x,
497  wfio_endian_t src, wfio_endian_t dest) {
498  wfio_convertEndianSI32V2(&x, src, &x, dest, 1);
499  return x;
500 }
501 
513  wfio_sint32_t x, wfio_endian_t destEndian) {
514  wfio_convertEndianSI32V2(&x, WFIO_ENDIAN_HOST, &x, destEndian, 1);
515  return x;
516 }
517 
529  wfio_sint32_t x, wfio_endian_t srcEndian) {
530  wfio_convertEndianSI32V2(&x, srcEndian, &x, WFIO_ENDIAN_HOST, 1);
531  return x;
532 }
533 
551  const wfio_uint32_t* src, wfio_endian_t srcEndian,
552  wfio_uint32_t* dest, wfio_endian_t destEndian,
553  size_t len) {
555  (const wfio_sint32_t*) src, srcEndian,
556  (wfio_sint32_t*) dest, destEndian,
557  len);
558 }
559 
573  const wfio_uint32_t* src, wfio_uint32_t* dest,
574  wfio_endian_t destEndian, size_t len) {
575  wfio_convertEndianUI32V2(src, WFIO_ENDIAN_HOST, dest, destEndian, len);
576 }
577 
591  const wfio_uint32_t* src, wfio_uint32_t* dest,
592  wfio_endian_t srcEndian, size_t len) {
593  wfio_convertEndianUI32V2(src, srcEndian, dest, WFIO_ENDIAN_HOST, len);
594 }
595 
612  wfio_endian_t src, wfio_endian_t dest,
613  size_t len) {
614  wfio_convertEndianUI32V2(buf, src, buf, dest, len);
615 }
616 
617 
631  wfio_uint32_t* buf, wfio_endian_t destEndian, size_t len) {
632  wfio_convertEndianUI32V2(buf, WFIO_ENDIAN_HOST, buf, destEndian, len);
633 }
634 
648  wfio_uint32_t* buf, wfio_endian_t srcEndian, size_t len) {
649  wfio_convertEndianUI32V2(buf, srcEndian, buf, WFIO_ENDIAN_HOST, len);
650 }
651 
665 WFIO_ALWAYS_INLINE wfio_uint32_t wfio_convertEndianUI32(wfio_uint32_t x,
666  wfio_endian_t src, wfio_endian_t dest) {
667  wfio_convertEndianUI32V2(&x, src, &x, dest, 1);
668  return x;
669 }
670 
682  wfio_uint32_t x, wfio_endian_t destEndian) {
683  wfio_convertEndianUI32V2(&x, WFIO_ENDIAN_HOST, &x, destEndian, 1);
684  return x;
685 }
686 
698  wfio_uint32_t x, wfio_endian_t srcEndian) {
699  wfio_convertEndianUI32V2(&x, srcEndian, &x, WFIO_ENDIAN_HOST, 1);
700  return x;
701 }
702 
720  const wfio_sint64_t* src, wfio_endian_t srcEndian,
721  wfio_sint64_t* dest, wfio_endian_t destEndian,
722  size_t len);
723 
737  const wfio_sint64_t* src, wfio_sint64_t* dest,
738  wfio_endian_t destEndian, size_t len) {
739  wfio_convertEndianSI64V2(src, WFIO_ENDIAN_HOST, dest, destEndian, len);
740 }
741 
755  const wfio_sint64_t* src, wfio_sint64_t* dest,
756  wfio_endian_t srcEndian, size_t len) {
757  wfio_convertEndianSI64V2(src, srcEndian, dest, WFIO_ENDIAN_HOST, len);
758 }
759 
776  wfio_endian_t src, wfio_endian_t dest,
777  size_t len) {
778  wfio_convertEndianSI64V2(buf, src, buf, dest, len);
779 }
780 
781 
795  wfio_sint64_t* buf, wfio_endian_t destEndian, size_t len) {
796  wfio_convertEndianSI64V2(buf, WFIO_ENDIAN_HOST, buf, destEndian, len);
797 }
798 
812  wfio_sint64_t* buf, wfio_endian_t srcEndian, size_t len) {
813  wfio_convertEndianSI64V2(buf, srcEndian, buf, WFIO_ENDIAN_HOST, len);
814 }
815 
829 WFIO_ALWAYS_INLINE wfio_sint64_t wfio_convertEndianSI64(wfio_sint64_t x,
830  wfio_endian_t src, wfio_endian_t dest) {
831  wfio_convertEndianSI64V2(&x, src, &x, dest, 1);
832  return x;
833 }
834 
846  wfio_sint64_t x, wfio_endian_t destEndian) {
847  wfio_convertEndianSI64V2(&x, WFIO_ENDIAN_HOST, &x, destEndian, 1);
848  return x;
849 }
850 
862  wfio_sint64_t x, wfio_endian_t srcEndian) {
863  wfio_convertEndianSI64V2(&x, srcEndian, &x, WFIO_ENDIAN_HOST, 1);
864  return x;
865 }
866 
884  const wfio_uint64_t* src, wfio_endian_t srcEndian,
885  wfio_uint64_t* dest, wfio_endian_t destEndian,
886  size_t len) {
888  (const wfio_sint64_t*) src, srcEndian,
889  (wfio_sint64_t*) dest, destEndian,
890  len);
891 }
892 
906  const wfio_uint64_t* src, wfio_uint64_t* dest,
907  wfio_endian_t destEndian, size_t len) {
908  wfio_convertEndianUI64V2(src, WFIO_ENDIAN_HOST, dest, destEndian, len);
909 }
910 
924  const wfio_uint64_t* src, wfio_uint64_t* dest,
925  wfio_endian_t srcEndian, size_t len) {
926  wfio_convertEndianUI64V2(src, srcEndian, dest, WFIO_ENDIAN_HOST, len);
927 }
928 
945  wfio_endian_t src, wfio_endian_t dest,
946  size_t len) {
947  wfio_convertEndianUI64V2(buf, src, buf, dest, len);
948 }
949 
950 
964  wfio_uint64_t* buf, wfio_endian_t destEndian, size_t len) {
965  wfio_convertEndianUI64V2(buf, WFIO_ENDIAN_HOST, buf, destEndian, len);
966 }
967 
981  wfio_uint64_t* buf, wfio_endian_t srcEndian, size_t len) {
982  wfio_convertEndianUI64V2(buf, srcEndian, buf, WFIO_ENDIAN_HOST, len);
983 }
984 
998 WFIO_ALWAYS_INLINE wfio_uint64_t wfio_convertEndianUI64(wfio_uint64_t x,
999  wfio_endian_t src, wfio_endian_t dest) {
1000  wfio_convertEndianUI64V2(&x, src, &x, dest, 1);
1001  return x;
1002 }
1003 
1015  wfio_uint64_t x, wfio_endian_t destEndian) {
1016  wfio_convertEndianUI64V2(&x, WFIO_ENDIAN_HOST, &x, destEndian, 1);
1017  return x;
1018 }
1019 
1031  wfio_uint64_t x, wfio_endian_t srcEndian) {
1032  wfio_convertEndianUI64V2(&x, srcEndian, &x, WFIO_ENDIAN_HOST, 1);
1033  return x;
1034 }
1035 
1036 
1037 #endif
1038 
1039 /* C++ Bindings */
1040 #ifdef __cplusplus
1041 namespace wfio {
1043  inline void convertEndian(const wfio::sint16_t* src, wfio::endian_t srcEndian, wfio::sint16_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1044  ::wfio_convertEndianSI16V2(src, srcEndian, dest, destEndian, len);
1045  }
1046 
1048  inline void fromHostEndian(const wfio::sint16_t* src, wfio::sint16_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1049  ::wfio_fromHostEndianSI16V2(src, dest, destEndian, len);
1050  }
1051 
1053  inline void toHostEndian(const wfio::sint16_t* src, wfio::sint16_t* dest, wfio::endian_t srcEndian, size_t len) throw() {
1054  ::wfio_toHostEndianSI16V2(src, dest, srcEndian, len);
1055  }
1056 
1058  inline void convertEndian(wfio::sint16_t* buf, wfio::endian_t src, wfio::endian_t dest, size_t len) throw() {
1059  ::wfio_convertEndianSI16V(buf, src, dest, len);
1060  }
1061 
1063  inline void fromHostEndian(wfio::sint16_t* buf, wfio::endian_t destEndian, size_t len) throw() {
1064  ::wfio_fromHostEndianSI16V(buf, destEndian, len);
1065  }
1066 
1068  inline void toHostEndian(wfio::sint16_t* buf, wfio::endian_t srcEndian, size_t len) throw() {
1069  ::wfio_toHostEndianSI16V(buf, srcEndian, len);
1070  }
1071 
1073  inline wfio_sint16_t convertEndian(wfio::sint16_t x, wfio::endian_t src, wfio::endian_t dest) throw() {
1074  ::wfio_convertEndianSI16(x, src, dest);
1075  }
1076 
1078  inline wfio_sint16_t fromHostEndian(wfio::sint16_t x, wfio::endian_t destEndian) throw() {
1079  ::wfio_fromHostEndianSI16(x, destEndian);
1080  }
1081 
1083  inline wfio_sint16_t toHostEndian(wfio::sint16_t x, wfio::endian_t srcEndian) throw() {
1084  ::wfio_toHostEndianSI16(x, srcEndian);
1085  }
1086 
1088  inline void convertEndian(const wfio::uint16_t* src, wfio::endian_t srcEndian, wfio::uint16_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1089  ::wfio_convertEndianUI16V2(src, srcEndian, dest, destEndian, len);
1090  }
1091 
1093  inline void fromHostEndian(const wfio::uint16_t* src, wfio::uint16_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1094  ::wfio_fromHostEndianUI16V2(src, dest, destEndian, len);
1095  }
1096 
1098  inline void toHostEndian(const wfio::uint16_t* src, wfio::uint16_t* dest, wfio::endian_t srcEndian, size_t len) throw() {
1099  ::wfio_toHostEndianUI16V2(src, dest, srcEndian, len);
1100  }
1101 
1103  inline void convertEndian(wfio::uint16_t* buf, wfio::endian_t src, wfio::endian_t dest, size_t len) throw() {
1104  ::wfio_convertEndianUI16V(buf, src, dest, len);
1105  }
1106 
1108  inline void fromHostEndian(wfio::uint16_t* buf, wfio::endian_t destEndian, size_t len) throw() {
1109  ::wfio_fromHostEndianUI16V(buf, destEndian, len);
1110  }
1111 
1113  inline void toHostEndian(wfio::uint16_t* buf, wfio::endian_t srcEndian, size_t len) throw() {
1114  ::wfio_toHostEndianUI16V(buf, srcEndian, len);
1115  }
1116 
1118  inline wfio_uint16_t convertEndian(wfio::uint16_t x, wfio::endian_t src, wfio::endian_t dest) throw() {
1119  ::wfio_convertEndianUI16(x, src, dest);
1120  }
1121 
1123  inline wfio_uint16_t fromHostEndian(wfio::uint16_t x, wfio::endian_t destEndian) throw() {
1124  ::wfio_fromHostEndianUI16(x, destEndian);
1125  }
1126 
1128  inline wfio_uint16_t toHostEndian(wfio::uint16_t x, wfio::endian_t srcEndian) throw() {
1129  ::wfio_toHostEndianUI16(x, srcEndian);
1130  }
1131 
1133  inline void convertEndian(const wfio::sint32_t* src, wfio::endian_t srcEndian, wfio::sint32_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1134  ::wfio_convertEndianSI32V2(src, srcEndian, dest, destEndian, len);
1135  }
1136 
1138  inline void fromHostEndian(const wfio::sint32_t* src, wfio::sint32_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1139  ::wfio_fromHostEndianSI32V2(src, dest, destEndian, len);
1140  }
1141 
1143  inline void toHostEndian(const wfio::sint32_t* src, wfio::sint32_t* dest, wfio::endian_t srcEndian, size_t len) throw() {
1144  ::wfio_toHostEndianSI32V2(src, dest, srcEndian, len);
1145  }
1146 
1148  inline void convertEndian(wfio::sint32_t* buf, wfio::endian_t src, wfio::endian_t dest, size_t len) throw() {
1149  ::wfio_convertEndianSI32V(buf, src, dest, len);
1150  }
1151 
1153  inline void fromHostEndian(wfio::sint32_t* buf, wfio::endian_t destEndian, size_t len) throw() {
1154  ::wfio_fromHostEndianSI32V(buf, destEndian, len);
1155  }
1156 
1158  inline void toHostEndian(wfio::sint32_t* buf, wfio::endian_t srcEndian, size_t len) throw() {
1159  ::wfio_toHostEndianSI32V(buf, srcEndian, len);
1160  }
1161 
1163  inline wfio_sint32_t convertEndian(wfio::sint32_t x, wfio::endian_t src, wfio::endian_t dest) throw() {
1164  ::wfio_convertEndianSI32(x, src, dest);
1165  }
1166 
1168  inline wfio_sint32_t fromHostEndian(wfio::sint32_t x, wfio::endian_t destEndian) throw() {
1169  ::wfio_fromHostEndianSI32(x, destEndian);
1170  }
1171 
1173  inline wfio_sint32_t toHostEndian(wfio::sint32_t x, wfio::endian_t srcEndian) throw() {
1174  ::wfio_toHostEndianSI32(x, srcEndian);
1175  }
1176 
1178  inline void convertEndian(const wfio::uint32_t* src, wfio::endian_t srcEndian, wfio::uint32_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1179  ::wfio_convertEndianUI32V2(src, srcEndian, dest, destEndian, len);
1180  }
1181 
1183  inline void fromHostEndian(const wfio::uint32_t* src, wfio::uint32_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1184  ::wfio_fromHostEndianUI32V2(src, dest, destEndian, len);
1185  }
1186 
1188  inline void toHostEndian(const wfio::uint32_t* src, wfio::uint32_t* dest, wfio::endian_t srcEndian, size_t len) throw() {
1189  ::wfio_toHostEndianUI32V2(src, dest, srcEndian, len);
1190  }
1191 
1193  inline void convertEndian(wfio::uint32_t* buf, wfio::endian_t src, wfio::endian_t dest, size_t len) throw() {
1194  ::wfio_convertEndianUI32V(buf, src, dest, len);
1195  }
1196 
1198  inline void fromHostEndian(wfio::uint32_t* buf, wfio::endian_t destEndian, size_t len) throw() {
1199  ::wfio_fromHostEndianUI32V(buf, destEndian, len);
1200  }
1201 
1203  inline void toHostEndian(wfio::uint32_t* buf, wfio::endian_t srcEndian, size_t len) throw() {
1204  ::wfio_toHostEndianUI32V(buf, srcEndian, len);
1205  }
1206 
1208  inline wfio_uint32_t convertEndian(wfio::uint32_t x, wfio::endian_t src, wfio::endian_t dest) throw() {
1209  ::wfio_convertEndianUI32(x, src, dest);
1210  }
1211 
1213  inline wfio_uint32_t fromHostEndian(wfio::uint32_t x, wfio::endian_t destEndian) throw() {
1214  ::wfio_fromHostEndianUI32(x, destEndian);
1215  }
1216 
1218  inline wfio_uint32_t toHostEndian(wfio::uint32_t x, wfio::endian_t srcEndian) throw() {
1219  ::wfio_toHostEndianUI32(x, srcEndian);
1220  }
1221 
1223  inline void convertEndian(const wfio::sint64_t* src, wfio::endian_t srcEndian, wfio::sint64_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1224  ::wfio_convertEndianSI64V2(src, srcEndian, dest, destEndian, len);
1225  }
1226 
1228  inline void fromHostEndian(const wfio::sint64_t* src, wfio::sint64_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1229  ::wfio_fromHostEndianSI64V2(src, dest, destEndian, len);
1230  }
1231 
1233  inline void toHostEndian(const wfio::sint64_t* src, wfio::sint64_t* dest, wfio::endian_t srcEndian, size_t len) throw() {
1234  ::wfio_toHostEndianSI64V2(src, dest, srcEndian, len);
1235  }
1236 
1238  inline void convertEndian(wfio::sint64_t* buf, wfio::endian_t src, wfio::endian_t dest, size_t len) throw() {
1239  ::wfio_convertEndianSI64V(buf, src, dest, len);
1240  }
1241 
1243  inline void fromHostEndian(wfio::sint64_t* buf, wfio::endian_t destEndian, size_t len) throw() {
1244  ::wfio_fromHostEndianSI64V(buf, destEndian, len);
1245  }
1246 
1248  inline void toHostEndian(wfio::sint64_t* buf, wfio::endian_t srcEndian, size_t len) throw() {
1249  ::wfio_toHostEndianSI64V(buf, srcEndian, len);
1250  }
1251 
1253  inline wfio_sint64_t convertEndian(wfio::sint64_t x, wfio::endian_t src, wfio::endian_t dest) throw() {
1254  ::wfio_convertEndianSI64(x, src, dest);
1255  }
1256 
1258  inline wfio_sint64_t fromHostEndian(wfio::sint64_t x, wfio::endian_t destEndian) throw() {
1259  ::wfio_fromHostEndianSI64(x, destEndian);
1260  }
1261 
1263  inline wfio_sint64_t toHostEndian(wfio::sint64_t x, wfio::endian_t srcEndian) throw() {
1264  ::wfio_toHostEndianSI64(x, srcEndian);
1265  }
1266 
1268  inline void convertEndian(const wfio::uint64_t* src, wfio::endian_t srcEndian, wfio::uint64_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1269  ::wfio_convertEndianUI64V2(src, srcEndian, dest, destEndian, len);
1270  }
1271 
1273  inline void fromHostEndian(const wfio::uint64_t* src, wfio::uint64_t* dest, wfio::endian_t destEndian, size_t len) throw() {
1274  ::wfio_fromHostEndianUI64V2(src, dest, destEndian, len);
1275  }
1276 
1278  inline void toHostEndian(const wfio::uint64_t* src, wfio::uint64_t* dest, wfio::endian_t srcEndian, size_t len) throw() {
1279  ::wfio_toHostEndianUI64V2(src, dest, srcEndian, len);
1280  }
1281 
1283  inline void convertEndian(wfio::uint64_t* buf, wfio::endian_t src, wfio::endian_t dest, size_t len) throw() {
1284  ::wfio_convertEndianUI64V(buf, src, dest, len);
1285  }
1286 
1288  inline void fromHostEndian(wfio::uint64_t* buf, wfio::endian_t destEndian, size_t len) throw() {
1289  ::wfio_fromHostEndianUI64V(buf, destEndian, len);
1290  }
1291 
1293  inline void toHostEndian(wfio::uint64_t* buf, wfio::endian_t srcEndian, size_t len) throw() {
1294  ::wfio_toHostEndianUI64V(buf, srcEndian, len);
1295  }
1296 
1298  inline wfio_uint64_t convertEndian(wfio::uint64_t x, wfio::endian_t src, wfio::endian_t dest) throw() {
1299  ::wfio_convertEndianUI64(x, src, dest);
1300  }
1301 
1303  inline wfio_uint64_t fromHostEndian(wfio::uint64_t x, wfio::endian_t destEndian) throw() {
1304  ::wfio_fromHostEndianUI64(x, destEndian);
1305  }
1306 
1308  inline wfio_uint64_t toHostEndian(wfio::uint64_t x, wfio::endian_t srcEndian) throw() {
1309  ::wfio_toHostEndianUI64(x, srcEndian);
1310  }
1311 
1312 }
1313 #endif
The root namespace for WFIO.
Definition: bin.h:879
WFIO_ALWAYS_INLINE void wfio_fromHostEndianSI32V2(const wfio_sint32_t *src, wfio_sint32_t *dest, wfio_endian_t destEndian, size_t len)
Convert 32-bit signed integers in src from the host endianness to that of destEndian and store them i...
Definition: endian.h:403
WFIO_ALWAYS_INLINE void wfio_toHostEndianUI32V2(const wfio_uint32_t *src, wfio_uint32_t *dest, wfio_endian_t srcEndian, size_t len)
Convert 32-bit unsigned integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:590
::wfio_uint32_t uint32_t
Definition: integer.h:128
WFIO_ALWAYS_INLINE void wfio_toHostEndianSI32V2(const wfio_sint32_t *src, wfio_sint32_t *dest, wfio_endian_t srcEndian, size_t len)
Convert 32-bit signed integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:421
WFIO_ALWAYS_INLINE void wfio_toHostEndianUI32V(wfio_uint32_t *buf, wfio_endian_t srcEndian, size_t len)
Convert 32-bit unsigned integers in buf from srcEndian to that of the host.
Definition: endian.h:647
#define WFIO_DLL
Mark the symbol as an element of the library.
Definition: host.h:397
WFIO_ALWAYS_INLINE wfio_uint32_t wfio_toHostEndianUI32(wfio_uint32_t x, wfio_endian_t srcEndian)
Convert a 32-bit unsigned integer from src to that of the host.
Definition: endian.h:697
WFIO_ALWAYS_INLINE wfio_sint16_t wfio_toHostEndianSI16(wfio_sint16_t x, wfio_endian_t srcEndian)
Convert a 16-bit signed integer from src to that of the host.
Definition: endian.h:195
WFIO_ALWAYS_INLINE wfio_uint32_t wfio_convertEndianUI32(wfio_uint32_t x, wfio_endian_t src, wfio_endian_t dest)
Perform endianness conversion on a 32-bit unsigned integer.
Definition: endian.h:665
WFIO_ALWAYS_INLINE void wfio_convertEndianUI16V2(const wfio_uint16_t *src, wfio_endian_t srcEndian, wfio_uint16_t *dest, wfio_endian_t destEndian, size_t len)
Perform endianness conversion on 16-bit signed integers in src to be stored in dest.
Definition: endian.h:217
WFIO_ALWAYS_INLINE void wfio_fromHostEndianSI64V2(const wfio_sint64_t *src, wfio_sint64_t *dest, wfio_endian_t destEndian, size_t len)
Convert 64-bit signed integers in src from the host endianness to that of destEndian and store them i...
Definition: endian.h:736
WFIO_ALWAYS_INLINE wfio_sint16_t wfio_fromHostEndianSI16(wfio_sint16_t x, wfio_endian_t destEndian)
Convert a 16-bit signed integers from the host endianness to that of dest.
Definition: endian.h:179
WFIO_ALWAYS_INLINE void wfio_toHostEndianSI64V(wfio_sint64_t *buf, wfio_endian_t srcEndian, size_t len)
Convert 64-bit signed integers in buf from srcEndian to that of the host.
Definition: endian.h:811
WFIO_ALWAYS_INLINE wfio_sint64_t wfio_toHostEndianSI64(wfio_sint64_t x, wfio_endian_t srcEndian)
Convert a 64-bit signed integer from src to that of the host.
Definition: endian.h:861
WFIO_ALWAYS_INLINE void wfio_fromHostEndianUI32V2(const wfio_uint32_t *src, wfio_uint32_t *dest, wfio_endian_t destEndian, size_t len)
Convert 32-bit unsigned integers in src from the host endianness to that of destEndian and store them...
Definition: endian.h:572
WFIO_ALWAYS_INLINE wfio_uint32_t wfio_fromHostEndianUI32(wfio_uint32_t x, wfio_endian_t destEndian)
Convert a 32-bit unsigned integers from the host endianness to that of dest.
Definition: endian.h:681
WFIO_ALWAYS_INLINE wfio_uint16_t wfio_toHostEndianUI16(wfio_uint16_t x, wfio_endian_t srcEndian)
Convert a 16-bit unsigned integer from src to that of the host.
Definition: endian.h:364
#define WFIO_ALWAYS_INLINE
Mark this symbol to be forced inline.
Definition: host.h:447
WFIO_ALWAYS_INLINE void wfio_convertEndianUI64V(wfio_uint64_t *buf, wfio_endian_t src, wfio_endian_t dest, size_t len)
Perform endianness conversion on 64-bit unsigned integers in buf.
Definition: endian.h:944
WFIO_ALWAYS_INLINE wfio_sint16_t wfio_convertEndianSI16(wfio_sint16_t x, wfio_endian_t src, wfio_endian_t dest)
Perform endianness conversion on a 16-bit signed integer.
Definition: endian.h:163
::wfio_uint16_t uint16_t
Definition: integer.h:122
WFIO_DLL void wfio_convertEndianSI16V2(const wfio_sint16_t *src, wfio_endian_t srcEndian, wfio_sint16_t *dest, wfio_endian_t destEndian, size_t len)
Perform endianness conversion on 16-bit signed integers in src to be stored in dest.
WFIO_ALWAYS_INLINE void wfio_fromHostEndianUI32V(wfio_uint32_t *buf, wfio_endian_t destEndian, size_t len)
Convert 32-bit unsigned integers in buf from the host endianness to that of destEndian.
Definition: endian.h:630
WFIO_ALWAYS_INLINE void wfio_convertEndianUI16V(wfio_uint16_t *buf, wfio_endian_t src, wfio_endian_t dest, size_t len)
Perform endianness conversion on 16-bit unsigned integers in buf.
Definition: endian.h:278
::wfio_uint64_t uint64_t
Definition: integer.h:134
::wfio_sint32_t sint32_t
Definition: integer.h:125
WFIO_ALWAYS_INLINE void wfio_fromHostEndianUI64V(wfio_uint64_t *buf, wfio_endian_t destEndian, size_t len)
Convert 64-bit unsigned integers in buf from the host endianness to that of destEndian.
Definition: endian.h:963
WFIO_ALWAYS_INLINE wfio_uint64_t wfio_fromHostEndianUI64(wfio_uint64_t x, wfio_endian_t destEndian)
Convert a 64-bit unsigned integers from the host endianness to that of dest.
Definition: endian.h:1014
WFIO_ALWAYS_INLINE void wfio_convertEndianUI64V2(const wfio_uint64_t *src, wfio_endian_t srcEndian, wfio_uint64_t *dest, wfio_endian_t destEndian, size_t len)
Perform endianness conversion on 64-bit signed integers in src to be stored in dest.
Definition: endian.h:883
WFIO_ALWAYS_INLINE wfio_uint64_t wfio_convertEndianUI64(wfio_uint64_t x, wfio_endian_t src, wfio_endian_t dest)
Perform endianness conversion on a 64-bit unsigned integer.
Definition: endian.h:998
WFIO_ALWAYS_INLINE wfio_uint16_t wfio_fromHostEndianUI16(wfio_uint16_t x, wfio_endian_t destEndian)
Convert a 16-bit unsigned integers from the host endianness to that of dest.
Definition: endian.h:348
void toHostEndian(const wfio::sint16_t *src, wfio::sint16_t *dest, wfio::endian_t srcEndian, size_t len)
Convert 16-bit signed integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:1053
WFIO_ALWAYS_INLINE void wfio_toHostEndianUI16V(wfio_uint16_t *buf, wfio_endian_t srcEndian, size_t len)
Convert 16-bit unsigned integers in buf from srcEndian to that of the host.
Definition: endian.h:314
WFIO_ALWAYS_INLINE void wfio_fromHostEndianUI64V2(const wfio_uint64_t *src, wfio_uint64_t *dest, wfio_endian_t destEndian, size_t len)
Convert 64-bit unsigned integers in src from the host endianness to that of destEndian and store them...
Definition: endian.h:905
WFIO_ALWAYS_INLINE void wfio_fromHostEndianUI16V2(const wfio_uint16_t *src, wfio_uint16_t *dest, wfio_endian_t destEndian, size_t len)
Convert 16-bit unsigned integers in src from the host endianness to that of destEndian and store them...
Definition: endian.h:239
WFIO_ALWAYS_INLINE void wfio_convertEndianSI16V(wfio_sint16_t *buf, wfio_endian_t src, wfio_endian_t dest, size_t len)
Perform endianness conversion on 16-bit signed integers in buf.
Definition: endian.h:109
WFIO_ALWAYS_INLINE wfio_sint32_t wfio_fromHostEndianSI32(wfio_sint32_t x, wfio_endian_t destEndian)
Convert a 32-bit signed integers from the host endianness to that of dest.
Definition: endian.h:512
void convertEndian(const wfio::sint16_t *src, wfio::endian_t srcEndian, wfio::sint16_t *dest, wfio::endian_t destEndian, size_t len)
Perform endianness conversion on 16-bit signed integers in src to be stored in dest.
Definition: endian.h:1043
WFIO_ALWAYS_INLINE void wfio_convertEndianSI32V(wfio_sint32_t *buf, wfio_endian_t src, wfio_endian_t dest, size_t len)
Perform endianness conversion on 32-bit signed integers in buf.
Definition: endian.h:442
WFIO_DLL void wfio_convertEndianSI32V2(const wfio_sint32_t *src, wfio_endian_t srcEndian, wfio_sint32_t *dest, wfio_endian_t destEndian, size_t len)
Perform endianness conversion on 32-bit signed integers in src to be stored in dest.
::wfio_sint16_t sint16_t
Definition: integer.h:119
WFIO_ALWAYS_INLINE wfio_sint32_t wfio_toHostEndianSI32(wfio_sint32_t x, wfio_endian_t srcEndian)
Convert a 32-bit signed integer from src to that of the host.
Definition: endian.h:528
WFIO_ALWAYS_INLINE void wfio_toHostEndianUI64V2(const wfio_uint64_t *src, wfio_uint64_t *dest, wfio_endian_t srcEndian, size_t len)
Convert 64-bit unsigned integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:923
WFIO_ALWAYS_INLINE wfio_sint64_t wfio_fromHostEndianSI64(wfio_sint64_t x, wfio_endian_t destEndian)
Convert a 64-bit signed integers from the host endianness to that of dest.
Definition: endian.h:845
WFIO_ALWAYS_INLINE void wfio_toHostEndianSI64V2(const wfio_sint64_t *src, wfio_sint64_t *dest, wfio_endian_t srcEndian, size_t len)
Convert 64-bit signed integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:754
WFIO_ALWAYS_INLINE void wfio_toHostEndianSI16V2(const wfio_sint16_t *src, wfio_sint16_t *dest, wfio_endian_t srcEndian, size_t len)
Convert 16-bit signed integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:88
WFIO_ALWAYS_INLINE void wfio_fromHostEndianUI16V(wfio_uint16_t *buf, wfio_endian_t destEndian, size_t len)
Convert 16-bit unsigned integers in buf from the host endianness to that of destEndian.
Definition: endian.h:297
WFIO_ALWAYS_INLINE void wfio_toHostEndianSI32V(wfio_sint32_t *buf, wfio_endian_t srcEndian, size_t len)
Convert 32-bit signed integers in buf from srcEndian to that of the host.
Definition: endian.h:478
WFIO_ALWAYS_INLINE wfio_sint32_t wfio_convertEndianSI32(wfio_sint32_t x, wfio_endian_t src, wfio_endian_t dest)
Perform endianness conversion on a 32-bit signed integer.
Definition: endian.h:496
WFIO_ALWAYS_INLINE void wfio_convertEndianUI32V(wfio_uint32_t *buf, wfio_endian_t src, wfio_endian_t dest, size_t len)
Perform endianness conversion on 32-bit unsigned integers in buf.
Definition: endian.h:611
wfio_endian_t
A categorization of the byte-order of multibyte integers.
Definition: misctype.h:61
WFIO_DLL void wfio_convertEndianSI64V2(const wfio_sint64_t *src, wfio_endian_t srcEndian, wfio_sint64_t *dest, wfio_endian_t destEndian, size_t len)
Perform endianness conversion on 64-bit signed integers in src to be stored in dest.
WFIO_ALWAYS_INLINE wfio_sint64_t wfio_convertEndianSI64(wfio_sint64_t x, wfio_endian_t src, wfio_endian_t dest)
Perform endianness conversion on a 64-bit signed integer.
Definition: endian.h:829
WFIO_ALWAYS_INLINE wfio_uint64_t wfio_toHostEndianUI64(wfio_uint64_t x, wfio_endian_t srcEndian)
Convert a 64-bit unsigned integer from src to that of the host.
Definition: endian.h:1030
The endianness of this system.
Definition: misctype.h:173
void fromHostEndian(const wfio::sint16_t *src, wfio::sint16_t *dest, wfio::endian_t destEndian, size_t len)
Convert 16-bit signed integers in src from the host endianness to that of destEndian and store them i...
Definition: endian.h:1048
WFIO_ALWAYS_INLINE void wfio_convertEndianSI64V(wfio_sint64_t *buf, wfio_endian_t src, wfio_endian_t dest, size_t len)
Perform endianness conversion on 64-bit signed integers in buf.
Definition: endian.h:775
WFIO_ALWAYS_INLINE void wfio_toHostEndianUI16V2(const wfio_uint16_t *src, wfio_uint16_t *dest, wfio_endian_t srcEndian, size_t len)
Convert 16-bit unsigned integers in src from srcEndian to that of the host and store them in dest...
Definition: endian.h:257
::wfio_sint64_t sint64_t
Definition: integer.h:131
WFIO_ALWAYS_INLINE void wfio_fromHostEndianSI32V(wfio_sint32_t *buf, wfio_endian_t destEndian, size_t len)
Convert 32-bit signed integers in buf from the host endianness to that of destEndian.
Definition: endian.h:461
WFIO_ALWAYS_INLINE void wfio_convertEndianUI32V2(const wfio_uint32_t *src, wfio_endian_t srcEndian, wfio_uint32_t *dest, wfio_endian_t destEndian, size_t len)
Perform endianness conversion on 32-bit signed integers in src to be stored in dest.
Definition: endian.h:550
WFIO_ALWAYS_INLINE void wfio_fromHostEndianSI64V(wfio_sint64_t *buf, wfio_endian_t destEndian, size_t len)
Convert 64-bit signed integers in buf from the host endianness to that of destEndian.
Definition: endian.h:794
WFIO_ALWAYS_INLINE void wfio_fromHostEndianSI16V2(const wfio_sint16_t *src, wfio_sint16_t *dest, wfio_endian_t destEndian, size_t len)
Convert 16-bit signed integers in src from the host endianness to that of destEndian and store them i...
Definition: endian.h:70
WFIO_ALWAYS_INLINE void wfio_fromHostEndianSI16V(wfio_sint16_t *buf, wfio_endian_t destEndian, size_t len)
Convert 16-bit signed integers in buf from the host endianness to that of destEndian.
Definition: endian.h:128
WFIO_ALWAYS_INLINE void wfio_toHostEndianSI16V(wfio_sint16_t *buf, wfio_endian_t srcEndian, size_t len)
Convert 16-bit signed integers in buf from srcEndian to that of the host.
Definition: endian.h:145
WFIO_ALWAYS_INLINE wfio_uint16_t wfio_convertEndianUI16(wfio_uint16_t x, wfio_endian_t src, wfio_endian_t dest)
Perform endianness conversion on a 16-bit unsigned integer.
Definition: endian.h:332
WFIO_ALWAYS_INLINE void wfio_toHostEndianUI64V(wfio_uint64_t *buf, wfio_endian_t srcEndian, size_t len)
Convert 64-bit unsigned integers in buf from srcEndian to that of the host.
Definition: endian.h:980
Shared type definitions.