X-Git-Url: https://git.saurik.com/apple/boot.git/blobdiff_plain/14c7c974991c850bfa0348affbd4bee3223205ee..bba600dda0ea8a76d875db7308f372bfc43f8506:/i386/libsaio/console.c?ds=sidebyside diff --git a/i386/libsaio/console.c b/i386/libsaio/console.c index 1b1103c..d6bdfac 100644 --- a/i386/libsaio/console.c +++ b/i386/libsaio/console.c @@ -1,12 +1,12 @@ /* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights * Reserved. This file contains Original Code and/or Modifications of * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file + * Source License Version 2.0 (the "License"). You may not use this file * except in compliance with the License. Please obtain a copy of the * License at http://www.apple.com/publicsource and read it before using * this file. @@ -45,9 +45,10 @@ */ #include "libsaio.h" +#include "bootstruct.h" -BOOL verbose_mode; -BOOL errors; +BOOL gVerboseMode; +BOOL gErrors; /* * write one character to console @@ -95,6 +96,7 @@ int getchar() int printf(const char * fmt, ...) { va_list ap; + if (bootArgs->Video.v_display != VGA_TEXT_MODE) return -1; va_start(ap, fmt); prf(fmt, ap, putchar, 0); va_end(ap); @@ -105,7 +107,7 @@ int verbose(const char * fmt, ...) { va_list ap; - if (verbose_mode) + if (gVerboseMode) { va_start(ap, fmt); prf(fmt, ap, putchar, 0); @@ -117,9 +119,21 @@ int verbose(const char * fmt, ...) int error(const char * fmt, ...) { va_list ap; - errors = YES; + gErrors = YES; va_start(ap, fmt); prf(fmt, ap, putchar, 0); va_end(ap); return(0); } + +void stop(const char * fmt, ...) +{ + va_list ap; + + printf("\n"); + va_start(ap, fmt); + prf(fmt, ap, putchar, 0); + va_end(ap); + printf("\n"); + halt(); +}