]> sigrok.org Git - libsigrok.git/blobdiff - include/libsigrok/proto.h
analog: improve output readability by using SI prefix
[libsigrok.git] / include / libsigrok / proto.h
index caa8407e23a19ede70a311b6231c3555236cb47d..c799919e267a710dfed69de94db5a303dec8edd9 100644 (file)
 
 SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
                float *buf);
+SR_API const char *sr_analog_si_prefix(float *value, int *digits);
 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 +232,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 -------------------------------------------------------------*/