Annotation of win32/sql/oracle/include/oci/cdemodp0.h, revision 1.1.1.1

1.1       parser      1: /*
                      2:  * $Header: /var/lib/cvsroot/parser3/parser3/src/sql/oracle/oracle32/include/oci/cdemodp0.h,v 1.1 2001/08/22 14:02:18 parser Exp $
                      3:  */
                      4: 
                      5: /* Copyright (c) 1998, 1999, Oracle Corporation.  All rights reserved.
                      6: */
                      7: 
                      8: /*
                      9:    NAME
                     10:      cdemodp0.h - C Demo program for Direct Path api
                     11: 
                     12:    DESCRIPTION
                     13:      - Internal data structs, macros, & defines for cdemodp driver.
                     14: 
                     15:    NOTES
                     16:      Structures, macros, constants used only by cdemodp.c.
                     17: 
                     18:    MODIFIED   (MM/DD/YY)
                     19:    mjaeger     07/14/99 - bug 808870: OCCS: convert tabs, no long lines
                     20:    abrumm      12/22/98 - lint
                     21:    cmlim       11/17/98 - take away hardcoded MAX_RECLEN; now a session parm
                     22:    cmlim       10/06/98 - correct typo
                     23:    cmlim       10/02/98 - added externref
                     24:    cmlim       09/16/98 - internal data structs, macros, & defines for cdemodp
                     25:    cmlim       09/16/98 - Creation (abrumm 04/07/98)
                     26: 
                     27: */
                     28: 
                     29: 
                     30: #ifndef cdemodp0_ORACLE
                     31: # define cdemodp0_ORACLE
                     32: 
                     33: # include <oratypes.h>
                     34: # include <oci.h>
                     35: 
                     36: /* partial field context structure, maintained by field setting function */
                     37: struct pctx
                     38: {
                     39:   ub1   valid_pctx;                              /* partial context is valid */
                     40:   ub4   pieceCnt_pctx;                            /* count of partial pieces */
                     41:   ub4   row_pctx;                               /* which row in column array */
                     42:   ub4   col_pctx;                            /* which column in column array */
                     43:   ub4   len_pctx;                            /* length of this column so far */
                     44:   int   fd_pctx;                 /* open file descriptor data is coming from */
                     45:   char *fnm_pctx;                                /* filename for data source */
                     46: };
                     47: 
                     48: /* CLEAR_PCTX(struct pctx pctx)
                     49:  *   Macro to clear the partial context state
                     50:  */
                     51: #define CLEAR_PCTX(pctx) \
                     52:   ((pctx).valid_pctx = FALSE,   (pctx).pieceCnt_pctx = 0,    \
                     53:    (pctx).row_pctx = UB4MAXVAL, (pctx).col_pctx = UB4MAXVAL, \
                     54:    (pctx).len_pctx = 0,         (pctx).fd_pctx  = -1,        \
                     55:    (pctx).fnm_pctx = (char *)0)
                     56: 
                     57: #define SET_PCTX(pctx, rowoff, coloff, clen, fd, fnm) \
                     58:   ((pctx).valid_pctx = TRUE,   (pctx).pieceCnt_pctx++,     \
                     59:    (pctx).row_pctx = (rowoff), (pctx).col_pctx = (coloff), \
                     60:    (pctx).len_pctx += (ub4)(clen), (pctx).fd_pctx = (fd),  \
                     61:    (pctx).fnm_pctx = (fnm))
                     62: 
                     63: #define LEN_PCTX(pctx) ((pctx).len_pctx)
                     64: 
                     65: /* Does the input record correspond to the first piece of a row?
                     66:  * Note that a row which is not pieced is a first piece too.
                     67:  */
                     68: #define FIRST_PIECE(pctx)       \
                     69: ( (pctx).valid_pctx == FALSE || \
                     70:  ((pctx).valid_pctx == TRUE  && ((pctx).pieceCnt_pctx == 1)))
                     71: 
                     72: /* return values from field_set() */
                     73: #define FIELD_SET_COMPLETE   0
                     74: #define FIELD_SET_ERROR      1
                     75: #define FIELD_SET_BUF        2
                     76: #define FIELD_SET_PARTIAL    3
                     77: 
                     78: /* return values from do_convert() */
                     79: #define CONVERT_SUCCESS      0
                     80: #define CONVERT_ERROR        1
                     81: #define CONVERT_NEED_DATA    2
                     82: #define CONVERT_CONTINUE     3
                     83: 
                     84: /* return values from do_load() */
                     85: #define LOAD_SUCCESS     0
                     86: #define LOAD_ERROR       1
                     87: #define LOAD_NEED_DATA   2
                     88: #define LOAD_NO_DATA     3
                     89: 
                     90: /* state values for simple_load() */
                     91: #define RESET             1 /* initial state, reset data structures to empty */
                     92: #define GET_RECORD        2                             /* get input records */
                     93: #define FIELD_SET         3     /* assign fields of input records to columns */
                     94: #define DO_CONVERT        4   /* convert column array input to stream format */
                     95: #define DO_LOAD           5                        /* load the direct stream */
                     96: #define END_OF_INPUT      6                            /* no more input data */
                     97: 
                     98: /* Secondary buffer sizes for OUTOFLINE fields; no science here, just a WAG */
                     99: #define SECONDARY_BUF_SIZE (1024*1024)           /* size of secondary buffer */
                    100: #define SECONDARY_BUF_SLOP (8*1024)  /* get another field if this much avail */
                    101: 
                    102: #define STATICF
                    103: 
                    104: #ifndef externref
                    105: # define externref extern
                    106: #endif
                    107: 
                    108: 
                    109: #endif                                              /* cdemodp0_ORACLE */

E-mail: