MCPcopy Create free account
hub / github.com/coreutils/coreutils / main

Function main

src/sort.c:4431–4989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4429}
4430
4431int
4432main (int argc, char **argv)
4433{
4434 struct keyfield *key;
4435 struct keyfield key_buf;
4436 struct keyfield gkey;
4437 bool gkey_only = false;
4438 char const *s;
4439 int c = 0;
4440 char checkonly = 0;
4441 bool mergeonly = false;
4442 char *random_source = NULL;
4443 bool need_random = false;
4444 size_t nthreads = 0;
4445 size_t nfiles = 0;
4446 bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
4447 int posix_ver = posix2_version ();
4448 bool traditional_usage = ! (200112 <= posix_ver && posix_ver < 200809);
4449 char **files;
4450 char *files_from = NULL;
4451 struct Tokens tok;
4452 char const *outfile = NULL;
4453 bool locale_ok;
4454
4455 initialize_main (&argc, &argv);
4456 set_program_name (argv[0]);
4457 locale_ok = !! setlocale (LC_ALL, "");
4458 bindtextdomain (PACKAGE, LOCALEDIR);
4459 textdomain (PACKAGE);
4460
4461 initialize_exit_failure (SORT_FAILURE);
4462
4463 hard_LC_COLLATE = hard_locale (LC_COLLATE);
4464#if HAVE_NL_LANGINFO
4465 hard_LC_TIME = hard_locale (LC_TIME);
4466#endif
4467
4468 /* Get locale's representation of the decimal point. */
4469 {
4470 struct lconv const *locale = localeconv ();
4471
4472 /* If the locale doesn't define a decimal point, or if the decimal
4473 point is multibyte, use the C locale's decimal point. FIXME:
4474 add support for multibyte decimal points. */
4475 decimal_point = locale->decimal_point[0];
4476 if (! decimal_point || locale->decimal_point[1])
4477 decimal_point = '.';
4478
4479 /* FIXME: add support for multibyte thousands separators. */
4480 thousands_sep = locale->thousands_sep[0];
4481 if (thousands_sep && locale->thousands_sep[1])
4482 thousands_sep_ignored = true;
4483 if (! thousands_sep || locale->thousands_sep[1])
4484 thousands_sep = NON_CHAR;
4485 }
4486
4487 inittables ();
4488

Callers

nothing calls this directly

Calls 15

initialize_exit_failureFunction · 0.85
inittablesFunction · 0.85
key_initFunction · 0.85
parse_field_countFunction · 0.85
set_orderingFunction · 0.85
badfieldspecFunction · 0.85
insertkeyFunction · 0.85
incompatible_optionsFunction · 0.85
specify_nmergeFunction · 0.85
specify_sort_sizeFunction · 0.85
add_temp_dirFunction · 0.85
specify_nthreadsFunction · 0.85

Tested by

no test coverage detected