By annotating structure members and other on-disk structures as little endian, we can catch bugs more easily. The code was already endian safe except for three minor spots: 1) The badblock list code was initializing its key in an endian-unsafe way. 2) Indirect block pointer sequence printing was treating cpu-order values as little endian. 3) reiserfsck was trying to do endian switching on the lost+found key, but it was before it was even initialized to anything, so we can just remove that completely. These issues were fixed as part of this commit. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
36 lines
715 B
C
36 lines
715 B
C
#ifndef _PROGBAR_H_
|
|
#define _PROGBAR_H_
|
|
|
|
#include <time.h>
|
|
#include <stdio.h>
|
|
|
|
enum {
|
|
E2F_FLAG_PROG_SUPPRESS = 1,
|
|
E2F_FLAG_PROG_BAR = 2,
|
|
};
|
|
|
|
struct progbar {
|
|
char units[16];
|
|
int progress_pos;
|
|
int progress_last_percent;
|
|
time_t progress_last_time;
|
|
int flags;
|
|
FILE *file;
|
|
};
|
|
|
|
struct spinner {
|
|
int count;
|
|
FILE *file;
|
|
};
|
|
|
|
void progbar_init(struct progbar *ctx, const char *units, FILE * fp);
|
|
void progbar_clear(struct progbar *ctx);
|
|
int progbar_update(struct progbar *ctx, const char *label, int curr, int max,
|
|
unsigned int dpynum);
|
|
|
|
void spinner_init(struct spinner *spinner, FILE * fp);
|
|
void spinner_touch(struct spinner *spinner);
|
|
void spinner_clear(struct spinner *spinner);
|
|
|
|
#endif /* _PROGBAR_H_ */
|