📄 myansi.c
字号:
/*************************************************************
File Name: MYANSI.C (RAMDisk 4.0) *
**************************************************************
Programmer: MSC
Last Modified Date: 1999/09/23
Compiler : GNU Cross-compiler/SDS
Platform : X86 protection mode, MIPS, Dragonball
Usage :
My replacement functions for ANSI-C functions
See myansi.h for usage.
*************************************************************/
#include <kernel/general.h>
#include <myansi.h>
extern void printString(char *string);
/*************************************************************
Function: myStrLen
Description:
get the length of a string
Input:
src - the source string with a mix of single-byte and
double-byte chars
Output:
**************************************************************/
int myStrLen(unsigned char *src)
{
int length = 0;
while (*src != '\0')
{
length++;
src++;
}
return length;
}
/**************************************************************
Function: myStrCpy
Description:
copy the content of a string to another buffer
Input:
to - the source string
from - the destination string
**************************************************************/
unsigned char *myStrCpy(unsigned char *to, const unsigned char *from)
{
unsigned char *p = to;
while (*p++ = *from++)
;
return(to);
}
/*************************************************************
Function: myPrintInt
Description:
print a number without going to the next line
Input:
number - the number to be printed
type - the form in which the number is printed (DEC, HEX, ...)
**************************************************************/
void myPrintInt(unsigned long number, int type)
{
char string[20];
intToString((unsigned int)number, string, type);
printString(string);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -