Update of /cvsroot/blob/blob/src/lib
In directory usw-pr-cvs1:/tmp/cvs-serv29649/src/lib
Modified Files:
serial.c
Log Message:
1. Backed out my printf() function again because I realised if we don't
include the C library stdarg.h there is no portable way to handle variable
arguments :P If someone comes up with a hack for this, I'll add the printf()
stuff again - would be useful...
2. Made UU Codec support optional.
Index: serial.c
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/serial.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- serial.c 2002/02/05 13:40:46 1.8
+++ serial.c 2002/02/05 14:47:54 1.9
@@ -239,76 +239,6 @@
/*
- * Very primitive printf() support. This version can
- * do the following conversions:
- *
- * c char
- * s char *
- * d,i int
- * u unsigned int
- * x unsigned int (hex)
- * p void *
- *
- * There is no floating point support and no modifiers.
- */
-void SerialPrintf(const char *fmt, ...)
-{
- va_list ap;
- int d;
-
- va_start (ap,fmt);
- while (*fmt)
- {
- if (*fmt == '%')
- {
- switch (*++fmt)
- {
- case '%':
- SerialOutputChar (*fmt);
- break;
-
- case 'c':
- SerialOutputChar (va_arg (ap,const char));
- break;
-
- case 's':
- SerialOutputString (va_arg (ap,const char *));
- break;
-
- case 'd':
- case 'i':
- d = va_arg (ap,int);
- if (d < 0)
- {
- SerialOutputChar ('-');
- d = -d;
- }
- SerialOutputDec (d);
- break;
-
- case 'u':
- SerialOutputDec (va_arg (ap,unsigned int));
- break;
-
- case 'x':
- SerialOutputHex (va_arg (ap,unsigned int));
- break;
-
- case 'p':
- SerialOutputHex ((unsigned int) va_arg (ap,void *));
- break;
- }
- }
- else SerialOutputChar (*fmt);
- fmt++;
- }
- va_end (ap);
-}
-
-
-
-
-/*
* read a string with maximum length len from the serial port
* using a timeout of timeout seconds
*
|