X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gruel%2Fsrc%2Finclude%2Fgruel%2Fpmt.h;fp=gruel%2Fsrc%2Finclude%2Fgruel%2Fpmt.h;h=514b24d8b0f26b6a44aa2f24f6b3b7267f1af557;hb=2924c0e740bbb9106bfed602345daaee5606d62a;hp=c371b023b539b79ec257133efe28bb36b6e837c5;hpb=94d315e556805fb75784964499472977664809c4;p=debian%2Fgnuradio diff --git a/gruel/src/include/gruel/pmt.h b/gruel/src/include/gruel/pmt.h index c371b023..514b24d8 100644 --- a/gruel/src/include/gruel/pmt.h +++ b/gruel/src/include/gruel/pmt.h @@ -163,6 +163,27 @@ pmt_t pmt_from_long(long x); */ long pmt_to_long(pmt_t x); +/* + * ------------------------------------------------------------------------ + * uint64_t + * ------------------------------------------------------------------------ + */ + +//! Return true if \p x is an uint64 number, else false +bool pmt_is_uint64(pmt_t x); + +//! Return the pmt value that represents the uint64 \p x. +pmt_t pmt_from_uint64(uint64_t x); + +/*! + * \brief Convert pmt to uint64 if possible. + * + * When \p x represents an exact integer that fits in a uint64, + * return that uint64. Else raise an exception, either wrong_type + * when x is not an exact uint64, or out_of_range when it doesn't fit. + */ +uint64_t pmt_to_uint64(pmt_t x); + /* * ------------------------------------------------------------------------ * Reals