CUBRID Engine  latest
method_scan.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * Public defines for value array scans
22  */
23 
24 #ifndef _METHOD_SCAN_H_
25 #define _METHOD_SCAN_H_
26 
27 #ident "$Id$"
28 
29 #if !defined (SERVER_MODE) && !defined (SA_MODE)
30 #error Belongs to server module
31 #endif /* !defined (SERVER_MODE) && !defined (SA_MODE) */
32 
33 #include "dbtype_def.h"
34 #include "method_def.hpp"
35 #ifndef SERVER_MODE
36 #include "work_space.h"
37 #include "cursor.h"
38 #endif /* SERVER_MODE */
39 #include "storage_common.h"
40 #include "thread_compat.hpp"
41 
42 // forward definitions
43 struct qfile_list_id;
44 struct qproc_db_value_list;
45 struct method_sig_list;
47 struct val_list_node;
48 
49 #ifdef SERVER_MODE
50 #define VACOMM_BUFFER_SIZE 4096
51 
52 typedef struct vacomm_buffer VACOMM_BUFFER;
53 struct vacomm_buffer
54 { /* */
55  int length; /* trans length */
56  int status; /* trans status */
57  int error; /* client error */
58  int num_vals; /* number of values */
59  char *area; /* buffer + header */
60  char *buffer; /* buffer */
61  int cur_pos; /* current position */
62  int size; /* size of buffer */
63  int action; /* client action */
64 };
65 #endif
66 
67 #define MAX_XS_SCANBUF_DBVALS 256
68 
69 typedef struct method_info METHOD_INFO;
71 {
72  qfile_list_id *list_id; /* list id for arguments */
73  METHOD_SIG_LIST *method_sig_list; /* method signatures */
74 };
75 
78 { /* value array scanbuf */
79  qproc_db_value_list *dbval_list; /* ptrs into the value array */
80  union
81  { /* ctl info based on type */
83  } s;
84 #ifdef SERVER_MODE
86 #else /* SERVER_MODE */
87  /* These are needed for calling */
88  /* methods in standalone mode */
89  DB_VALUE *vallist; /* values from the input list file */
90  DB_VALUE **valptrs; /* ptrs to the above values */
91  int *oid_cols; /* OID columns in list file */
92  CURSOR_ID crs_id; /* cursor id */
93  int val_cnt; /* number of values in vallist */
94 #endif /* SERVER_MODE */
95 };
96 
97 extern int method_open_scan (THREAD_ENTRY * thread_p, METHOD_SCAN_BUFFER * scan_buf, qfile_list_id * list_id,
99 extern int method_close_scan (THREAD_ENTRY * thread_p, METHOD_SCAN_BUFFER * scan_buf);
100 extern SCAN_CODE method_scan_next (THREAD_ENTRY * thread_p, METHOD_SCAN_BUFFER * scan_buf, val_list_node * val_list);
101 #endif /* _METHOD_SCAN_H_ */
SCAN_CODE
SCAN_CODE method_scan_next(THREAD_ENTRY *thread_p, METHOD_SCAN_BUFFER *scan_buf, val_list_node *val_list)
Definition: method_scan.c:237
CURSOR_ID crs_id
Definition: method_scan.h:92
void THREAD_ENTRY
int method_open_scan(THREAD_ENTRY *thread_p, METHOD_SCAN_BUFFER *scan_buf, qfile_list_id *list_id, method_sig_list *method_sig_list)
Definition: method_scan.c:169
DB_VALUE * vallist
Definition: method_scan.h:89
METHOD_SIG_LIST * method_sig_list
Definition: method_scan.h:73
METHOD_INFO method_ctl
Definition: method_scan.h:82
int method_close_scan(THREAD_ENTRY *thread_p, METHOD_SCAN_BUFFER *scan_buf)
Definition: method_scan.c:202
static void error(const char *msg)
Definition: gencat.c:331
qfile_list_id * list_id
Definition: method_scan.h:72
qproc_db_value_list * dbval_list
Definition: method_scan.h:79
DB_VALUE ** valptrs
Definition: method_scan.h:90