qio man page on BSDOS

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDOS logo
[printable version]



QIO(3)							   QIO(3)

NAME
       qio - quick I/O part of InterNetNews library

SYNOPSIS
       #include "qio.h"

       QIOSTATE *
       QIOopen(name)
	   char		    *name;

       QIOSTATE *
       QIOfdopen(fd)
	   int		    fd;

       void
       QIOclose(qp)
	   QIOSTATE	    *qp;

       char *
       QIOread(qp)
	   QIOSTATE	    *qp;

       int
       QIOlength(qp)
	   QIOSTATE	    *qp;

       int
       QIOtoolong(qp)
	   QIOSTATE	    *qp;

       int
       QIOerror(qp)
	   QIOSTATE	    *qp;

       int
       QIOtell(qp)
	   QIOSTATE	    *qp;

       int
       QIOrewind(qp)
	   QIOSTATE	    *qp;

       int
       QIOfileno(qp)
	   QIOSTATE	    *qp;

DESCRIPTION
       The  routines  described	 in  this manual page are part of
       libstorage(3).  They are used to provide quick read access
       to  files or articles specified with tokens.  All routines
       are not available for token.  The  letters  ``QIO''  stand
       for Quick I/O.

       QIOopen	opens  the file name for reading.  If name is the

								1

QIO(3)							   QIO(3)

       token  of  an  article,	QIOopen	 calls	SMretrieve.    If
       <HAVE_ST_BLKSIZE	 in include/config.h> is defined, QIOopen
       will call stat(2) and use the returned block size; if that
       fails  (or  <HAVE_ST_BLKSIZE  in	 include/config.h> is not
       defined) it will	 use  QIO_BUFFER.   It	returns	 NULL  on
       error, or a pointer to a handle to be used in other calls.
       QIOfdopen performs the same function except that fd refers
       to an already-open descriptor.

       QIOclose	 closes	 the open file and releases any resources
       used by it.

       QIOread returns a pointer to the next line  in  the  file.
       The  trailing  newline will be replaced with a \0.  If EOF
       is reached, an error occurs, or if the line is longer than
       the buffer, QIOread returns NULL.

       After  a successful call to QIOread, QIOlength will return
       the length of the current line.

       The functions QIOtoolong and QIOerror can be called  after
       QIOread	returns	 NULL to determine if there was an error,
       or if the line was too long.  If QIOtoolong  returns  non-
       zero, then the current line did not fit in the buffer, and
       the next call to QIOread will try read  the  rest  of  the
       line.   Long  lines  can	 only  be discarded.  If QIOerror
       returns non-zero, then a serious I/O error occurred.

       QIOtell returns the lseek(2) offset at which the next line
       will start.

       QIOrewind  sets	the read pointer back to the beginning of
       the file.

       QIOfileno returns the descriptor of the open file.

       QIOlength, QIOtoolong, QIOerror,	 QIOtell,  and	QIOfileno
       are implemented as macro's defined in the header file.

EXAMPLE
	      QIOSTATE		   *h;
	      long		   offset;
	      char		   *p;

	      h = QIOopen("/etc/motd", QIO_BUFFER);
	      for (offset = QIOtell(h); (p = QIOread(h)) != NULL; offset = QIOtell(h))
		  printf("At %ld, %s\n", offset, p);
	      if (QIOerror(h)) {
		  perror("Read error");
		  exit(1);
	      }
	      QIOclose(h);

								2

QIO(3)							   QIO(3)

HISTORY
       Written	by  Rich  $alz <rsalz@uunet.uu.net> for InterNet-
       News.  This is revision 1.1.2.1, dated 1999/06/12.

								3

[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server BSDOS

List of man pages available for BSDOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net