| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/Oracle/OCI/include/cdemodp0.h
Go to the documentation of this file.

    00001 /*
    00002  * $Header$
    00003  */
    00004
    00005 /* Copyright (c) 1998, 1999, Oracle Corporation.  All rights reserved.
    00006 */
    00007
    00008 /*
    00009    NAME
    00010      cdemodp0.h - C Demo program for Direct Path api
    00011
    00012    DESCRIPTION
    00013      - Internal data structs, macros, & defines for cdemodp driver.
    00014
    00015    NOTES
    00016      Structures, macros, constants used only by cdemodp.c.
    00017
    00018    MODIFIED   (MM/DD/YY)
    00019    mjaeger     07/14/99 - bug 808870: OCCS: convert tabs, no long lines
    00020    abrumm      12/22/98 - lint
    00021    cmlim       11/17/98 - take away hardcoded MAX_RECLEN; now a session parm
    00022    cmlim       10/06/98 - correct typo
    00023    cmlim       10/02/98 - added externref
    00024    cmlim       09/16/98 - internal data structs, macros, & defines for cdemodp
    00025    cmlim       09/16/98 - Creation (abrumm 04/07/98)
    00026
    00027 */
    00028
    00029
    00030 #ifndef cdemodp0_ORACLE
    00031 # define cdemodp0_ORACLE
    00032
    00033 # include <oratypes.h>
    00034 # include <oci.h>
    00035
    00036 /* partial field context structure, maintained by field setting function */
    00037 struct pctx
    00038 {
    00039   ub1   valid_pctx;                              /* partial context is valid */
    00040   ub4   pieceCnt_pctx;                            /* count of partial pieces */
    00041   ub4   row_pctx;                               /* which row in column array */
    00042   ub4   col_pctx;                            /* which column in column array */
    00043   ub4   len_pctx;                            /* length of this column so far */
    00044   int   fd_pctx;                 /* open file descriptor data is coming from */
    00045   char *fnm_pctx;                                /* filename for data source */
    00046 };
    00047
    00048 /* CLEAR_PCTX(struct pctx pctx)
    00049  *   Macro to clear the partial context state
    00050  */
    00051 #define CLEAR_PCTX(pctx) \
    00052   ((pctx).valid_pctx = FALSE,   (pctx).pieceCnt_pctx = 0,    \
    00053    (pctx).row_pctx = UB4MAXVAL, (pctx).col_pctx = UB4MAXVAL, \
    00054    (pctx).len_pctx = 0,         (pctx).fd_pctx  = -1,        \
    00055    (pctx).fnm_pctx = (char *)0)
    00056
    00057 #define SET_PCTX(pctx, rowoff, coloff, clen, fd, fnm) \
    00058   ((pctx).valid_pctx = TRUE,   (pctx).pieceCnt_pctx++,     \
    00059    (pctx).row_pctx = (rowoff), (pctx).col_pctx = (coloff), \
    00060    (pctx).len_pctx += (ub4)(clen), (pctx).fd_pctx = (fd),  \
    00061    (pctx).fnm_pctx = (fnm))
    00062
    00063 #define LEN_PCTX(pctx) ((pctx).len_pctx)
    00064
    00065 /* Does the input record correspond to the first piece of a row?
    00066  * Note that a row which is not pieced is a first piece too.
    00067  */
    00068 #define FIRST_PIECE(pctx)       \
    00069 ( (pctx).valid_pctx == FALSE || \
    00070  ((pctx).valid_pctx == TRUE  && ((pctx).pieceCnt_pctx == 1)))
    00071
    00072 /* return values from field_set() */
    00073 #define FIELD_SET_COMPLETE   0
    00074 #define FIELD_SET_ERROR      1
    00075 #define FIELD_SET_BUF        2
    00076 #define FIELD_SET_PARTIAL    3
    00077
    00078 /* return values from do_convert() */
    00079 #define CONVERT_SUCCESS      0
    00080 #define CONVERT_ERROR        1
    00081 #define CONVERT_NEED_DATA    2
    00082 #define CONVERT_CONTINUE     3
    00083
    00084 /* return values from do_load() */
    00085 #define LOAD_SUCCESS     0
    00086 #define LOAD_ERROR       1
    00087 #define LOAD_NEED_DATA   2
    00088 #define LOAD_NO_DATA     3
    00089
    00090 /* state values for simple_load() */
    00091 #define RESET             1 /* initial state, reset data structures to empty */
    00092 #define GET_RECORD        2                             /* get input records */
    00093 #define FIELD_SET         3     /* assign fields of input records to columns */
    00094 #define DO_CONVERT        4   /* convert column array input to stream format */
    00095 #define DO_LOAD           5                        /* load the direct stream */
    00096 #define END_OF_INPUT      6                            /* no more input data */
    00097
    00098 /* Secondary buffer sizes for OUTOFLINE fields; no science here, just a WAG */
    00099 #define SECONDARY_BUF_SIZE (1024*1024)           /* size of secondary buffer */
    00100 #define SECONDARY_BUF_SLOP (8*1024)  /* get another field if this much avail */
    00101
    00102 #define STATICF
    00103
    00104 #ifndef externref
    00105 # define externref extern
    00106 #endif
    00107
    00108
    00109 #endif                                              /* cdemodp0_ORACLE */

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines