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)  

common.h File Reference
#include <sys/types.h>
#include <limits.h>
#include <stdint.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OFF_MAX   (off_t)((1ULL << (sizeof(off_t) * CHAR_BIT - 1)) - 1)
 

Functions

void die (const char *msg,...) __attribute((noreturn
 
void format (printf, 1, 2)))
 
void pdie (const char *msg,...) __attribute((noreturn
 
void * alloc (int size)
 
void * qalloc (void **root, int size)
 
void qfree (void **root)
 
int min (int a, int b)
 
int xasprintf (char **strp, const char *fmt,...) __attribute((format(printf
 
int int get_choice (int noninteractive_result, const char *noninteractive_msg, int choices,...)
 
char * get_line (const char *prompt, char *dest, size_t length)
 
void check_atari (void)
 
uint32_t generate_volume_id (void)
 
int validate_volume_label (char *doslabel)
 

Variables

int interactive
 
int write_immed
 
int atari_format
 
const char * program_name
 

Macro Definition Documentation

◆ OFF_MAX

#define OFF_MAX   (off_t)((1ULL << (sizeof(off_t) * CHAR_BIT - 1)) - 1)

Definition at line 32 of file common.h.

Function Documentation

◆ alloc()

void* alloc ( int  size)

◆ check_atari()

void check_atari ( void  )

Definition at line 273 of file common.c.

References atari_format.

Referenced by main().

◆ die()

void die ( const char *  msg,
  ... 
)

◆ format()

void format ( printf  ,
,
 
)

◆ generate_volume_id()

uint32_t generate_volume_id ( void  )

Definition at line 298 of file common.c.

Referenced by handle_volid(), main(), and setup_tables().

◆ get_choice()

int int get_choice ( int  noninteractive_result,
const char *  noninteractive_msg,
int  choices,
  ... 
)

◆ get_line()

char* get_line ( const char *  prompt,
char *  dest,
size_t  length 
)

Definition at line 245 of file common.c.

Referenced by get_new_label(), and rename_file().

◆ min()

int min ( int  a,
int  b 
)

Definition at line 113 of file common.c.

Referenced by fs_read().

◆ pdie()

void pdie ( const char *  msg,
  ... 
)

◆ qalloc()

void* qalloc ( void **  root,
int  size 
)

Definition at line 91 of file common.c.

References alloc(), _link::data, _link::next, and root.

Referenced by add_file(), and cnv_unicode().

◆ qfree()

void qfree ( void **  root)

Definition at line 101 of file common.c.

References _link::data, _link::next, and root.

Referenced by main().

◆ validate_volume_label()

int validate_volume_label ( char *  doslabel)

◆ xasprintf()

int xasprintf ( char **  strp,
const char *  fmt,
  ... 
)

Variable Documentation

◆ atari_format

int atari_format
extern

Definition at line 44 of file common.c.

Referenced by bad_name(), check_atari(), dump_boot(), establish_params(), main(), read_boot(), and setup_tables().

◆ interactive

int interactive
extern

Definition at line 42 of file common.c.

Referenced by get_choice(), and main().

◆ program_name

const char* program_name
extern

Definition at line 45 of file common.c.

Referenced by die(), main(), and pdie().

◆ write_immed

int write_immed
extern

Definition at line 43 of file common.c.

Referenced by fs_write(), get_choice(), and main().