mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-16 10:38:40 -09:00
Remove some calc.c specific defines from ncdu.h
And updated TODO a bit
This commit is contained in:
parent
6d5ae5eb76
commit
05756ad567
3 changed files with 26 additions and 20 deletions
4
TODO
4
TODO
|
|
@ -17,3 +17,7 @@ Small list of planned features/changes, suggestions are always welcome.
|
||||||
* Sort by number of files
|
* Sort by number of files
|
||||||
* Use one key to open up a menu with sort options, instead of
|
* Use one key to open up a menu with sort options, instead of
|
||||||
having a special key for each column
|
having a special key for each column
|
||||||
|
|
||||||
|
- Fix bugs:
|
||||||
|
* Handle hard links
|
||||||
|
* Get rid of PATH_MAX reliance
|
||||||
|
|
|
||||||
21
src/calc.c
21
src/calc.c
|
|
@ -40,6 +40,27 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* set S_BLKSIZE if not defined already in sys/stat.h */
|
||||||
|
#ifndef S_BLKSIZE
|
||||||
|
# define S_BLKSIZE 512
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LINK_MAX
|
||||||
|
# ifdef _POSIX_LINK_MAX
|
||||||
|
# define LINK_MAX _POSIX_LINK_MAX
|
||||||
|
# else
|
||||||
|
# define LINK_MAX 32
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef S_ISLNK
|
||||||
|
# ifndef S_IFLNK
|
||||||
|
# define S_IFLNK 0120000
|
||||||
|
# endif
|
||||||
|
# define S_ISLNK(x) (x & S_IFLNK)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char err; /* 1/0, error or not */
|
char err; /* 1/0, error or not */
|
||||||
char cur[PATH_MAX]; /* current dir/item */
|
char cur[PATH_MAX]; /* current dir/item */
|
||||||
|
|
|
||||||
21
src/ncdu.h
21
src/ncdu.h
|
|
@ -29,11 +29,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <limits.h>
|
||||||
/* set S_BLKSIZE if not defined already in sys/stat.h */
|
|
||||||
#ifndef S_BLKSIZE
|
|
||||||
# define S_BLKSIZE 512
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* PATH_MAX 260 on Cygwin is too small for /proc/registry */
|
/* PATH_MAX 260 on Cygwin is too small for /proc/registry */
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
|
|
@ -51,21 +47,6 @@
|
||||||
# define PATH_MAX 4096
|
# define PATH_MAX 4096
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
/* and LINK_MAX */
|
|
||||||
#ifndef LINK_MAX
|
|
||||||
# ifdef _POSIX_LINK_MAX
|
|
||||||
# define LINK_MAX _POSIX_LINK_MAX
|
|
||||||
# else
|
|
||||||
# define LINK_MAX 32
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
/* check for S_ISLNK */
|
|
||||||
#ifndef S_ISLNK
|
|
||||||
# ifndef S_IFLNK
|
|
||||||
# define S_IFLNK 0120000
|
|
||||||
# endif
|
|
||||||
# define S_ISLNK(x) (x & S_IFLNK)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* File Flags (struct dir -> flags) */
|
/* File Flags (struct dir -> flags) */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue