X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Foutput_gnuplot.c;h=4fd81f2da7092f9564185c325a05ff2d563c603e;hb=e46b8fb154ba90ffec9c1f805399dfa819e736f9;hp=05da1e1aa9fc36e8666d5a7f5782db02880a5e14;hpb=544a458212dc972b663e67cd522ba54cbd8a00de;p=libsigrok.git diff --git a/output/output_gnuplot.c b/output/output_gnuplot.c index 05da1e1a..4fd81f2d 100644 --- a/output/output_gnuplot.c +++ b/output/output_gnuplot.c @@ -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 = {