📄 file_util.c
字号:
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
//#include "F34x_MSD_Definitions.h"
#include "file_Util.h"
#include <string.h>
DWORD htonl(DWORD d) {
DWORD rtn=0;
rtn|=((d&0xFF000000L)>>24);
rtn|=((d&0x00FF0000L)>> 8);
rtn|=((d&0x0000FF00L)<< 8);
rtn|=((d&0x000000FFL)<<24);
return rtn;
}
unsigned htons(unsigned w) {
unsigned rtn=0;
rtn|=((w&0xFF00u)>>8);
rtn|=((w&0x00FFu)<<8);
return rtn;
}
#define whitespace " \t\0\n\r"
//----------------------------------------------------------------------------
// Str_Token
//----------------------------------------------------------------------------
//
// This function searches the whitespaces and returns the address of first
// found whitespace sign.
//
// Parameters : str - command string
// Return Value : address of found whitespace
//----------------------------------------------------------------------------
char* Str_Token(char* str) {
static char* s;
static char old;
char*rtn;
if(str) s=str; else *s=old;
while(*s && strchr(whitespace,*s)) // Skip leading whitespace
s++;
if(!*s) return 0;
rtn=s;
while(*s && !strchr(whitespace,*s)) // Find next whitespace
s++;
old=*s;
*s='\0';
return rtn;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -