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
srm_printk.c
Package: linux-2.4.20.tar.gz [view]
Upload User: jlfgdled
Upload Date: 2013-04-10
Package Size: 33168k
Code Size: 1k
Category:
Linux-Unix program
Development Platform:
Unix_Linux
- /*
- * arch/alpha/lib/srm_printk.c
- */
- #include <linux/kernel.h>
- #include <asm/console.h>
- long
- srm_printk(const char *fmt, ...)
- {
- static char buf[1024];
- va_list args;
- long len, num_lf;
- char *src, *dst;
- va_start(args, fmt);
- len = vsprintf(buf, fmt, args);
- va_end(args);
- /* count number of linefeeds in string: */
- num_lf = 0;
- for (src = buf; *src; ++src) {
- if (*src == 'n') {
- ++num_lf;
- }
- }
- if (num_lf) {
- /* expand each linefeed into carriage-return/linefeed: */
- for (dst = src + num_lf; src >= buf; ) {
- if (*src == 'n') {
- *dst-- = 'r';
- }
- *dst-- = *src--;
- }
- }
- srm_puts(buf, num_lf+len);
- return len;
- }