]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
Fix all warnings and re-enable -Wextra.
[libsigrok.git] / sigrok.h
index a9d858a012d1579b06f3590c37c21a1171e26f11..1eedd8bca75b5b81c276cf8cb342afe8e414f973 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -35,8 +35,8 @@
  * use these #defines instead. All error codes are negative numbers.
  *
  * The error codes are globally unique in libsigrok, i.e. if one of the
- * libsigrok function returns a "malloc error" it must be exactly the same
- * return value as used for all other functions to indicate "malloc error".
+ * libsigrok functions returns a "malloc error" it must be exactly the same
+ * return value as used by all other functions to indicate "malloc error".
  * There must be no functions which indicate two different errors via the
  * same return code.
  *
@@ -44,7 +44,7 @@
  * or reused for different #defines later. You can only add new #defines and
  * return codes, but never remove or redefine existing ones.
  */
-#define SIGROK_OK                       /* No error */
+#define SIGROK_OK                       0 /* No error */
 #define SIGROK_ERR                     -1 /* Generic/unspecified error */
 #define SIGROK_ERR_MALLOC              -2 /* Malloc/calloc/realloc error */
 #define SIGROK_ERR_SAMPLERATE          -3 /* Incorrect samplerate */
@@ -127,6 +127,8 @@ int filter_probes(int in_unitsize, int out_unitsize, int *probelist,
                  char *data_in, uint64_t length_in, char **data_out,
                  uint64_t *length_out);
 
+char *sigrok_samplerate_string(uint64_t samplerate);
+
 /*--- analyzer.c ------------------------------------------------------------*/
 
 struct analyzer {
@@ -367,7 +369,7 @@ struct session {
 };
 
 /* Session setup */
-struct session *session_load(char *filename);
+struct session *session_load(const char *filename);
 struct session *session_new(void);
 void session_destroy(void);
 void session_device_clear(void);
@@ -392,7 +394,14 @@ int session_save(char *filename);
 
 int ezusb_reset(struct libusb_device_handle *hdl, int set_clear);
 int ezusb_install_firmware(libusb_device_handle *hdl, char *filename);
+int ezusb_upload_firmware(libusb_device *dev, int configuration,
+                          const char *filename);
 
 GSList *list_serial_ports(void);
+int serial_open(const char *pathname, int flags);
+int serial_close(int fd);
+void *serial_backup_params(int fd);
+void serial_restore_params(int fd, void *backup);
+int serial_set_params(int fd, int speed, int bits, int parity, int stopbits, int flowcontrol);
 
 #endif