"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main.c" between
recode-3.7.11.tar.gz and recode-3.7.12.tar.gz

About: recode is a charset converter tool and library (fork of the original and now unmaintained GNU recode).

main.c  (recode-3.7.11):main.c  (recode-3.7.12)
skipping to change at line 87 skipping to change at line 87
/* When a file is recoded over itself, precautions are taken to move the /* When a file is recoded over itself, precautions are taken to move the
timestamps of the original file into the recoded file, so to make the timestamps of the original file into the recoded file, so to make the
recoding the most transparent possible to make, and other tools. recoding the most transparent possible to make, and other tools.
However, selecting the following option inhibit the timestamps handling, However, selecting the following option inhibit the timestamps handling,
thus effectively `touching' the file. */ thus effectively `touching' the file. */
static bool touch_option = false; static bool touch_option = false;
/* With strict mapping, all reversibility fallbacks get defeated. */ /* With strict mapping, all reversibility fallbacks get defeated. */
static bool strict_mapping = false; static bool strict_mapping = false;
/* Use iconv if possible. */
static bool prefer_iconv = false;
/* The following charset name will be ignored, if given. */ /* The following charset name will be ignored, if given. */
static const char *ignored_name = NULL; static const char *ignored_name = NULL;
/* Ordinals of list, BEFORE and AFTER charset. */ /* Ordinals of list, BEFORE and AFTER charset. */
static RECODE_SYMBOL list_charset; static RECODE_SYMBOL list_charset;
/* Flag telling usage that we are decoding charsets. */ /* Flag telling usage that we are decoding charsets. */
bool decoding_charset_flag = false; bool decoding_charset_flag = false;
/* Error handling. */ /* Error handling. */
skipping to change at line 329 skipping to change at line 332
= { "c", "perl", "po", NULL }; = { "c", "perl", "po", NULL };
static const char *const sequence_strings[] static const char *const sequence_strings[]
= { "memory", "files", "pipe", NULL }; = { "memory", "files", "pipe", NULL };
static RECODE_OUTER static RECODE_OUTER
new_outer(unsigned flags) new_outer(unsigned flags)
{ {
/* Register all modules and build internal tables. */ /* Register all modules and build internal tables. */
RECODE_OUTER outer = recode_new_outer (flags | RECODE_AUTO_ABORT_FLAG); RECODE_OUTER outer =
recode_new_outer (flags | RECODE_AUTO_ABORT_FLAG);
if (!outer) if (!outer)
abort (); abort ();
/* Set strict mapping. */ /* If using strict mapping, remove fallbacks. */
if (strict_mapping)
{
RECODE_SINGLE single;
for (single = outer->single_list; single; single = single->next) if (outer->strict_mapping)
single->fallback_routine = NULL; for (RECODE_SINGLE single = outer->single_list;
} single;
single = single->next)
single->fallback_routine = NULL;
/* Set the ignored charset. */ /* Set the ignored charset. */
if (ignored_name) if (ignored_name)
{ {
RECODE_ALIAS alias RECODE_ALIAS alias
= find_alias (outer, ignored_name, ALIAS_FIND_AS_CHARSET); = find_alias (outer, ignored_name, ALIAS_FIND_AS_CHARSET);
if (!alias) if (!alias)
{ {
skipping to change at line 448 skipping to change at line 450
default: default:
break; break;
} }
break; break;
case 'C': case 'C':
print_copyright (); print_copyright ();
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
case 'I': case 'I':
request_option.prefer_iconv = true; prefer_iconv = true;
break; break;
case 'S': case 'S':
if (optarg) if (optarg)
switch (argmatch (optarg, language_strings, NULL, 0)) switch (argmatch (optarg, language_strings, NULL, 0))
{ {
case -2: case -2:
error (0, 0, _("Language `%s' is ambiguous"), optarg); error (0, 0, _("Language `%s' is ambiguous"), optarg);
usage (EXIT_FAILURE, 0); usage (EXIT_FAILURE, 0);
break; break;
skipping to change at line 492 skipping to change at line 494
request_option.diaeresis_char = ':'; request_option.diaeresis_char = ':';
break; break;
case 'd': case 'd':
request_option.diacritics_only = true; request_option.diacritics_only = true;
break; break;
case 'f': case 'f':
task_option.fail_level = RECODE_SYSTEM_ERROR; task_option.fail_level = RECODE_SYSTEM_ERROR;
task_option.abort_level = RECODE_USER_ERROR; task_option.abort_level = RECODE_USER_ERROR;
force_flag = true;
break; break;
case 'g': case 'g':
request_option.ascii_graphics = true; request_option.ascii_graphics = true;
break; break;
case 'h': case 'h':
request_option.make_header_flag = true; request_option.make_header_flag = true;
header_name = optarg ? strrchr (optarg, '/') : NULL; header_name = optarg ? strrchr (optarg, '/') : NULL;
if (header_name) if (header_name)
skipping to change at line 645 skipping to change at line 648
if (show_help) if (show_help)
usage (EXIT_SUCCESS, 0); usage (EXIT_SUCCESS, 0);
/* Set up the outer level. */ /* Set up the outer level. */
unsigned flags = 0; unsigned flags = 0;
if ((ignored_name && *ignored_name == ':') if ((ignored_name && *ignored_name == ':')
|| request_option.make_header_flag) || request_option.make_header_flag)
flags |= RECODE_NO_ICONV_FLAG; flags |= RECODE_NO_ICONV_FLAG;
if (strict_mapping)
flags |= RECODE_STRICT_MAPPING_FLAG;
if (force_flag)
flags |= RECODE_FORCE_FLAG;
RECODE_OUTER outer = new_outer (flags); RECODE_OUTER outer = new_outer (flags);
/* Process charset listing options. */ /* Process charset listing options. */
if (find_subsets) if (find_subsets)
{ {
find_and_report_subsets (outer); find_and_report_subsets (outer);
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
} }
skipping to change at line 746 skipping to change at line 753
if (request_option.make_header_flag) if (request_option.make_header_flag)
{ {
recode_format_table (request, header_language, header_name); recode_format_table (request, header_language, header_name);
exit (EXIT_SUCCESS); exit (EXIT_SUCCESS);
} }
/* If we are recoding, and we are allowed to use iconv, and --prefer-iconv /* If we are recoding, and we are allowed to use iconv, and --prefer-iconv
was not used, see if we can do it without iconv. */ was not used, see if we can do it without iconv. */
if ((flags & RECODE_NO_ICONV_FLAG) == 0 && !request_option.prefer_iconv) if ((flags & RECODE_NO_ICONV_FLAG) == 0 && !prefer_iconv)
{ {
RECODE_OUTER no_iconv_outer = new_outer (RECODE_NO_ICONV_FLAG); RECODE_OUTER no_iconv_outer = new_outer (RECODE_NO_ICONV_FLAG);
RECODE_REQUEST no_iconv_request = RECODE_REQUEST no_iconv_request =
new_request (no_iconv_outer, &request_option); new_request (no_iconv_outer, &request_option);
if (recode_scan_request (no_iconv_request, user_request)) if (recode_scan_request (no_iconv_request, user_request))
{ {
recode_delete_request (request); recode_delete_request (request);
recode_delete_outer (outer); recode_delete_outer (outer);
outer = no_iconv_outer; outer = no_iconv_outer;
 End of changes. 8 change blocks. 
11 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)