dosfstools  4.2
About: dosfstools are utilities to create, check and label (MS-DOS) FAT filesystems.
  Fossies Dox: dosfstools-4.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

file.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include "common.h"
#include "file.h"
#include "msdos_fs.h"
#include "charconv.h"
Include dependency graph for file.c:

Go to the source code of this file.

Functions

static void put_char (char **p, unsigned char c, unsigned int out_size)
 
char * file_name (unsigned char *fixed)
 
int file_cvt (unsigned char *name, unsigned char *fixed)
 
void file_add (char *path, FD_TYPE type)
 
FDSC ** file_cd (FDSC **curr, char *fixed)
 
static FDSC ** file_find (FDSC **dir, char *fixed)
 
FD_TYPE file_type (FDSC **curr, char *fixed)
 
void file_modify (FDSC **curr, char *fixed)
 
static void report_unused (FDSC *this)
 
void file_unused (void)
 

Variables

FDSCfp_root = NULL
 

Function Documentation

◆ file_add()

void file_add ( char *  path,
FD_TYPE  type 
)

Definition at line 156 of file file.c.

References alloc(), die(), fdt_none, fdt_undelete, file_cvt(), _fptr::first, fp_root, MSDOS_NAME, _fptr::name, _fptr::next, and _fptr::type.

Referenced by main().

◆ file_cd()

FDSC** file_cd ( FDSC **  curr,
char *  fixed 
)

Definition at line 200 of file file.c.

References _fptr::first, MSDOS_NAME, and _fptr::next.

Referenced by subdirs().

◆ file_cvt()

int file_cvt ( unsigned char *  name,
unsigned char *  fixed 
)

Definition at line 95 of file file.c.

Referenced by file_add(), and rename_file().

◆ file_find()

static FDSC** file_find ( FDSC **  dir,
char *  fixed 
)
static

Definition at line 212 of file file.c.

References DELETED_FLAG, MSDOS_NAME, and _fptr::next.

Referenced by file_modify(), and file_type().

◆ file_modify()

void file_modify ( FDSC **  curr,
char *  fixed 
)

Definition at line 244 of file file.c.

References DELETED_FLAG, die(), fdt_drop, fdt_undelete, file_find(), file_name(), and _fptr::next.

Referenced by add_file().

◆ file_name()

char* file_name ( unsigned char *  fixed)

Construct the "pretty-printed" representation of the name in a short directory entry.

Parameters
[in]fixedPointer to name[0] of a DIR_ENT
Returns
Pointer to static string containing pretty "8.3" equivalent of the name in the directory entry.

Definition at line 63 of file file.c.

References put_char().

Referenced by add_file(), check_dir(), file_modify(), lfn_get(), path_name(), and report_unused().

◆ file_type()

FD_TYPE file_type ( FDSC **  curr,
char *  fixed 
)

Definition at line 235 of file file.c.

References fdt_none, file_find(), and _fptr::type.

Referenced by add_file().

◆ file_unused()

void file_unused ( void  )

Definition at line 283 of file file.c.

References fp_root, and report_unused().

Referenced by main().

◆ put_char()

static void put_char ( char **  p,
unsigned char  c,
unsigned int  out_size 
)
static

Definition at line 41 of file file.c.

References dos_char_to_printable().

Referenced by file_name().

◆ report_unused()

static void report_unused ( FDSC this)
static

Definition at line 267 of file file.c.

References fdt_drop, fdt_none, and file_name().

Referenced by file_unused().

Variable Documentation

◆ fp_root

FDSC* fp_root = NULL

Definition at line 39 of file file.c.

Referenced by file_add(), file_unused(), and scan_root().