head     1.2;
branch   ;
access   ;
symbols  Version_2_1:1.2 C_Demo_1:1.2;
locks    ; strict;
comment  @@;


1.2
date     89.09.05.17.16.22;  author mao;  state C_Demo_1;
branches ;
next     1.1;

1.1
date     89.02.16.00.14.09;  author dillon;  state Stab;
branches ;
next     ;


desc
@luis/ywang new libpqcl
@


1.2
log
@Working version of C-only demo
@
text
@;;;
;;; Postgres/CommonLISP interface
;;;
;;; Copyright (c) 1986 Regents of the University of California
;;; 
;;; Permission to use, copy, modify, and distribute this software and its
;;; documentation for any purpose and without fee is hereby granted,
;;; provided that the above copyright notice appear in all copies and
;;; that both that copyright notice and this permission notice appear in
;;; supporting documentation, and that the name of the University of
;;; California not be used in advertising or publicity pertaining to
;;; distribution of the software without specific, written prior
;;; permission.  The University of California makes no representations
;;; about the suitability of this software for any purpose.  It is
;;; provided "as is" without express or implied warranty.
;;; 
;;; $Author: dillon $
;;; $Source: RCS/blocks.cl,v $
;;; $Revision: 1.1 $
;;; $Date: 89/02/16 00:14:09 $
;;;

(in-package 'libpq :use '(lisp excl))

;;;
;;; Data structures maintained by functions in this file are used
;;; to store the tuple data fetched from the POSTGRES backend.
;;;


;;; 
;;; Routines maintaining blocks storing portal information -- pblocks.
;;;

(defvar PBlist nil)
(defconstant PBsize 64)

;;;
;;; Append a pblock to PBlist
;;;
(defun putpblock (pblock) 
  (push pblock PBlist))

;;;
;;; Get a pblock from PBlist
;;;
(defun getpblock ()
  (if (not (null PBlist))
      (pop PBlist)
    (make-array PBsize :element-type t)))


;;; 
;;; Routines maintaining blocks storing type information -- tblocks.
;;;

(defvar TBlist nil)
(defconstant TBsize 128)

;;;
;;; Append a tblock to TBlist
;;;
(defun puttblock (tblock) 
  (push tblock TBlist))

;;;
;;; Get a tblock from TBlist
;;;
(defun gettblock()
  (if (not (null TBlist))
      (pop TBlist)
    (make-array TBsize :element-type t)))

;;; 
;;; Routines maintaining blocks storing tuple indexes -- iblocks.
;;;

(defvar IBlist nil)
(defconstant IBsize 128)

;;;
;;; Append an iblock to IBlist
;;;
(defun putiblock (iblock) 
  (push iblock IBlist))

;;;
;;; Get an iblock from IBlist
;;;
(defun getiblock ()
  (if (not (null IBlist))
      (pop IBlist)
    (make-array IBsize :element-type t)))


;;; 
;;; Routines maintaining tuple value blocks -- vblocks.
;;;

(defvar VBlist nil)
(defconstant VBsize 4096)

;;;
;;; Append a vblock to VBlist
;;;
(defun putvblock (vblock) 
  (push vblock VBlist))

;;;
;;; Get a vblock from VBlist
;;;

(defun getvblock ()
  (if (not (null VBlist))
      (pop VBlist)
    (make-array VBsize :element-type 'string-char)))

;(defun getvblock ()
;  (if (not (null VBlist))
;      (pop VBlist)
;    (makevblock VBsize)))




@


1.1
log
@Initial revision
@
text
@d17 4
a20 4
;;; $Author: ywang $
;;; $Source: /usr2/postgres/src/libpqcl/RCS/blocks.cl,v $
;;; $Revision: 2.2 $
;;; $Date: 88/09/13 15:08:52 $
@
