Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/tools/perf/util/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 835 B image not shown  

Quelle  color_config.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include <subcmd/pager.h>
#include <string.h>
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "color.h"
#include <math.h>
#include <unistd.h>

int perf_config_colorbool(const char *var, const char *value, int stdout_is_tty)
{
 if (value) {
  if (!strcasecmp(value, "never"))
   return 0;
  if (!strcasecmp(value, "always"))
   return 1;
  if (!strcasecmp(value, "auto"))
   goto auto_color;
 }

 /* Missing or explicit false to turn off colorization */
 if (!perf_config_bool(var, value))
  return 0;

 /* any normal truth value defaults to 'auto' */
 auto_color:
 if (stdout_is_tty < 0)
  stdout_is_tty = isatty(1);
 if (stdout_is_tty || pager_in_use()) {
  char *term = getenv("TERM");
  if (term && strcmp(term, "dumb"))
   return 1;
 }
 return 0;
}

Messung V0.5
C=86 H=95 G=90

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.