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
PARSE.C
Package: ertos.rar [view]
Upload User: sunrenlu
Upload Date: 2022-06-13
Package Size: 1419k
Code Size: 1k
Category:
OS Develop
Development Platform:
DOS
- #include <string.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <rtos.h>
- #include <kconio.h>
- #undef word
- char *parse_arg( char * source, int word )
- {
- int i, len;
- int curword;
- int inspace;
- char *p, *start, ch;
- char *result;
- curword = 0;
- for ( p = source ; (ch = *p) != 0 ; p++ ) {
- if ( isspace( ch ) ) {
- if ( inspace ) {
- // still in space
- } else {
- // start of space
- inspace = 1;
- // was it the end of the special word
- if ( curword == word )
- break;
- }
- } else {
- if ( inspace ) {
- // start of new word
- curword ++;
- len = 1;
- start = p;
- inspace = 0;
- } else {
- // 2nd and other characters
- len++;
- }
- }
- }
- if ( curword == word ) {
- result = kcalloc( len + 1 , 1 );
- strncpy( result, start, len );
- result[ len ] = 0;
- } else
- result = NULL;
- return( result );
- }