15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering This file is part of systemd.
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering Copyright 2014 Lennart Poettering
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering systemd is free software; you can redistribute it and/or modify it
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering under the terms of the GNU Lesser General Public License as published by
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering (at your option) any later version.
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering systemd is distributed in the hope that it will be useful, but
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering Lesser General Public License for more details.
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering You should have received a copy of the GNU Lesser General Public License
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poetteringint parse_show_status(const char *v, ShowStatus *ret) {
15bd9a285858c374684e75709de82681ab7daaa7Lennart Poettering *ret = r ? SHOW_STATUS_YES : SHOW_STATUS_NO;
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poetteringint status_vprintf(const char *status, bool ellipse, bool ephemeral, const char *format, va_list ap) {
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering static const char status_indent[] = " "; /* "[" STATUS "] " */
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering /* This is independent of logging, as status messages are
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering * optional and go exclusively to the console. */
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering sl = status ? sizeof(status_indent)-1 : 0;
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poettering IOVEC_SET_STRING(iovec[n++], status_indent);
b8faf2ecd551d853c449c7cadc3944af84156bc9Lennart Poetteringint status_printf(const char *status, bool ellipse, bool ephemeral, const char *format, ...) {