]> sigrok.org Git - libsigrok.git/blobdiff - filter.c
Add sr_ prefix to filter_probes().
[libsigrok.git] / filter.c
index d51471b285e2841dc34223702839e328767c445f..208a723c7ba152c29eecc6b969a97c7669f0565d 100644 (file)
--- a/filter.c
+++ b/filter.c
  * it -- to a sample taking up only as much space as required, with
  * unused probes removed.
  */
-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)
+int sr_filter_probes(int in_unitsize, int out_unitsize, int *probelist,
+                    const char *data_in, uint64_t length_in, char **data_out,
+                    uint64_t *length_out)
 {
        unsigned int in_offset, out_offset;
        int num_enabled_probes, out_bit, i;
        uint64_t sample_in, sample_out;
 
        if (!(*data_out = malloc(length_in)))
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
 
        num_enabled_probes = 0;
        for (i = 0; probelist[i]; i++)
@@ -46,7 +46,7 @@ int filter_probes(int in_unitsize, int out_unitsize, int *probelist,
                /* All probes are used -- no need to compress anything. */
                memcpy(*data_out, data_in, length_in);
                *length_out = length_in;
-               return SIGROK_OK;
+               return SR_OK;
        }
 
        /* If we reached this point, not all probes are used, so "compress". */
@@ -65,5 +65,5 @@ int filter_probes(int in_unitsize, int out_unitsize, int *probelist,
        }
        *length_out = out_offset;
 
-       return SIGROK_OK;
+       return SR_OK;
 }