]> arthur.barton.de Git - netatalk.git/blobdiff - etc/papd/headers.c
sys/syslog.h -> syslog.h
[netatalk.git] / etc / papd / headers.c
index 12104bea1857e80b945a15b77a9a15a3c9cc12e4..2c34081f3fd91c41be18d0d193c381aaf0ef028e 100644 (file)
@@ -1,22 +1,33 @@
 /*
+ * $Id: headers.c,v 1.7.2.1 2002-03-12 15:44:38 srittau Exp $
+ *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  */
 
-#include <sys/syslog.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h" 
+#endif /* HAVE_CONFIG_H */
+
+#include <syslog.h>
 #include <sys/param.h>
 #include <stdio.h>
 
+#include <netatalk/at.h>
+
 #include "file.h"
 #include "comment.h"
+#include "lp.h"
+
+int ch_title( struct papfile *, struct papfile * );
 
-ch_title( in, out )
+int ch_title( in, out )
     struct papfile     *in, *out;
 {
     char               *start, *stop, *p, *q, c;
-    struct comment     *comment = compeek();
+    int                        linelength, crlflength;
 
-    switch ( markline( &start, &stop, in )) {
+    switch ( markline( in, &start, &linelength, &crlflength )) {
     case 0 :
        return( 0 );
 
@@ -24,6 +35,7 @@ ch_title( in, out )
        return( CH_MORE );
     }
 
+    stop = start + linelength;
     for ( p = start; p < stop; p++ ) {
        if ( *p == ':' ) {
            break;
@@ -50,17 +62,16 @@ ch_title( in, out )
        *q = c;
     }
 
-    *stop = '\n';
-    lp_write( start, stop - start + 1 );
+    lp_write( start, linelength + crlflength );
     compop();
-    consumetomark( start, stop, in );
+    CONSUME( in, linelength + crlflength );
     return( CH_DONE );
 }
 
 /*
  * "Header" comments.
  */
-struct comment headers[] = {
+struct papd_comment    headers[] = {
     { "%%Title:",                      0,              ch_title,       0 },
     { 0 },
 };