Logo Search packages:      
Sourcecode: cafix version File versions  Download package

status.c

#include "custom.h"
int show_status(cafixdata *data)
{
//    printf("\rWhatever %i, status = %i", data->transmitted, data->status);
    int foo, i;

    if (data->status == STAT_SENDING_HDR || data->status == STAT_RECEIVING_HDR) {
      foo = data->hlength;
//        printf("%s", data->hlength);
      return 0; }
    else
      foo = data->length;

    if (foo < 1)
      foo = 1;

    printf("\r[");
    for (i = 0; i < (data->transmitted * 30) / foo; i++)
       printf("=");
    for (i = 0; i < 30 - ((data->transmitted * 30) / foo); i++)
       printf(" ");
    printf("]\t");
    printf("(%i:%i/%i) (%i%%)  ", data->status, data->transmitted, foo, (data->transmitted * 100) / foo);

    if (data->status == STAT_OVERWRITE)
      return 1;         // overwrite

    fflush(stdout);
    return 0;
}

Generated by  Doxygen 1.6.0   Back to index