}
if (context.verbose_mode) {
- stdout.printf ("%s\n", cmdline);
+ print ("%s\n", cmdline);
}
try {
}
static bool option_deprecated (string option_name, string? val, void* data) throws OptionError {
- stdout.printf ("Command-line option `%s` is deprecated and will be ignored\n", option_name);
+ print ("Command-line option `%s` is deprecated and will be ignored\n", option_name);
return true;
}
}
if (context.report.get_errors () == 0 && (!fatal_warnings || context.report.get_warnings () == 0)) {
if (!quiet_mode) {
- stdout.printf ("Compilation succeeded - %d warning(s)\n", context.report.get_warnings ());
+ print ("Compilation succeeded - %d warning(s)\n", context.report.get_warnings ());
}
CodeContext.pop ();
return 0;
} else {
if (!quiet_mode) {
- stdout.printf ("Compilation failed: %d error(s), %d warning(s)\n", context.report.get_errors (), context.report.get_warnings ());
+ print ("Compilation failed: %d error(s), %d warning(s)\n", context.report.get_errors (), context.report.get_warnings ());
}
CodeContext.pop ();
return 1;
opt_context.add_main_entries (options, null);
opt_context.parse (ref args);
} catch (OptionError e) {
- stdout.printf ("%s\n", e.message);
- stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
+ print ("%s\n", e.message);
+ print ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
return 1;
}
if (version) {
- stdout.printf ("Vala %s\n", Vala.BUILD_VERSION);
+ print ("Vala %s\n", Vala.BUILD_VERSION);
return 0;
} else if (api_version) {
- stdout.printf ("%s\n", Vala.API_VERSION);
+ print ("%s\n", Vala.API_VERSION);
return 0;
}
if (sources == null) {
- stderr.printf ("No source file specified.\n");
+ printerr ("No source file specified.\n");
return 1;
}
return child_status;
} catch (SpawnError e) {
- stdout.printf ("%s\n", e.message);
+ print ("%s\n", e.message);
return 1;
}
}
Intl.setlocale (LocaleCategory.ALL, "");
if (Vala.get_build_version () != Vala.BUILD_VERSION) {
- stderr.printf ("Integrity check failed (libvala %s doesn't match valac %s)\n", Vala.get_build_version (), Vala.BUILD_VERSION);
+ printerr ("Integrity check failed (libvala %s doesn't match valac %s)\n", Vala.get_build_version (), Vala.BUILD_VERSION);
return 1;
}
opt_context.add_main_entries (options, null);
opt_context.parse (ref args);
} catch (OptionError e) {
- stdout.printf ("%s\n", e.message);
- stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
+ print ("%s\n", e.message);
+ print ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
return 1;
}
if (version) {
- stdout.printf ("Vala %s\n", Vala.BUILD_VERSION);
+ print ("Vala %s\n", Vala.BUILD_VERSION);
return 0;
} else if (api_version) {
- stdout.printf ("%s\n", Vala.API_VERSION);
+ print ("%s\n", Vala.API_VERSION);
return 0;
}
if (sources == null && fast_vapis == null) {
- stderr.printf ("No source file specified.\n");
+ printerr ("No source file specified.\n");
return 1;
}
#if DEBUG
private void log_error (string message) {
- stderr.printf ("An error occurred while parsing: %s\n", message);
- stderr.printf ("\nDumping rule stack:\n");
+ printerr ("An error occurred while parsing: %s\n", message);
+ printerr ("\nDumping rule stack:\n");
for (int i = 0; i < rule_stack.size; i++) {
- stderr.printf ("\t%2d: %s\n", i, rule_stack[i].to_string (rule_state_stack[i]));
+ printerr ("\t%2d: %s\n", i, rule_stack[i].to_string (rule_state_stack[i]));
}
}
#endif
}
if (verbose_mode) {
- stdout.printf ("Loaded package `%s'\n", path);
+ print ("Loaded package `%s'\n", path);
}
var deps_filename = Path.build_path ("/", Path.get_dirname (path), pkg + ".deps");
private void report_source (SourceReference source) {
for (int idx = source.begin.line; idx <= source.end.line; idx++) {
string offending_line = source.file.get_source_line (idx);
- stderr.printf ("%5d | %s\n", idx, offending_line);
- stderr.printf (" | ");
+ printerr ("%5d | %s\n", idx, offending_line);
+ printerr (" | ");
stderr.puts (caret_color_start);
for (int jdx = 0; jdx < offending_line.length; jdx++) {
if (offending_line[jdx] == '\t') {
start = cur;
} else {
cur++;
- stderr.printf ("%s%s%s", quote_color_start, message.substring (start, cur - start), quote_color_end);
+ printerr ("%s%s%s", quote_color_start, message.substring (start, cur - start), quote_color_end);
start = cur;
}
} else {
private void print_message (SourceReference? source, string type, string type_color_start, string type_color_end, string message, bool do_report_source) {
if (source != null) {
- stderr.printf ("%s%s:%s ", locus_color_start, source.to_string (), locus_color_end);
+ printerr ("%s%s:%s ", locus_color_start, source.to_string (), locus_color_end);
}
- stderr.printf ("%s%s:%s ", type_color_start, type, type_color_end);
+ printerr ("%s%s:%s ", type_color_start, type, type_color_end);
// highlight '', `', ``
print_highlighted_message (message);
}
static bool option_deprecated (string option_name, string? val, void* data) throws OptionError {
- stdout.printf ("Command-line option `%s` is deprecated and will be ignored\n", option_name);
+ print ("Command-line option `%s` is deprecated and will be ignored\n", option_name);
return true;
}
private static int quit (ErrorReporter reporter) {
if (reporter.errors == 0 && (!fatal_warnings || reporter.warnings == 0)) {
- stdout.printf ("Succeeded - %d warning(s)\n", reporter.warnings);
+ print ("Succeeded - %d warning(s)\n", reporter.warnings);
Vala.CodeContext.pop ();
return 0;
} else {
- stdout.printf ("Failed: %d error(s), %d warning(s)\n", reporter.errors, reporter.warnings);
+ print ("Failed: %d error(s), %d warning(s)\n", reporter.errors, reporter.warnings);
Vala.CodeContext.pop ();
return 1;
}
Intl.setlocale (LocaleCategory.ALL, "");
if (Vala.get_build_version () != Vala.BUILD_VERSION) {
- stderr.printf ("Integrity check failed (libvala %s doesn't match valadoc %s)\n", Vala.get_build_version (), Vala.BUILD_VERSION);
+ printerr ("Integrity check failed (libvala %s doesn't match valadoc %s)\n", Vala.get_build_version (), Vala.BUILD_VERSION);
return 1;
}
opt_context.add_main_entries (options, null);
opt_context.parse (ref args);
} catch (OptionError e) {
- stdout.printf ("%s\n", e.message);
- stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
+ print ("%s\n", e.message);
+ print ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
return 1;
}
if (version) {
- stdout.printf ("Valadoc %s\n", Vala.BUILD_VERSION);
+ print ("Valadoc %s\n", Vala.BUILD_VERSION);
return 0;
}
}
}
} else {
- stdout.printf ("%d\n", type_node.tag);
+ print ("%d\n", type_node.tag);
}
return type;
}
parse_members (module.name, module.entries);
}
} catch (MarkupError e) {
- stderr.printf ("%s: %s\n", gidl.filename, e.message);
+ printerr ("%s: %s\n", gidl.filename, e.message);
}
}
static int main (string[] args) {
if (2 != args.length || !args[1].has_suffix (".gidl")) {
- stdout.printf ("Usage: %s library.gidl\n",
+ print ("Usage: %s library.gidl\n",
Path.get_basename (args[0]));
return 2;
}
private int quit () {
if (context.report.get_errors () == 0) {
if (!quiet_mode) {
- stdout.printf ("Generation succeeded - %d warning(s)\n", context.report.get_warnings ());
+ print ("Generation succeeded - %d warning(s)\n", context.report.get_warnings ());
}
CodeContext.pop ();
return 0;
} else {
if (!quiet_mode) {
- stdout.printf ("Generation failed: %d error(s), %d warning(s)\n", context.report.get_errors (), context.report.get_warnings ());
+ print ("Generation failed: %d error(s), %d warning(s)\n", context.report.get_errors (), context.report.get_warnings ());
}
CodeContext.pop ();
return 1;
Intl.setlocale (LocaleCategory.ALL, "");
if (Vala.get_build_version () != Vala.BUILD_VERSION) {
- stderr.printf ("Integrity check failed (libvala %s doesn't match vapigen %s)\n", Vala.get_build_version (), Vala.BUILD_VERSION);
+ printerr ("Integrity check failed (libvala %s doesn't match vapigen %s)\n", Vala.get_build_version (), Vala.BUILD_VERSION);
return 1;
}
opt_context.add_main_entries (options, null);
opt_context.parse (ref args);
} catch (OptionError e) {
- stdout.printf ("%s\n", e.message);
- stdout.printf ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
+ print ("%s\n", e.message);
+ print ("Run '%s --help' to see a full list of available command line options.\n", args[0]);
return 1;
}
if (version) {
- stdout.printf ("Vala API Generator %s\n", Vala.BUILD_VERSION);
+ print ("Vala API Generator %s\n", Vala.BUILD_VERSION);
return 0;
}
if (sources == null) {
- stderr.printf ("No source file specified.\n");
+ printerr ("No source file specified.\n");
return 1;
}