📄 vxwerr.cpp
字号:
// vxwErr.cpp - error handling class// Copyright 1995-1999 Wind River Systems, Inc.#include "copyright_wrs.h"//// modification history// --------------------// 01b,23feb99,fle doc : made it refgen compliant// 01a,15jun95,srh written.//// IMPLEMENTS ../../../h/vxwErr.h #include "vxWorks.h"#include "cplusLib.h"#include "stdio.h"#include "string.h"#include "taskLib.h"#include "vxwErr.h"static voidvxwDefaultErrRoutine (const VXWError &error) { cplusLogMsg ("%s\n", int (error.why ()), 0, 0, 0, 0, 0); taskSuspend (0); }static void (*vxwErrRoutine) (const VXWError &) = vxwDefaultErrRoutine;voidvxwSetErrHandler (void (*newErrHandler) (const VXWError &)) { vxwErrRoutine = newErrHandler; }voidvxwThrow (const VXWError &err) { (*vxwErrRoutine) (err); }VXWError::VXWError (const char *str) { makeCopy (str); }VXWError::VXWError (const int err) { char buf [100]; sprintf (buf, "VXW error, errno: 0x%x\n", err); makeCopy (buf); }VXWError::VXWError (const VXWError &err) { makeCopy (err.errorMessage_); }VXWError::~VXWError () { if (errorMessage_ != 0) delete (char *) (errorMessage_); errorMessage_ = 0; }void VXWError::makeCopy (const char *str) { char *p = new char [ strlen (str) + 1 ]; strcpy (p, str); errorMessage_ = p; }char __vxwErr_o; // for forced linking in src/config/cplus*.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -