mdir.c File Reference

#include "sysincludes.h"
#include "msdos.h"
#include "vfat.h"
#include "mtools.h"
#include "file.h"
#include "mainloop.h"
#include "fs.h"
#include "codepage.h"

Include dependency graph for mdir.c:

Go to the source code of this file.

Functions

static void print_date (struct directory *dir)
static void print_time (struct directory *dir)
static const char * dotted_num (mt_size_t num, int width, char **buf)
static int print_volume_label (Stream_t *Dir, char *drive)
static void printSummary (int files, mt_size_t bytes)
static void leaveDirectory (int haveError)
static void leaveDrive (int haveError)
static int enterDrive (Stream_t *Dir, char *drive)
static int enterDirectory (Stream_t *Dir)
static int list_file (direntry_t *entry, MainParam_t *mp)
static int list_non_recurs_directory (direntry_t *entry, MainParam_t *mp)
static int list_recurs_directory (direntry_t *entry, MainParam_t *mp)
static void usage (void)
void mdir (int argc, char **argv, int type)

Variables

static int recursive
static int wide
static int all
static int concise
static int fast = 0
static char * dirPath
static char * currentDrive
static Stream_tcurrentDir
static int filesInDir
static int filesOnDrive
static int dirsOnDrive
static int debug = 0
static mt_size_t bytesInDir
static mt_size_t bytesOnDrive
static Stream_tRootDir
static char shortname [13]
static char longname [VBUFSIZE]
static char * emptyString = "<out-of-memory>"


Function Documentation

static const char* dotted_num mt_size_t  num,
int  width,
char **  buf
[static]
 

Definition at line 106 of file mdir.c.

References fprintf(), isdigit, malloc(), NULL, size, sprintf(), stderr, and strlen().

Referenced by leaveDrive(), and printSummary().

static int enterDirectory Stream_t Dir  )  [static]
 

Definition at line 297 of file mdir.c.

References bytesInDir, concise, COPY, currentDir, dirPath, dirsOnDrive, drive, enterDrive(), filesInDir, getDirentry(), getDrive(), getPwd(), leaveDirectory(), NULL, printf, r, slash(), strrchr(), and wide.

Referenced by list_file(), and list_non_recurs_directory().

static int enterDrive Stream_t Dir,
char *  drive
[static]
 

Definition at line 258 of file mdir.c.

References bytesOnDrive, currentDrive, dirsOnDrive, filesOnDrive, leaveDrive(), NULL, print_volume_label(), r, and strcmp.

Referenced by enterDirectory().

static void leaveDirectory int  haveError  )  [static]
 

Definition at line 280 of file mdir.c.

References bytesInDir, concise, currentDir, dirPath, filesInDir, FREE, free, printSummary(), putchar, and wide.

Referenced by enterDirectory(), leaveDrive(), and mdir().

static void leaveDrive int  haveError  )  [static]
 

Definition at line 227 of file mdir.c.

References bytes, bytesOnDrive, concise, currentDrive, dirsOnDrive, dotted_num(), fast, filesOnDrive, FREE, free, getfree(), GetFs(), leaveDirectory(), NULL, printf, printSummary(), and RootDir.

Referenced by enterDrive(), and mdir().

static int list_file direntry_t entry,
MainParam_t mp
[static]
 

Definition at line 334 of file mdir.c.

References all, BASECASE, bytesInDir, bytesOnDrive, concise, debug, entry::dir, dirPath, enterDirectory(), entry, ERROR_ONE, EXTCASE, FILE_SIZE, filesInDir, filesOnDrive, GOT_ONE, i, IS_DIR, isSpecial(), longname, mtools_dotted_dir, mtools_ignore_short_case, entry::name, print_date(), print_time(), printf, putchar, r, shortname, size, START, strlen(), to_unix(), tolower, and wide.

Referenced by list_non_recurs_directory(), list_recurs_directory(), and mdir().

static int list_non_recurs_directory direntry_t entry,
MainParam_t mp
[static]
 

Definition at line 421 of file mdir.c.

References MainParam_t::callback, MainParam_t::dirCallback, enterDirectory(), entry, ERROR_ONE, GOT_ONE, list_file(), mp, and r.

Referenced by mdir().

static int list_recurs_directory direntry_t entry,
MainParam_t mp
[static]
 

Definition at line 445 of file mdir.c.

References ACCEPT_DIR, ACCEPT_PLAIN, MainParam_t::callback, MainParam_t::dirCallback, DO_OPEN, list_file(), MainParam_t::lookupflags, mp, NO_DOTS, and NO_MSG.

Referenced by mdir().

void mdir int  argc,
char **  argv,
int  type
 

Definition at line 501 of file mdir.c.

References ACCEPT_DIR, ACCEPT_PLAIN, all, c, concise, currentDir, currentDrive, debug, dirPath, DO_OPEN_DIRS, EOF, exit(), fast, getopt(), init_mp(), leaveDirectory(), leaveDrive(), list_file(), list_non_recurs_directory(), list_recurs_directory(), longname, main_loop(), mp, NO_DOTS, optind, recursive, RootDir, shortname, usage, and wide.

Referenced by do_mount().

static void print_date struct directory dir  )  [inline, static]
 

Definition at line 50 of file mdir.c.

References day, dir, DOS_DAY, DOS_MONTH, DOS_YEAR, month, mtools_date_string, p, printf, sprintf(), and strncasecmp().

Referenced by iso_info(), and list_file().

static void print_time struct directory dir  )  [inline, static]
 

Definition at line 86 of file mdir.c.

References dir, DOS_HOUR, DOS_MINUTE, mtools_twenty_four_hour_clock, and printf.

Referenced by list_file(), main(), and out_header().

static int print_volume_label Stream_t Dir,
char *  drive
[inline, static]
 

Definition at line 170 of file mdir.c.

References ACCEPT_LABEL, concise, DeclareThis, entry, GetFs(), initializeDirentry(), longname, MATCH_ANY, OpenRoot(), printf, r, RootDir, shortname, VBUFSIZE, and vfat_lookup().

Referenced by enterDrive().

static void printSummary int  files,
mt_size_t  bytes
[static]
 

Definition at line 207 of file mdir.c.

References dotted_num(), filesInDir, free, printf, and putchar.

Referenced by leaveDirectory(), and leaveDrive().

static void usage void   )  [static]
 

Definition at line 481 of file mdir.c.

References exit(), fprintf(), mdate, mversion, progname, and stderr.


Variable Documentation

int all [static]
 

Definition at line 21 of file mdir.c.

Referenced by list_file(), main(), mdir(), and report().

mt_size_t bytesInDir [static]
 

Definition at line 38 of file mdir.c.

Referenced by enterDirectory(), leaveDirectory(), and list_file().

mt_size_t bytesOnDrive [static]
 

Definition at line 39 of file mdir.c.

Referenced by enterDrive(), leaveDrive(), and list_file().

int concise [static]
 

Definition at line 22 of file mdir.c.

Stream_t* currentDir [static]
 

Definition at line 29 of file mdir.c.

Referenced by enterDirectory(), leaveDirectory(), and mdir().

char* currentDrive [static]
 

Definition at line 28 of file mdir.c.

Referenced by enterDrive(), leaveDrive(), and mdir().

int debug = 0 [static]
 

Definition at line 36 of file mdir.c.

char* dirPath [static]
 

Definition at line 27 of file mdir.c.

Referenced by enterDirectory(), leaveDirectory(), list_file(), and mdir().

int dirsOnDrive [static]
 

Definition at line 34 of file mdir.c.

Referenced by enterDirectory(), enterDrive(), and leaveDrive().

char* emptyString = "<out-of-memory>" [static]
 

Definition at line 278 of file mdir.c.

int fast = 0 [static]
 

Definition at line 23 of file mdir.c.

Referenced by leaveDrive(), main(), matcher(), and mdir().

int filesInDir [static]
 

Definition at line 31 of file mdir.c.

Referenced by enterDirectory(), leaveDirectory(), list_file(), and printSummary().

int filesOnDrive [static]
 

Definition at line 32 of file mdir.c.

Referenced by enterDrive(), leaveDrive(), and list_file().

char longname[VBUFSIZE] [static]
 

Definition at line 44 of file mdir.c.

Referenced by _mwrite_one(), list_file(), mdir(), mlabel(), mmove(), print_volume_label(), rename_file(), rename_oldsyntax(), res_querydomain(), and vfat_lookup_loop_common().

int recursive [static]
 

Definition at line 19 of file mdir.c.

Referenced by mdir().

Stream_t* RootDir [static]
 

Definition at line 40 of file mdir.c.

Referenced by common_dos_loop(), format_root(), leaveDrive(), mdir(), mlabel(), and print_volume_label().

char shortname[13] [static]
 

Definition at line 43 of file mdir.c.

Referenced by ask_rename(), del_file(), list_file(), mdir(), mlabel(), mmove(), mwrite_one(), print_volume_label(), rename_file(), and rename_oldsyntax().

int wide [static]
 

Definition at line 20 of file mdir.c.

Referenced by enterDirectory(), leaveDirectory(), list_file(), main(), mdir(), and shortprint().


Generated on Fri Apr 14 23:04:11 2006 for minix by  doxygen 1.4.6