diff options
Diffstat (limited to 'src/main/extract.c')
-rw-r--r-- | src/main/extract.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/main/extract.c b/src/main/extract.c index 144f2c3..5efc53a 100644 --- a/src/main/extract.c +++ b/src/main/extract.c @@ -70,7 +70,7 @@ ignore_sigpipe () sig.sa_flags = SA_RESTART; #endif if (0 != sigaction (SIGPIPE, &sig, &oldsig)) - FPRINTF (stderr, + fprintf (stderr, "Failed to install SIGPIPE handler: %s\n", strerror (errno)); } @@ -290,7 +290,7 @@ print_selected_keywords (void *cls, if (YES != print[type]) return 0; if (verbose > 3) - FPRINTF (stdout, + fprintf (stdout, _ ("Found by `%s' plugin:\n"), plugin_name); mt = EXTRACTOR_metatype_to_string (type); @@ -298,7 +298,7 @@ print_selected_keywords (void *cls, switch (format) { case EXTRACTOR_METAFORMAT_UNKNOWN: - FPRINTF (stdout, + fprintf (stdout, _ ("%s - (unknown, %u bytes)\n"), stype, (unsigned int) data_len); @@ -317,7 +317,7 @@ print_selected_keywords (void *cls, keyword = strdup (data); if (NULL != keyword) { - FPRINTF (stdout, + fprintf (stdout, "%s - %s\n", stype, keyword); @@ -329,13 +329,13 @@ print_selected_keywords (void *cls, #endif break; case EXTRACTOR_METAFORMAT_BINARY: - FPRINTF (stdout, + fprintf (stdout, _ ("%s - (binary, %u bytes)\n"), stype, (unsigned int) data_len); break; case EXTRACTOR_METAFORMAT_C_STRING: - FPRINTF (stdout, + fprintf (stdout, "%s - %.*s\n", stype, (int) data_len, @@ -392,7 +392,7 @@ print_selected_keywords_grep_friendly (void *cls, if (0 == data_len) return 0; if (verbose > 1) - FPRINTF (stdout, + fprintf (stdout, "%s: ", gettext (mt)); #if HAVE_ICONV @@ -406,7 +406,7 @@ print_selected_keywords_grep_friendly (void *cls, keyword = strdup (data); if (NULL != keyword) { - FPRINTF (stdout, + fprintf (stdout, "`%s' ", keyword); free (keyword); @@ -420,10 +420,10 @@ print_selected_keywords_grep_friendly (void *cls, break; case EXTRACTOR_METAFORMAT_C_STRING: if (verbose > 1) - FPRINTF (stdout, + fprintf (stdout, "%s ", gettext (mt)); - FPRINTF (stdout, + fprintf (stdout, "`%s'", data); break; @@ -575,7 +575,7 @@ finish_bibtex (const char *fn) if ( (NULL == btm[0].value) || (NULL == btm[1].value) || (NULL == btm[2].value) ) - FPRINTF (stdout, + fprintf (stdout, "@%s %s { ", et, fn); @@ -592,18 +592,18 @@ finish_bibtex (const char *fn) temp[n] = '_'; else temp[n] = tolower ( (unsigned char) temp[n]); - FPRINTF (stdout, + fprintf (stdout, "@%s %s { ", et, temp); } for (i = 0; NULL != btm[i].bibTexName; i++) if (NULL != btm[i].value) - FPRINTF (stdout, + fprintf (stdout, "\t%s = {%s},\n", btm[i].bibTexName, btm[i].value); - FPRINTF (stdout, "%s", "}\n\n"); + fprintf (stdout, "%s", "}\n\n"); } @@ -775,7 +775,7 @@ main (int argc, char *argv[]) #endif if (NULL == (print = malloc (sizeof (int) * EXTRACTOR_metatype_get_max ()))) { - FPRINTF (stderr, + fprintf (stderr, "malloc failed: %s\n", strerror (errno)); return 1; @@ -785,7 +785,7 @@ main (int argc, char *argv[]) if (0 != _get_utf8_args (argc, argv, &utf8_argc, &utf8_argv)) { - FPRINTF (stderr, "Failed to get arguments: %s\n", strerror (errno)); + fprintf (stderr, "Failed to get arguments: %s\n", strerror (errno)); return 1; } @@ -821,7 +821,7 @@ main (int argc, char *argv[]) bibtex = YES; if (NULL != processor) { - FPRINTF (stderr, + fprintf (stderr, "%s", _ ( "Illegal combination of options, cannot combine multiple styles of printing.\n")); @@ -834,7 +834,7 @@ main (int argc, char *argv[]) grepfriendly = YES; if (NULL != processor) { - FPRINTF (stderr, + fprintf (stderr, "%s", _ ( "Illegal combination of options, cannot combine multiple styles of printing.\n")); @@ -869,7 +869,7 @@ main (int argc, char *argv[]) case 'p': if (NULL == optarg) { - FPRINTF (stderr, + fprintf (stderr, _ ( "You must specify an argument for the `%s' option (option ignored).\n"), "-p"); @@ -898,7 +898,7 @@ main (int argc, char *argv[]) } if (NULL == EXTRACTOR_metatype_to_string (i)) { - FPRINTF (stderr, + fprintf (stderr, "Unknown keyword type `%s', use option `%s' to get a list.\n", optarg, "-L"); @@ -929,7 +929,7 @@ main (int argc, char *argv[]) } if (NULL == EXTRACTOR_metatype_to_string (i)) { - FPRINTF (stderr, + fprintf (stderr, "Unknown keyword type `%s', use option `%s' to get a list.\n", optarg, "-L"); @@ -938,7 +938,7 @@ main (int argc, char *argv[]) } break; default: - FPRINTF (stderr, + fprintf (stderr, "%s", _ ("Use --help to get a list of options.\n")); free (utf8_argv); @@ -947,7 +947,7 @@ main (int argc, char *argv[]) } /* while (1) */ if (optind < 0) { - FPRINTF (stderr, + fprintf (stderr, "%s", "Unknown error parsing options\n"); free (print); free (utf8_argv); @@ -955,7 +955,7 @@ main (int argc, char *argv[]) } if (utf8_argc - optind < 1) { - FPRINTF (stderr, + fprintf (stderr, "%s", "Invoke with list of filenames to extract keywords form!\n"); free (print); free (utf8_argv); @@ -980,15 +980,15 @@ main (int argc, char *argv[]) /* extract keywords */ if (YES == bibtex) - FPRINTF (stdout, + fprintf (stdout, "%s", _ ("% BiBTeX file\n")); for (i = optind; i < utf8_argc; i++) { errno = 0; if (YES == grepfriendly) - FPRINTF (stdout, "%s ", utf8_argv[i]); + fprintf (stdout, "%s ", utf8_argv[i]); else if (NO == bibtex) - FPRINTF (stdout, + fprintf (stdout, _ ("Keywords for file %s:\n"), utf8_argv[i]); else @@ -1003,15 +1003,15 @@ main (int argc, char *argv[]) { struct stat sb; unsigned char *data = NULL; - int f = OPEN (utf8_argv[i], O_RDONLY + int f = open (utf8_argv[i], O_RDONLY #if WINDOWS | O_BINARY #endif ); if ( (-1 != f) && - (0 == FSTAT (f, &sb)) && + (0 == fstat (f, &sb)) && (NULL != (data = malloc ((size_t) sb.st_size))) && - (sb.st_size == READ (f, data, (size_t) sb.st_size) ) ) + (sb.st_size == read (f, data, (size_t) sb.st_size) ) ) { EXTRACTOR_extract (plugins, NULL, @@ -1022,7 +1022,7 @@ main (int argc, char *argv[]) else { if (verbose > 0) - FPRINTF (stderr, + fprintf (stderr, "%s: %s: %s\n", utf8_argv[0], utf8_argv[i], strerror (errno)); ret = 1; @@ -1030,18 +1030,18 @@ main (int argc, char *argv[]) if (NULL != data) free (data); if (-1 != f) - (void) CLOSE (f); + (void) close (f); } if (YES == grepfriendly) - FPRINTF (stdout, "%s", "\n"); + fprintf (stdout, "%s", "\n"); continue; } if (YES == grepfriendly) - FPRINTF (stdout, "%s", "\n"); + fprintf (stdout, "%s", "\n"); if (bibtex) finish_bibtex (utf8_argv[i]); if (verbose > 0) - FPRINTF (stdout, "%s", "\n"); + fprintf (stdout, "%s", "\n"); free (print); free (utf8_argv); EXTRACTOR_plugin_remove_all (plugins); |