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.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <wctype.h>
#include <termios.h>
#include <sys/time.h>
#include <unistd.h>
#include "common.h"
#include "charconv.h"
Include dependency graph for common.c:

Go to the source code of this file.

Data Structures

struct  _link


typedef struct _link LINK


void die (const char *msg,...)
void pdie (const char *msg,...)
void * alloc (int size)
void * qalloc (void **root, int size)
void qfree (void **root)
int min (int a, int b)
static int vasprintf (char **strp, const char *fmt, va_list va)
int xasprintf (char **strp, const char *fmt,...)
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)


int interactive
int write_immed
int atari_format
const char * program_name

Typedef Documentation


typedef struct _link LINK

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()

◆ 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 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,

Definition at line 67 of file common.c.

References program_name.

Referenced by alloc(), fs_close(), fs_read(), fs_test(), fs_write(), main(), and xasprintf().

◆ 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)

◆ vasprintf()

static int vasprintf ( char **  strp,
const char *  fmt,
va_list  va 

Definition at line 120 of file common.c.

Referenced by xasprintf().

◆ xasprintf()

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

Definition at line 141 of file common.c.

References pdie(), and vasprintf().

Referenced by check_file(), and lfn_get().

Variable Documentation

◆ atari_format

int atari_format

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

Definition at line 42 of file common.c.

Referenced by get_choice(), and main().

◆ program_name

const char* program_name

Definition at line 45 of file common.c.

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

◆ write_immed

int write_immed

Definition at line 43 of file common.c.

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