📄 util.h
字号:
#ifndef __UTIL_H
#define __UTIL_H
/*
###############################################################################
File Name : UTIL.H
Version : 2.0
Created : 2001-08-27 ~ 2001-09-07
Description : Define useful functions
Modified History :
Modified : 2002/03/15
Description : Eliminate disused function
Modified : 2002/10/20
Description : Version Up (V2.0)
Add ITOA()
Add ValidATOI()
Add CmpStr()
Add StrTrim()
Add FindLast()
Add StrNChr()
Modify StrTok()
###############################################################################
*/
/*
###############################################################################
Include Part
###############################################################################
*/
#include "TYPE.H"
/*
###############################################################################
Define Part
###############################################################################
*/
/*
If there are unused functions in program and on compiling with Keil-C, it result in warning.In this reason, wrong operation could be happend.
So it prevent to compile unused functions to use define-function.
*/
#define __UTIL_UNUSED // If defined with " __UITL_UNUSED", actually it's not to be compiled "__UTIL_UNUSED Block"
/*
###############################################################################
Grobal Variable Definition Part
###############################################################################
*/
/*
###############################################################################
Function Prototype Definition Part
###############################################################################
*/
extern UCHAR D2C(char c); /* Convert Hex(0-F) to Character */
extern char C2D(UCHAR c); /* Convert Character to Hex */
extern UINT ATOI(UCHAR* str,char base); /* Convert Character string to integer number */
/*
###############################################################################
Unused Function Prototype definition Part
###############################################################################
*/
#ifndef __UTIL_UNUSED
extern UCHAR * FindFirstStr(UCHAR *src, UCHAR * tag); /* Find beginning of character in string */
extern void MemCat(UCHAR* str, UCHAR* tag); /* Cascade 'tag' in the end of 'str' string. */
UCHAR * FindLast(UCHAR * src,char c); /* Find last location of character in string */
extern int StrNChr(char* src, char c); /* Get count 'c' character in str */
extern char* ITOA(u_int value,char* str,char base); /* Convert Decimal Number to string */
extern void ReplaceAll(UCHAR * src,char s,char d); /* Replace with assigned character in Character String */
extern UCHAR * StrTok(UCHAR* src,char sep,UCHAR* tok); /* Turncate character string by Delimeter */
extern int CmpStr(char* src, char* dst); /* Compare source string to destination source */
extern UCHAR * FindFirst(UCHAR * src,char c); /* Find location of character in string */
extern UINT MemCopy(UCHAR *dst,UCHAR * src); /* copy src_string to dst_string */
extern void MakeUpper(UCHAR* src); /* conver small letter to capital letter in string */
extern UINT StrLen(UCHAR* str); /* length of Character Stream */
extern char ValidATOI(char* str, int base, int* ret); /* Verify character string and Convert it to (hexa-)decimal. */
extern void StrTrim(char* src); /* Cut out whitespace in src */
#endif // end __UTIL_UNUSED
#endif // end __UTIL_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -