X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=include%2Flibsigrok%2Fproto.h;h=1a3fba8c048fd9f2a6ae6989a3bad3babcf04d51;hb=40df76aacbb9f98a6e9e36f53886e1af13f150b0;hp=caa8407e23a19ede70a311b6231c3555236cb47d;hpb=b6b4f03e404e06430eca810ad2bf7ccc84262b6e;p=libsigrok.git diff --git a/include/libsigrok/proto.h b/include/libsigrok/proto.h index caa8407e..1a3fba8c 100644 --- a/include/libsigrok/proto.h +++ b/include/libsigrok/proto.h @@ -33,6 +33,11 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog, SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog *analog, char **result); SR_API void sr_rational_set(struct sr_rational *r, int64_t p, uint64_t q); +SR_API int sr_rational_eq(const struct sr_rational *a, const struct sr_rational *b); +SR_API int sr_rational_mult(struct sr_rational *res, const struct sr_rational *a, + const struct sr_rational *b); +SR_API int sr_rational_div(struct sr_rational *res, const struct sr_rational *num, + const struct sr_rational *div); /*--- backend.c -------------------------------------------------------------*/ @@ -226,6 +231,7 @@ SR_API uint64_t sr_parse_timestring(const char *timestring); SR_API gboolean sr_parse_boolstring(const char *boolstring); SR_API int sr_parse_period(const char *periodstr, uint64_t *p, uint64_t *q); SR_API int sr_parse_voltage(const char *voltstr, uint64_t *p, uint64_t *q); +SR_API int sr_parse_rational(const char *str, struct sr_rational *ret); /*--- version.c -------------------------------------------------------------*/