Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
kb_machblue_core_string.c
Package: ST_5105DTV.rar [view]
Upload User: fy98168
Upload Date: 2015-06-26
Package Size: 13771k
Code Size: 3k
Category:
DVD
Development Platform:
C/C++
- //*****************************************************************************
- //File Name: kb_machblue_core_string.c
- //
- //Description: string function
- //
- // used by Machblue to access the platform's string formatting
- //
- //Author: steven
- //
- //Date: 2006.12.29
- //
- //Version: v1.0
- //*****************************************************************************
- #include "ctype.h"
- #include <stdio.h>
- #include "machblue_customer.h"
- #include "machblue_porting_core.h"
- /**
- * Converts letter to upper case.
- * @return upper case letter (locale dependent).
- */
- int mb_toupper(int c)
- {
- return toupper(c);
- }
- /**
- * Converts letter to lower case.
- * @return lower case letter (locale dependent).
- */
- int mb_tolower(int c)
- {
- return tolower(c);
- }
- /**
- * Prints a formated string based on the specified format. The output
- * is stored in the provided string.
- * @return the number of characters printed.
- */
- int mb_sprintf(mb_char_t *str,const mb_char_t *format,...)
- {
- int numChars;
- va_list args;
- va_start( args, format);
- numChars = mb_vsprintf(str, format, args) ;
- va_end(args);
- return numChars ;
- }
- /**
- * Prints a formated string based on the specified format. The intended output
- * is stdout. It may be redirected at the customer discretion.
- * @return the number of characters printed.
- */
- int mb_printf(const mb_char_t *format,...)
- {
- int numChars;
- va_list args;
- va_start( args, format);
- numChars = mb_vprintf(format, args) ;
- va_end(args);
- fflush(stdout) ;
- return numChars ;
- }
- /**
- * Prints a formated string based on the specified format (variable argument
- * list version). The output is stored in the provided string.
- * @return the number of characters printed.
- */
- int mb_vsprintf(mb_char_t *str,const mb_char_t *format,va_list args)
- {
- return vsprintf(str, format, args) ;
- }
- /**
- * Prints a formated string based on the specified format(variable argument
- * list version). The intended output is stdout. It may be redirected at the
- * customer discretion.
- * @return the number of characters printed.
- */
- int mb_vprintf(const mb_char_t *format,va_list args)
- {
- int numChars = vprintf(format, args) ;
- fflush(stdout) ;
- return numChars ;
- }
- /**
- * Compare two string.
- * @return 0 as success,or other value as failure.
- */
- int mb_strcmp(mb_char_t *s0,mb_char_t *s1)
- {
- while(*s0!=''&&*s1!='')
- {
- if(*s0!=*s1)
- return (*s0>*s1)?1:-1;
- s0++;
- s1++;
- }
- if(*s0==*s1)
- return 0;
- return (*s0>*s1)?1:-1;
- }