⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diag.cxx

📁 C++ 编写的EROS RTOS
💻 CXX
字号:
/* * Copyright (C) 1998, 1999, Jonathan S. Shapiro. * * This file is part of the EROS Operating System. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <erosimg/Diag.hxx>#include <erosimg/App.hxx>int Diag::debuglvl = 0;voidDiag::printf(const char* msg, ...){  va_list ap;  va_start(ap, msg);      vfprintf(stdout, msg, ap);  va_end(ap);}voidDiag::print(OID oid){  Diag::printf("0x%08x%08x", (uint32_t) (oid >> 32), (uint32_t) oid);}voidDiag::print(ObCount count){  Diag::printf("0x%08x", count);}voidDiag::debug(int lvl, const char* msg, ...){  if (lvl && lvl > debuglvl)    return;    va_list ap;  va_start(ap, msg);      if (lvl)    fprintf(stderr, "%s: L%-3d ", App.name(), lvl);  vfprintf(stderr, msg, ap);  va_end(ap);}voidDiag::fatal(int code, const char* msg, ...){  va_list ap;  va_start(ap, msg);      fprintf(stderr, "%s: Fatal: ", App.name());  vfprintf(stderr, msg, ap);  App.SetExitValue(code);  App.Exit();  va_end(ap);}voidDiag::error(int code, const char* msg, ...){  va_list ap;  va_start(ap, msg);      fprintf(stderr, "%s: Error: ", App.name());  vfprintf(stderr, msg, ap);  App.SetExitValue(code);    if (App.IsInteractive() == false)    App.Exit();    va_end(ap);}voidDiag::warning(const char* msg, ...){  va_list ap;  va_start(ap, msg);      fprintf(stderr, "%s: Warning: ", App.name());  vfprintf(stderr, msg, ap);  va_end(ap);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -