#include "sysincludes.h"#include "mtools.h"#include "codepage.h"#include "mtoolsPaths.h"Include dependency graph for config.c:

Go to the source code of this file.
Data Structures | |
| struct | switches_l |
| struct | flags_t |
Defines | |
| #define | MAX_LINE_LEN 256 |
| #define | OFFS(x) ((caddr_t)&((struct device *)0)->x) |
Typedefs | |
| typedef switches_l | switches_t |
Functions | |
| static void | syntax (const char *msg, int thisLine) |
| static void | get_env_conf (void) |
| static int | mtools_getline (void) |
| static void | skip_junk (int expect) |
| static char * | get_next_token (void) |
| static int | match_token (const char *template) |
| static void | expect_char (char c) |
| static char * | get_string (void) |
| static unsigned int | get_unumber (void) |
| static unsigned int | get_number (void) |
| static void | purge (char drive, int fn) |
| static void | grow (void) |
| static void | init_drive (void) |
| static void | prepend (void) |
| static void | append (void) |
| static void | finish_drive_clause (void) |
| static int | set_var (struct switches_l *switches, int nr, caddr_t base_address) |
| static int | set_openflags (struct device *dev) |
| static int | set_misc_flags (struct device *dev) |
| static int | set_def_format (struct device *dev) |
| static void | get_codepage (void) |
| static void | get_toupper (void) |
| static void | parse_old_device_line (char drive) |
| static int | parse_one (int privilege) |
| static int | parse (const char *name, int privilege) |
| void | read_config (void) |
| void | mtoolstest (int argc, char **argv, int type) |
Variables | |
| static char | buffer [MAX_LINE_LEN+1] |
| static char * | pos |
| static char * | token |
| static int | token_length |
| static FILE * | fp |
| static int | linenumber |
| static int | lastTokenLinenumber |
| static const char * | filename |
| static int | file_nr = 0 |
| static int | flag_mask |
| static int | cur_devs |
| static int | cur_dev |
| static int | trusted = 0 |
| static int | nr_dev |
| static int | token_nr |
| static char | letters [][2] |
| device * | devices |
| unsigned int | mtools_skip_check = 0 |
| unsigned int | mtools_fat_compatibility = 0 |
| unsigned int | mtools_ignore_short_case = 0 |
| unsigned int | mtools_rate_0 = 0 |
| unsigned int | mtools_rate_any = 0 |
| unsigned int | mtools_no_vfat = 0 |
| unsigned int | mtools_numeric_tail = 1 |
| unsigned int | mtools_dotted_dir = 0 |
| unsigned int | mtools_twenty_four_hour_clock = 1 |
| char * | mtools_date_string = "mm-dd-yyyy" |
| char * | country_string = 0 |
| static switches_t | switches [] |
| static flags_t | openflags [] |
| static flags_t | misc_flags [] |
| struct { | |
| char * f_name | |
| FILE * f_fp | |
| int f_type | |
| char * word | |
| int type | |
| int val | |
| char * name | |
| CMD code | |
| void(* fn )() | |
| ARGT argt | |
| char * name | |
| char * nm | |
| char type | |
| char flags | |
| char * value | |
| const char * name | |
| signed char fat_bits | |
| int tracks | |
| unsigned short heads | |
| unsigned short sectors | |
| device_t * dev | |
| int nr_partitions | |
| int free_regions | |
| int used_regions | |
| int sectors | |
| int nr_regions | |
| int biosdrive | |
| region_t regions [NR_REGIONS] | |
| int this_month | |
| int feb | |
| int sept | |
| int days_in_month | |
| int dow_first | |
| int o_file | |
| int o_field | |
| WINDOW * win | |
| char erase | |
| char kill | |
| char werase | |
| unsigned baudr | |
| int speedcode | |
| u16_t vendor | |
| u16_t device | |
| } | default_formats [] |
| static switches_t | dswitches [] |
|
|
Definition at line 12 of file config.c. Referenced by mtools_getline(). |
|
|
|
|
|
|
|
|
Definition at line 353 of file config.c. References cur_dev, cur_devs, grow(), and init_drive(). |
|
|
Definition at line 247 of file config.c. References pos, skip_junk(), sprintf(), and syntax. Referenced by parse_one(), and set_var(). |
|
|
Definition at line 362 of file config.c. References cur_dev, devices, drive, file_nr, filename, FILTER_FLAG, flag_mask, fprintf(), heads, IS_SCSI, MFORMAT_ONLY_FLAG, misc_flags, PRIV_FLAG, sectors, stderr, syntax, tracks, and trusted. Referenced by parse(), parse_old_device_line(), and parse_one(). |
|
|
Definition at line 480 of file config.c. References Codepage, get_number(), i, n, New, and Codepage_l::tounix. Referenced by parse_one(). |
|
|
Definition at line 178 of file config.c. References address(), getenv(), i, s, strtol(), strtoul(), switches, T_INT, and type. Referenced by read_config(). |
|
|
Definition at line 227 of file config.c. References pos, skip_junk(), strcspn(), and token_length. Referenced by parse_one(). |
|
|
Definition at line 290 of file config.c. References int(), n, pos, skip_junk(), strtol(), syntax, and token_nr. |
|
|
Definition at line 259 of file config.c. References pos, skip_junk(), strchr, and syntax. |
|
|
Definition at line 495 of file config.c. References get_number(), i, mstoupper, and safe_malloc(). Referenced by parse_one(). |
|
|
Definition at line 275 of file config.c. References int(), n, pos, skip_junk(), strtoul(), syntax, and token_nr. Referenced by set_var(). |
|
|
Definition at line 320 of file config.c. References cur_devs, devices, exit(), Grow, nr_dev, and printOom(). |
|
|
Definition at line 332 of file config.c. References cur_dev, devices, and memset(). Referenced by append(), init_params(), and prepend(). |
|
|
Definition at line 241 of file config.c. References strlen(), strncasecmp(), and token_length. Referenced by parse_one(), set_def_format(), set_misc_flags(), set_openflags(), and set_var(). |
|
|
Definition at line 196 of file config.c. References fgets(), fp, linenumber, MAX_LINE_LEN, pos, strlen(), syntax, and token_nr. Referenced by skip_junk(). |
|
||||||||||||||||
|
Definition at line 698 of file config.c. References device::cfg_filename, dev, devices, drive, device::drive, device::fat_bits, device::file_nr, get_drive(), device::heads, device::hidden, i, IS_MFORMAT_ONLY, IS_PRIVILEGED, IS_SCSI, j, device::misc_flags, device::mode, device::name, NULL, O_EXCL, device::offset, device::partition, path, device::precmd, printf, device::sectors, SHOULD_USE_VOLD, SHOULD_USE_XDF, skip_drive(), strcmp, and device::tracks. |
|
||||||||||||
|
Definition at line 631 of file config.c. References cur_dev, fclose(), file_nr, filename, finish_drive_clause(), fopen(), fp, lastTokenLinenumber, linenumber, parse_one(), pos, and strdup(). |
|
|
Definition at line 505 of file config.c. References append(), cur_dev, devices, exit(), fat_bits, file_nr, finish_drive_clause(), heads, letters, MAXPATHLEN, offset, pos, printOom(), purge(), sectors, sscanf(), strdup(), syntax, toupper, and tracks. Referenced by parse_one(). |
|
|
Definition at line 560 of file config.c. References append(), Codepage, cur_dev, devices, dswitches, expect_char(), file_nr, finish_drive_clause(), flag_mask, Free, free, get_codepage(), get_next_token(), get_toupper(), letters, match_token(), memset(), mstoupper, parse_old_device_line(), prepend(), purge(), set_def_format(), set_misc_flags(), set_openflags(), set_var(), switches, syntax, token_length, token_nr, toupper, and trusted. Referenced by parse(). |
|
|
Definition at line 339 of file config.c. References cur_dev, cur_devs, devices, grow(), i, and init_drive(). Referenced by parse_one(). |
|
||||||||||||
|
Definition at line 306 of file config.c. References cur_devs, devices, file_nr, i, j, and toupper. Referenced by parse_old_device_line(), and parse_one(). |
|
|
Definition at line 650 of file config.c. References CFG_FILE1, CONF_FILE, const_devices, cur_devs, devices, exit(), file_nr, get_env_conf(), get_homedir(), getenv(), homedir, init_codepage(), LOCAL_CONF_FILE, MAXPATHLEN, memcpy(), memset(), mtools_fat_compatibility, mtools_skip_check, NewArray, nr_const_devices, nr_dev, OLD_CONF_FILE, OLD_LOCAL_CONF_FILE, parse(), printOom(), strcat(), strncpy(), and SYS_CONF_FILE. Referenced by main(). |
|
|
Definition at line 458 of file config.c. References default_formats, dev, device::fat_bits, device::heads, i, match_token(), device::sectors, device::ssize, and device::tracks. Referenced by parse_one(). |
|
|
Definition at line 432 of file config.c. References dev, flag, flag_mask, get_number(), i, match_token(), device::misc_flags, misc_flags, pos, skip_junk(), and syntax. Referenced by parse_one(). |
|
|
Definition at line 419 of file config.c. References dev, i, match_token(), device::mode, and openflags. Referenced by parse_one(). |
|
||||||||||||||||
|
Definition at line 397 of file config.c. References address(), expect_char(), get_number(), get_string, get_unumber(), i, match_token(), strdup(), switches, T_INT, T_STRING, and type. Referenced by parse_one(). |
|
|
Definition at line 209 of file config.c. References lastTokenLinenumber, linenumber, mtools_getline(), pos, strchr, syntax, and token_nr. Referenced by expect_char(), get_next_token(), get_number(), get_string(), get_unumber(), and set_misc_flags(). |
|
||||||||||||
|
Definition at line 164 of file config.c. References cur_dev, devices, drive, exit(), filename, fprintf(), lastTokenLinenumber, linenumber, NULL, and stderr. |
|
|
|
|
|
|
|
|
Definition at line 32 of file config.c. Referenced by append(), finish_drive_clause(), init_drive(), parse(), parse_old_device_line(), parse_one(), prepend(), and syntax(). |
|
|
Definition at line 31 of file config.c. Referenced by append(), grow(), prepend(), purge(), and read_config(). |
|
|
Referenced by set_def_format(). |
|
|
|
|
|
Initial value: {
{ "FILE", OFFS(name), T_STRING },
{ "OFFSET", OFFS(offset), T_UINT },
{ "PARTITION", OFFS(partition), T_UINT },
{ "FAT", OFFS(fat_bits), T_INT },
{ "FAT_BITS", OFFS(fat_bits), T_UINT },
{ "MODE", OFFS(mode), T_UINT },
{ "TRACKS", OFFS(tracks), T_UINT },
{ "CYLINDERS", OFFS(tracks), T_UINT },
{ "HEADS", OFFS(heads), T_UINT },
{ "SECTORS", OFFS(sectors), T_UINT },
{ "HIDDEN", OFFS(hidden), T_UINT },
{ "PRECMD", OFFS(precmd), T_STRING },
{ "BLOCKSIZE", OFFS(blocksize), T_UINT }
}
Definition at line 148 of file config.c. Referenced by parse_one(). |
|
|
Definition at line 120 of file config.c. Referenced by parse_old_device_line(). |
|
|
Definition at line 25 of file config.c. Referenced by finish_drive_clause(), parse(), parse_old_device_line(), parse_one(), purge(), and read_config(). |
|
|
|
|
|
Definition at line 28 of file config.c. Referenced by finish_drive_clause(), parse_one(), and set_misc_flags(). |
|
|
|
Definition at line 122 of file config.c. Referenced by boundary(), determine(), finish_drive_clause(), geometry(), m_modify(), m_toggle(), parse_old_device_line(), print(), recompute0(), sec2dos(), setsize(), show_chs(), and w_init(). |
|
|
Definition at line 22 of file config.c. Referenced by parse(), skip_junk(), and syntax(). |
|
|
Initial value: {
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
}
Definition at line 36 of file config.c. Referenced by parse_old_device_line(), and parse_one(). |
|
|
Definition at line 20 of file config.c. Referenced by mtools_getline(), parse(), skip_junk(), and syntax(). |
|
|
Initial value: {
{ "scsi", SCSI_FLAG },
{ "nolock", NOLOCK_FLAG },
{ "mformat_only", MFORMAT_ONLY_FLAG },
{ "filter", FILTER_FLAG },
{ "privileged", PRIV_FLAG },
{ "vold", VOLD_FLAG },
{ "remote", FLOPPYD_FLAG }
}
Definition at line 105 of file config.c. Referenced by finish_drive_clause(), and set_misc_flags(). |
|
|
Definition at line 55 of file config.c. Referenced by print_date(). |
|
|
Definition at line 53 of file config.c. Referenced by list_file(). |
|
|
Definition at line 47 of file config.c. Referenced by read_config(). |
|
|
Definition at line 48 of file config.c. Referenced by list_file(), and unix_name(). |
|
|
Definition at line 51 of file config.c. Referenced by dos_name(). |
|
|
|
|
|
Definition at line 49 of file config.c. Referenced by mformat(). |
|
|
Definition at line 50 of file config.c. Referenced by mformat(). |
|
|
Definition at line 46 of file config.c. Referenced by check_fat(), check_media_type(), fs_init(), old_fat_read(), read_config(), and SimpleFileOpen(). |
|
|
Definition at line 54 of file config.c. Referenced by print_time(). |
|
|
|
|
|
Definition at line 34 of file config.c. Referenced by grow(), and read_config(). |
|
|
Initial value: {
{ "none", 0 }
}
Definition at line 91 of file config.c. Referenced by set_openflags(). |
|
|
|
|
|
Definition at line 123 of file config.c. Referenced by abs2dos(), boundary(), cylinderalign(), file_geom(), finish_drive_clause(), geometry(), m_modify(), m_toggle(), old_dos_size_to_geom(), parse_old_device_line(), print(), recompute0(), regionize(), sec2dos(), setsize(), show_chs(), and w_init(). |
|
|
Initial value: {
{ "MTOOLS_LOWER_CASE", (caddr_t) & mtools_ignore_short_case, T_UINT },
{ "MTOOLS_FAT_COMPATIBILITY", (caddr_t) & mtools_fat_compatibility, T_UINT },
{ "MTOOLS_SKIP_CHECK", (caddr_t) & mtools_skip_check, T_UINT },
{ "MTOOLS_NO_VFAT", (caddr_t) & mtools_no_vfat, T_UINT },
{ "MTOOLS_RATE_0", (caddr_t) &mtools_rate_0, T_UINT },
{ "MTOOLS_RATE_ANY", (caddr_t) &mtools_rate_any, T_UINT },
{ "MTOOLS_NAME_NUMERIC_TAIL", (caddr_t) &mtools_numeric_tail, T_UINT },
{ "MTOOLS_DOTTED_DIR", (caddr_t) &mtools_dotted_dir, T_UINT },
{ "MTOOLS_TWENTY_FOUR_HOUR_CLOCK",
(caddr_t) &mtools_twenty_four_hour_clock, T_UINT },
{ "MTOOLS_DATE_STRING",
(caddr_t) &mtools_date_string, T_STRING },
{ "COUNTRY", (caddr_t) &country_string, T_STRING }
}
Definition at line 70 of file config.c. Referenced by get_env_conf(), parse_one(), and set_var(). |
|
|
Definition at line 17 of file config.c. Referenced by read_conf(). |
|
|
Definition at line 18 of file config.c. Referenced by get_next_token(), match_token(), and parse_one(). |
|
|
Definition at line 35 of file config.c. Referenced by get_number(), get_unumber(), mtools_getline(), parse_one(), and skip_junk(). |
|
|
Definition at line 121 of file config.c. Referenced by finish_drive_clause(), old_dos_size_to_geom(), and parse_old_device_line(). |
|
|
Definition at line 33 of file config.c. Referenced by finish_drive_clause(), and parse_one(). |
1.4.6