⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util.h

📁 ks8695 loader > > > > > > > > > > > > >
💻 H
字号:
/***************************************** Copyright (c) 2001-2002  Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************//* This file is part of the boot loader *//* * util.h *  * utility functions * * first revision by Ho Lee 10/10/2002 */#ifndef __BOOTLOADER_UTIL_H#define __BOOTLOADER_UTIL_H#ifndef NULL#define NULL	(void *) 0#endif// ctypeint isspace(int ch);int isdigit(int ch);// stringchar *trim(char *str);int strlen(const char *str);char *strcpy(char *dest, const char *src);char *strncpy(char *dest, const char *src, int n);char *strncpy0(char *dest, const char *src, int n);int strcmp(const char *str1, const char *str2);int strncmp(const char *str1, const char *str2, int num);char *strchr(const char *str, char ch);char *strtok(char *str, const char *token);// stdlibunsigned int atoi(const char *str);unsigned int htoi(const char *str);void memcpy(void *to, const void *from, unsigned long n);int memcmp(const void *ptr1, const void *ptr2, unsigned long n);void memset(void *ptr, unsigned char value, unsigned long n);// networkint parse_netaddr(char *str, unsigned char *addr, int len);int parse_ipaddr(char *str, unsigned int *ipaddr);char *ipaddr_to_str(unsigned int ipaddr);// for networkingstatic __inline__ unsigned short htons(unsigned short x){	return ((unsigned short) ((((unsigned short)(x) & 0x00ff) << 8) | 		(((unsigned short)(x) & 0xff00) >> 8)));}static __inline__ unsigned int htonl(unsigned int x){	return ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) |		(((unsigned long int)(x) & 0x0000ff00U) <<  8) |		(((unsigned long int)(x) & 0x00ff0000U) >>  8) |		(((unsigned long int)(x) & 0xff000000U) >> 24)));}static __inline__ unsigned short ntohs(unsigned short x){	return htons(x);}static __inline__ unsigned int ntohl(unsigned int x){	return htonl(x);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -