Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
ca110833
Commit
ca110833
authored
16 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Moved minimum screen size handling to main.c
And with that, finally managed to get rid of sflags in ncdu.h
parent
b24c3dee
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.c
+6
-6
6 additions, 6 deletions
src/main.c
src/ncdu.h
+0
-8
0 additions, 8 deletions
src/ncdu.h
with
6 additions
and
14 deletions
src/main.c
+
6
−
6
View file @
ca110833
...
@@ -35,9 +35,10 @@
...
@@ -35,9 +35,10 @@
#include
<unistd.h>
#include
<unistd.h>
int
sflags
;
int
pstate
;
int
pstate
;
int
min_rows
=
17
,
min_cols
=
60
;
void
screen_draw
()
{
void
screen_draw
()
{
int
n
=
1
;
int
n
=
1
;
...
@@ -57,8 +58,8 @@ int input_handle(int wait) {
...
@@ -57,8 +58,8 @@ int input_handle(int wait) {
screen_draw
();
screen_draw
();
while
((
ch
=
getch
())
!=
ERR
)
{
while
((
ch
=
getch
())
!=
ERR
)
{
if
(
ch
==
KEY_RESIZE
)
{
if
(
ch
==
KEY_RESIZE
)
{
if
(
ncresize
(
(
sflags
&
SF_IGNS
?
0
:
17
),
(
sflags
*
SF_IGNS
?
0
:
60
)
))
if
(
ncresize
(
min_rows
,
min_cols
))
sflag
s
|
=
SF_IGNS
;
min_rows
=
min_col
s
=
0
;
screen_draw
();
screen_draw
();
continue
;
continue
;
}
}
...
@@ -79,7 +80,6 @@ void argv_parse(int argc, char **argv, char *dir) {
...
@@ -79,7 +80,6 @@ void argv_parse(int argc, char **argv, char *dir) {
/* load defaults */
/* load defaults */
memset
(
dir
,
0
,
PATH_MAX
);
memset
(
dir
,
0
,
PATH_MAX
);
getcwd
(
dir
,
PATH_MAX
);
getcwd
(
dir
,
PATH_MAX
);
sflags
=
0
;
calc_delay
=
100
;
calc_delay
=
100
;
calc_smfs
=
0
;
calc_smfs
=
0
;
...
@@ -150,8 +150,8 @@ int main(int argc, char **argv) {
...
@@ -150,8 +150,8 @@ int main(int argc, char **argv) {
noecho
();
noecho
();
curs_set
(
0
);
curs_set
(
0
);
keypad
(
stdscr
,
TRUE
);
keypad
(
stdscr
,
TRUE
);
if
(
ncresize
(
(
sflags
&
SF_IGNS
?
0
:
17
),
(
sflags
*
SF_IGNS
?
0
:
60
)
))
if
(
ncresize
(
min_rows
,
min_cols
))
sflag
s
|
=
SF_IGNS
;
min_rows
=
min_col
s
=
0
;
while
(
pstate
!=
ST_QUIT
)
{
while
(
pstate
!=
ST_QUIT
)
{
if
(
pstate
==
ST_CALC
)
if
(
pstate
==
ST_CALC
)
...
...
This diff is collapsed.
Click to expand it.
src/ncdu.h
+
0
−
8
View file @
ca110833
...
@@ -58,11 +58,6 @@
...
@@ -58,11 +58,6 @@
#define FF_SERR 0x20
/* error in subdirectory */
#define FF_SERR 0x20
/* error in subdirectory */
#define FF_BSEL 0x40
/* selected */
#define FF_BSEL 0x40
/* selected */
/* Settings Flags (int sflags) */
#define SF_IGNS 0x04
/* ignore too small terminal sizes */
#define SF_NOCFM 0x08
/* don't confirm file deletion */
#define SF_IGNE 0x10
/* ignore errors when deleting */
/* Program states */
/* Program states */
#define ST_CALC 0
#define ST_CALC 0
#define ST_BROWSE 1
#define ST_BROWSE 1
...
@@ -80,9 +75,6 @@ struct dir {
...
@@ -80,9 +75,6 @@ struct dir {
unsigned
char
flags
;
unsigned
char
flags
;
};
};
/* global settings */
extern
int
sflags
;
/* program state */
/* program state */
extern
int
pstate
;
extern
int
pstate
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment