Main Page | Alphabetical List | Class List | File List | Class Members | File Members

utility.cc File Reference

#include "copyright.h"
#include "utility.h"
#include <stdarg.h>

Go to the source code of this file.

Functions

void DebugInit (char *flagList)
bool DebugIsEnabled (char flag)
void DEBUG (char flag, char *format,...)


Function Documentation

void DEBUG char  flag,
char *  format,
  ...
 

Definition at line 66 of file utility.cc.

References DebugIsEnabled().

Referenced by AssignNameToSocket(), Network::CheckPktAvail(), Disk::ComputeLatency(), Disk::Disk(), Thread::Finish(), Thread::Fork(), Interrupt::Idle(), main(), List::Mapcar(), Machine::OneInstruction(), Interrupt::OneTick(), Semaphore::P(), Machine::RaiseException(), Machine::ReadMem(), Disk::ReadRequest(), Interrupt::Schedule(), schedule(), Network::Send(), Thread::Suspend(), Machine::Translate(), Semaphore::V(), Machine::WriteMem(), Disk::WriteRequest(), Thread::Yield(), and Thread::~Thread().

00067 { 00068 if (DebugIsEnabled(flag)) { 00069 va_list ap; 00070 // You will get an unused variable message here -- ignore it. 00071 va_start(ap, format); 00072 vfprintf(stdout, format, ap); 00073 va_end(ap); 00074 fflush(stdout); 00075 } 00076 }

void DebugInit char *  flagList  ) 
 

Definition at line 39 of file utility.cc.

Referenced by Initialize().

00040 { 00041 enableFlags = flagList; 00042 }

bool DebugIsEnabled char  flag  ) 
 

Definition at line 50 of file utility.cc.

References FALSE.

Referenced by DEBUG(), Machine::OneInstruction(), Disk::ReadRequest(), Machine::Run(), and Disk::WriteRequest().

00051 { 00052 if (enableFlags != NULL) 00053 return (strchr(enableFlags, flag) != 0) 00054 || (strchr(enableFlags, '+') != 0); 00055 else 00056 return FALSE; 00057 }


Generated on Thu Sep 16 12:33:47 2004 for NachOS by doxygen 1.3.8