[Pcsclite-cvs-commit] Drivers/ccid/src/openct buffer.c,1.1,1.2 buffer.h,1.1,1.2

rousseau@haydn.debian.org rousseau@haydn.debian.org


Update of /cvsroot/pcsclite/Drivers/ccid/src/openct
In directory haydn:/tmp/cvs-serv942/src/openct

Modified Files:
	buffer.c buffer.h 
Log Message:
remove unused functions


Index: buffer.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/openct/buffer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- buffer.c	30 Jun 2004 09:37:08 -0000	1.1
+++ buffer.c	15 Jul 2004 07:26:40 -0000	1.2
@@ -27,12 +27,6 @@
 	bp->tail = len;
 }
 
-void
-ct_buf_clear(ct_buf_t *bp)
-{
-	bp->head = bp->tail = 0;
-}
-
 int
 ct_buf_get(ct_buf_t *bp, void *mem, size_t len)
 {
@@ -45,38 +39,6 @@
 }
 
 int
-ct_buf_gets(ct_buf_t *bp, char *buffer, size_t size)
-{
-	unsigned int	n, avail;
-	unsigned char	*s;
-
-	size -= 1; /* room for NUL byte */
-
-	/* Limit string to what we have */
-	avail = bp->tail - bp->head;
-	if (size > avail)
-		size = avail;
-
-	/* Look for newline */
-	s = bp->base + bp->head;
-	for (n = 0; n < size && s[n] != '\n'; n++)
-		;
-
-	/* Copy string (excluding newline) */
-	memcpy(buffer, s, n);
-	buffer[n] = '\0';
-
-	/* And eat any characters that weren't copied
-	 * (including the newline)
-	 */
-	while (n < avail && s[n++] != '\n')
-		;
-	
-	bp->head += n;
-	return 0;
-}
-
-int
 ct_buf_put(ct_buf_t *bp, const void *mem, size_t len)
 {
 	if (len > bp->size - bp->tail) {
@@ -97,73 +59,15 @@
 	return ct_buf_put(bp, &c, 1);
 }
 
-int
-ct_buf_puts(ct_buf_t *bp, const char *string)
-{
-	return ct_buf_put(bp, string, strlen(string));
-}
-
 unsigned int
 ct_buf_avail(ct_buf_t *bp)
 {
 	return bp->tail - bp->head;
 }
 
-unsigned int
-ct_buf_tailroom(ct_buf_t *bp)
-{
-	return bp->size - bp->tail;
-}
-
-unsigned int
-ct_buf_size(ct_buf_t *bp)
-{
-	return bp->size;
-}
-
 void *
 ct_buf_head(ct_buf_t *bp)
 {
 	return bp->base + bp->head;
 }
 
-void *
-ct_buf_tail(ct_buf_t *bp)
-{
-	return bp->base + bp->tail;
-}
-
-int
-ct_buf_read(ct_buf_t *bp, int fd)
-{
-	unsigned int	count;
-	int		n;
-
-	ct_buf_compact(bp);
-
-	count = bp->size - bp->tail;
-	if ((n = read(fd, bp->base + bp->tail, count)) < 0)
-		return -1;
-	bp->tail += n;
-	return 0;
-}
-
-void
-ct_buf_compact(ct_buf_t *bp)
-{
-	unsigned int	count;
-
-	if (bp->head == 0)
-		return;
-
-	count = bp->tail - bp->head;
-	memmove(bp->base, bp->base + bp->head, count);
-	bp->tail -= bp->head;
-	bp->head  = 0;
-}
-
-int
-ct_buf_overrun(ct_buf_t *bp)
-{
-	return bp->overrun;
-}

Index: buffer.h
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/openct/buffer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- buffer.h	30 Jun 2004 09:37:08 -0000	1.1
+++ buffer.h	15 Jul 2004 07:26:40 -0000	1.2
@@ -21,20 +21,11 @@
 
 extern void		ct_buf_init(ct_buf_t *, void *, size_t);
 extern void		ct_buf_set(ct_buf_t *, void *, size_t);
-extern void		ct_buf_clear(ct_buf_t *);
 extern int		ct_buf_get(ct_buf_t *, void *, size_t);
-extern int		ct_buf_gets(ct_buf_t *, char *, size_t);
 extern int		ct_buf_put(ct_buf_t *, const void *, size_t);
 extern int		ct_buf_putc(ct_buf_t *, int);
-extern int		ct_buf_puts(ct_buf_t *, const char *);
 extern unsigned int	ct_buf_avail(ct_buf_t *);
-extern unsigned int	ct_buf_tailroom(ct_buf_t *);
-extern unsigned int	ct_buf_size(ct_buf_t *);
 extern void *		ct_buf_head(ct_buf_t *);
-extern void *		ct_buf_tail(ct_buf_t *);
-extern int		ct_buf_read(ct_buf_t *, int);
-extern void		ct_buf_compact(ct_buf_t *);
-extern int		ct_buf_overrun(ct_buf_t *);
 
 #ifdef __cplusplus
 }