MCPcopy Create free account
hub / github.com/apache/cloudberry / lo_hton64

Function lo_hton64

src/interfaces/libpq/fe-lobj.c:1042–1061  ·  view source on GitHub ↗

* lo_hton64 * converts a 64-bit integer from host byte order to network byte order */

Source from the content-addressed store, hash-verified

1040 * converts a 64-bit integer from host byte order to network byte order
1041 */
1042static pg_int64
1043lo_hton64(pg_int64 host64)
1044{
1045 union
1046 {
1047 pg_int64 i64;
1048 uint32 i32[2];
1049 } swap;
1050 uint32 t;
1051
1052 /* High order half first, since we're doing MSB-first */
1053 t = (uint32) (host64 >> 32);
1054 swap.i32[0] = pg_hton32(t);
1055
1056 /* Now the low order half */
1057 t = (uint32) host64;
1058 swap.i32[1] = pg_hton32(t);
1059
1060 return swap.i64;
1061}
1062
1063/*
1064 * lo_ntoh64

Callers 2

lo_truncate64Function · 0.85
lo_lseek64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected