]> sigrok.org Git - libsigrok.git/blobdiff - include/libsigrok/proto.h
strutil: add method to get an sr_rational from a string
[libsigrok.git] / include / libsigrok / proto.h
index ea9d477946fd7ae74a963f77e1dc89dd3c906a0e..f2dc8d4953c12246c208733418285b7f61cc795e 100644 (file)
@@ -20,8 +20,6 @@
 #ifndef LIBSIGROK_PROTO_H
 #define LIBSIGROK_PROTO_H
 
-#include <unistd.h>
-
 /**
  * @file
  *
@@ -156,6 +154,7 @@ SR_API int sr_input_scan_file(const char *filename, const struct sr_input **in);
 SR_API struct sr_dev_inst *sr_input_dev_inst_get(const struct sr_input *in);
 SR_API int sr_input_send(const struct sr_input *in, GString *buf);
 SR_API int sr_input_end(const struct sr_input *in);
+SR_API int sr_input_reset(const struct sr_input *in);
 SR_API void sr_input_free(const struct sr_input *in);
 
 /*--- output/output.c -------------------------------------------------------*/
@@ -208,7 +207,7 @@ typedef int (*sr_resource_open_callback)(struct sr_resource *res,
                const char *name, void *cb_data);
 typedef int (*sr_resource_close_callback)(struct sr_resource *res,
                void *cb_data);
-typedef ssize_t (*sr_resource_read_callback)(const struct sr_resource *res,
+typedef gssize (*sr_resource_read_callback)(const struct sr_resource *res,
                void *buf, size_t count, void *cb_data);
 
 SR_API int sr_resource_set_hooks(struct sr_context *ctx,
@@ -227,6 +226,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 -------------------------------------------------------------*/