Is there a C pre-processor string manipulation that could be used to extract substring from given string ?
I want to divide hexadecimal string representing __uint128 number into two hexadecimal 64bit chunks in order to produce 128bit number for given type.
As in pseudocode:
#include <inttypes.h>
#include <ctype.h>
#define UINT128_C(X) // extraxt hi (0x == 2) + (ffffffffffffffff == 16) == 18
// extract lo (ffffffffffffffff == 16)
// prepend lo with string "0x" == 18
// (((uint128_t)(hi) << 64) | (uint128_t)(lo))
typedef __uint128_t uint128_t;
uint128_t x;
x = UINT128_C( 0xffffffffffffffffffffffffffffffff );