]> sigrok.org Git - libsigrok.git/blobdiff - output/output_gnuplot.c
Change SIGROK_ prefix to SR_.
[libsigrok.git] / output / output_gnuplot.c
index 05da1e1aa9fc36e8666d5a7f5782db02880a5e14..4fd81f2da7092f9564185c325a05ff2d563c603e 100644 (file)
@@ -59,11 +59,11 @@ static int init(struct output *o)
        time_t t;
 
        if (!(ctx = calloc(1, sizeof(struct context))))
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
 
        if (!(ctx->header = calloc(1, MAX_HEADER_LEN + 1))) {
                free(ctx);
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
        }
 
        o->internal = ctx;
@@ -85,7 +85,7 @@ static int init(struct output *o)
                if (!(frequency_s = sigrok_samplerate_string(samplerate))) {
                        free(ctx->header);
                        free(ctx);
-                       return SIGROK_ERR;
+                       return SR_ERR;
                }
                snprintf(comment, 127, gnuplot_header_comment,
                        ctx->num_enabled_probes, num_probes, frequency_s);
@@ -102,7 +102,7 @@ static int init(struct output *o)
        if (!(frequency_s = sigrok_period_string(samplerate))) {
                free(ctx->header);
                free(ctx);
-               return SIGROK_ERR;
+               return SR_ERR;
        }
        t = time(NULL);
        b = snprintf(ctx->header, MAX_HEADER_LEN, gnuplot_header,
@@ -113,7 +113,7 @@ static int init(struct output *o)
        if (b < 0) {
                free(ctx->header);
                free(ctx);
-               return SIGROK_ERR;
+               return SR_ERR;
        }
 
        return 0;
@@ -138,7 +138,7 @@ static int event(struct output *o, int event_type, char **data_out,
        *data_out = NULL;
        *length_out = 0;
 
-       return SIGROK_OK;
+       return SR_OK;
 }
 
 static int data(struct output *o, char *data_in, uint64_t length_in,
@@ -157,7 +157,7 @@ static int data(struct output *o, char *data_in, uint64_t length_in,
                outsize += strlen(ctx->header);
 
        if (!(outbuf = calloc(1, outsize)))
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
 
        outbuf[0] = '\0';
        if (ctx->header) {
@@ -188,7 +188,7 @@ static int data(struct output *o, char *data_in, uint64_t length_in,
        *data_out = outbuf;
        *length_out = strlen(outbuf);
 
-       return SIGROK_OK;
+       return SR_OK;
 }
 
 static int analog_init(struct output *o)
@@ -204,11 +204,11 @@ static int analog_init(struct output *o)
        time_t t;
 
        if (!(ctx = calloc(1, sizeof(struct context))))
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
 
        if (!(ctx->header = calloc(1, MAX_HEADER_LEN + 1))) {
                free(ctx);
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
        }
 
        o->internal = ctx;
@@ -232,7 +232,7 @@ static int analog_init(struct output *o)
                if (!(frequency_s = sigrok_samplerate_string(samplerate))) {
                        free(ctx->header);
                        free(ctx);
-                       return SIGROK_ERR;
+                       return SR_ERR;
                }
                snprintf(comment, 127, gnuplot_header_comment,
                        ctx->num_enabled_probes, num_probes, frequency_s);
@@ -249,7 +249,7 @@ static int analog_init(struct output *o)
        if (!(frequency_s = sigrok_period_string(samplerate))) {
                free(ctx->header);
                free(ctx);
-               return SIGROK_ERR;
+               return SR_ERR;
        }
        t = time(NULL);
        b = snprintf(ctx->header, MAX_HEADER_LEN, gnuplot_header,
@@ -260,7 +260,7 @@ static int analog_init(struct output *o)
        if (b < 0) {
                free(ctx->header);
                free(ctx);
-               return SIGROK_ERR;
+               return SR_ERR;
        }
 
        return 0;
@@ -284,7 +284,7 @@ static int analog_data(struct output *o, char *data_in, uint64_t length_in,
                outsize += strlen(ctx->header);
 
        if (!(outbuf = calloc(1, outsize)))
-               return SIGROK_ERR_MALLOC;
+               return SR_ERR_MALLOC;
 
        outbuf[0] = '\0';
        if (ctx->header) {
@@ -323,7 +323,7 @@ static int analog_data(struct output *o, char *data_in, uint64_t length_in,
        *data_out = outbuf;
        *length_out = strlen(outbuf);
 
-       return SIGROK_OK;
+       return SR_OK;
 }
 
 struct output_format output_gnuplot = {