📄 print.h
字号:
/*-----------------------------------------------------------------------------
$File: //hodad/usblink/3.4/project/linux_2_4_9/hc_int_242/print.h $
$DateTime: 2003/12/01 16:04:41 $
$Revision: #1 $
Purpose: Print related macros
CONFIDENTIAL AND PROPRIETARY INFORMATION OF SOFTCONNEX TECHNOLOGIES, INC.
THIS NOTICE IS NOT TO BE DELETED, MODIFIED, MOVED OR CHANGED IN ANY WAY.
Copyright (c) 1999 - 2003 by SoftConnex Technologies, Inc.
This software is protected by copyright laws and international copyright
treaties, as well as other intellectual property laws and treaties. This
software is a CONFIDENTIAL, unpublished work of authorship, and with portions
constituting TRADE SECRETS of SoftConnex Technologies, Inc., a Delaware USA
corporation. Any unauthorized use, disclosure, and/or reproduction of this
software, or any part of this software; or distribution of this software in any
form or by any means; or storage of this software in any database or retrieval
system, without the express written consent of, and license from, SoftConnex
Technologies, Inc. is strictly prohibited. This software is protected under the
copyright and/or trade secret laws in other countries in addition to USA. All
Rights Reserved. Failure to abide by the use, disclosure and/or reproduction
restrictions may result in civil and /or criminal penalties, and will be
prosecuted to the maximum extent of the law.
-----------------------------------------------------------------------------*/
#ifndef _SOFTCONNEX_PRINT_H_
#define _SOFTCONNEX_PRINT_H_
/* Right now we support 3 print levels. Level 1 is the most important and most
specific print statements. In theory, every time an error is detected a
level 1 print statement should print the type of error. Level 3 is the most
verbose. Many functions might have a level3 print statement just saying that
the program has entered or exited.
The PRINT? statements are meant for single string print statements. Most
often the PRINT statements can be mapped to puts, if it is supported. For
consistancy, all print statements should start with the name of the function
in which it occured, wrapped in perenthesis. If it is an error string then
it should start with the string ERROR: so that it is clear that the string
is being printed to report an error. Below are two examples. First is an
error string and the second is a regular print statment.
PRINT1("(OS_MemoryInitialize) ERROR: Could not create memory pool.\n");
PRINT3("(OS_MemoryInitialize) Enter.\n");
The PRINTF? statements are meant for when a variable needs to be printed.
it is much less likely that an operating system or tool chain will support
printfs. Therefore only use them when absolutely needed. PRINTFs have a
slightly different syntax. You must use a printf syntax surrounded by
double perenthesis. This is due to the fact PRINTF is a macro with a
variable number of arguments, which is not supported by ANSI C/C++. Below
is an example of a PRINTF? statement.
PRINTF2(("(OS_MemoryInitialize) memory pool size: %d\n", MEMORY_POOL_SIZE));
*/
#define OS_ZONE_INIT ZONE_INIT
#define OS_ZONE_INTR ZONE_INTR
#define OS_ZONE_ERR ZONE_ERROR
#ifdef DEBUGMSG
#define OS_DEBUG_MSG1(level, msg1) info(msg1)
#define OS_DEBUG_MSG2(level, msg1, msg2) info(msg1, msg2)
#define OS_DEBUG_MSG3(level, msg1, msg2, msg3) info(msg1, msg2, msg3)
#define OS_DEBUG_MSG4(level, msg1, msg2, msg3, msg4) info(msg1, msg2, msg3, msg4)
#else
#define OS_DEBUG_MSG1(level, msg1)
#define OS_DEBUG_MSG2(level, msg1, msg2)
#define OS_DEBUG_MSG3(level, msg1, msg2, msg3)
#define OS_DEBUG_MSG4(level, msg1, msg2, msg3, msg4)
#endif
#define PRINT1(msg1) err(msg1)
#define PRINT2(msg1) warn(msg1)
#define PRINT3(msg1) info(msg1)
#define PRINTI1(msg1) err(msg1)
#endif /* _SOFTCONNEX_TL_PRINT_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -