home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / ingres04.lzh / source / libq / IIwrite.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-01-23  |  681 b   |  43 lines

  1. # include    <ingres.h>
  2. # include    <symbol.h>
  3. # include    <pipes.h>
  4. # include    "IIglobals.h"
  5. # include    <sccs.h>
  6.  
  7. SCCSID(@(#)IIwrite.c    8.1    12/31/84)
  8.  
  9.  
  10. /*
  11. **    IIwrite is used to write a string to the
  12. **    quel parser
  13. */
  14.  
  15. IIwrite(str)
  16. char    *str;
  17. {
  18.     register char    *s;
  19.     register int    i;
  20.  
  21.     s = str;
  22. #    ifdef xETR1
  23.     if (IIdebug)
  24.         printf("write:string='%s'\n", s);
  25. #    endif
  26.     if (!IIingpid)
  27.         IIsyserr("no preceding ##ingres statement");
  28.     if (IIin_retrieve)
  29.         IIsyserr("IIwrite:you cannot call ingres while in a retrieve");
  30.  
  31.     if (!IInewqry)
  32.     {
  33.         IIpb_prime(&IIpb, PB_REG);
  34.         IIpb.pb_proc = 1;
  35.         IIpb_put("\0\0\0", 3, &IIpb);
  36.  
  37.         IInewqry = 1;
  38.     }
  39.  
  40.     if ((i = IIlength(s)) != 0)
  41.         IIpb_put(s, i, &IIpb);
  42. }
  43.