Skip to content
Snippets Groups Projects
Commit 2a25bfdc authored by Yorhel's avatar Yorhel
Browse files

Moved and renamed sdelay in ncdu.h to calc_delay in calc.h

Because that's where it's supposed to be.
(geez, the current code is still a mess)
parent 05756ad5
No related branches found
No related tags found
Loading
......@@ -61,6 +61,8 @@
#endif
int calc_delay;
struct {
char err; /* 1/0, error or not */
char cur[PATH_MAX]; /* current dir/item */
......@@ -336,7 +338,7 @@ void calc_draw_progress() {
}
/* animation - but only if the screen refreshes more than or once every second */
if(sdelay <= 1000) {
if(calc_delay <= 1000) {
if(++stcalc.anpos == 28)
stcalc.anpos = 0;
strcpy(ani, " ");
......@@ -375,7 +377,7 @@ int calc_draw() {
/* should we really draw the screen again? */
gettimeofday(&tv, (void *)NULL);
tv.tv_usec = (1000*(tv.tv_sec % 1000) + (tv.tv_usec / 1000)) / sdelay;
tv.tv_usec = (1000*(tv.tv_sec % 1000) + (tv.tv_usec / 1000)) / calc_delay;
if(stcalc.lastupdate != tv.tv_usec) {
calc_draw_progress();
stcalc.lastupdate = tv.tv_usec;
......
......@@ -28,6 +28,8 @@
#include "ncdu.h"
extern int calc_delay; /* minimum screen update interval when calculating, in ms */
void calc_process(void);
int calc_key(int);
int calc_draw(void);
......
......@@ -35,7 +35,7 @@
#include <unistd.h>
int sflags, sdelay;
int sflags;
int pstate;
......@@ -80,7 +80,7 @@ void argv_parse(int argc, char **argv, char *dir) {
memset(dir, 0, PATH_MAX);
getcwd(dir, PATH_MAX);
sflags = 0;
sdelay = 100;
calc_delay = 100;
/* read from commandline */
for(i=1; i<argc; i++) {
......@@ -105,7 +105,7 @@ void argv_parse(int argc, char **argv, char *dir) {
for(j=1; j<len; j++)
switch(argv[i][j]) {
case 'x': sflags |= SF_SMFS; break;
case 'q': sdelay = 2000; break;
case 'q': calc_delay = 2000; break;
case '?':
case 'h':
printf("ncdu [-hqvx] [--exclude PATTERN] [-X FILE] directory\n\n");
......
......@@ -83,7 +83,7 @@ struct dir {
};
/* global settings */
extern int sflags, sdelay;
extern int sflags;
/* program state */
extern int pstate;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment