dbserver.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 #ifndef __dbserverH__
10 #define __dbserverH__
11 
12 /*----------------------------------------------------------------------+
13 | |
14 | Required include files. |
15 | |
16 +----------------------------------------------------------------------*/
17 #include "dbdefs.h"
18 #include "dberrs.h"
19 #include "mselems.h"
20 
21 #include "database.h"
22 
23 /*----------------------------------------------------------------------+
24 | |
25 | SQL statement types. |
26 | |
27 +----------------------------------------------------------------------*/
28 #define MALFORMED_STMT 1
29 #define UNKNOWN_STMT 2
30 #define SELECT_STMT 3
31 #define UPDATE_STMT 4
32 #define CONNECT_STMT 5
33 #define DISCONNECT_STMT 6
34 #define SQLFORMS_STMT 7
35 #define RELOAD_STMT 8
36 #define INSERT_STMT 9
37 #define COMMIT_STMT 10
38 #define ROLLBACK_STMT 11
39 #define HANDLES_STMT 12
40 #define DELETE_STMT 13
41 
42 /*----------------------------------------------------------------------+
43 | |
44 | Database forms modes. |
45 | |
46 +----------------------------------------------------------------------*/
47 #define FORMS_NONE 0x0000
48 #define FORMS_DIALOG 0x0101
49 #define FORMS_TEXT 0x0001
50 
51 /*----------------------------------------------------------------------+
52 | |
53 | Miscellaneous defines. |
54 | |
55 +----------------------------------------------------------------------*/
56 #define MAX_MB_CHAR_LEN 10 /* MB character maximum */
57 #define APPEND_LINK 0 /* add linkage to existing links */
58 #define REPLACE_LINK 1 /* replace linkages with current link */
59 #define ACTIVATE_FILTER 1 /* turn on fence filter */
60 #define DEACTIVATE_FILTER 2 /* turn off fence filter */
61 #define MAX_DB_APPS 126 /* maximum number of application tasks */
62 #define DB_MSG_CHAR_DATA 1 /* set type of data in msg to chars */
63 #define DB_MSG_SHORT_DATA 2 /* set type of data in msg to shorts */
64 #define DB_BUFFER_SIZE 2048 /* size (bytes) of request buffer */
65 #define DA_DATA_SIZE (DB_BUFFER_SIZE - sizeof (long))
66  /* size of displayable attribute buffer */
67 #define DB_VERSION_5 1 /* indicates Version 5 of MS */
68 #define MAX_UCM_FIELDS 32 /* max columns for DBREAD/DBWRITE */
69 #define MAX_LINES 65535 /* DA; maximum lines */
70 #define MAX_CHARS 2048 /* DA; maximum chars */
71 #define NEWLINE 10 /* ASCII newline */
72 #define CARRIAGERETURN 13 /* ASCII carriage return */
73 #define MAX_STATEMENT 2048 /* maximum SQL statement size */
74 #define DB_MAX_ERROR_DISPLAY MAX_ERROR_LENGTH
75 
76 /* Next mode defines */
77 #define NEXT_MODE_MAX 1 /* Locks Table to add Max mslink */
78 /*#define NEXT_MODE_OCC 2 RIS - use occurence column !!!OBSOLETE!!! */
79 #define NEXT_MODE_LARGEST 3 /* Don't use locking to add the mslink */
80 #define DB_MAX_ATTEMPTS 10 /* Default maximum number of Attempts to update mslink */
81 
82 
83 /*----------------------------------------------------------------------+
84 | |
85 | MicroStation command numbers. |
86 | |
87 +----------------------------------------------------------------------*/
88 #define ATTACH_AE 239
89 #define DELETE_LINK 240
90 #define REVIEW_SINGLE 241
91 #define FENCE_REPORT 243
92 #define DEFINE_AE 246
93 #define DEFINE_DB 247
94 #define EDIT_AE 248
95 #define LOCATE_AE 249
96 #define SHOW_AE 250
97 #define FENCE_ATTACH 255
98 #define FENCE_DETACH 256
99 #define CREATE_ENTITY 257
100 #define ATTACH_DA 399
101 #define LOAD_DA 400
102 #define FENCE_LOAD 401
103 #define GENERATE_DA 402
104 
105 /*----------------------------------------------------------------------+
106 | |
107 | Server message types. |
108 | |
109 +----------------------------------------------------------------------*/
110 #define FIRST_MESSAGE 0 /* request for 1st message on queue */
111 #define DB_USTN_MSG 1 /* MicroStation request for services */
112 #define DB_USTN_ACK 2 /* server response to DB_USTN_MSG */
113 #define DB_APP_MSG 16 /* application request for services */
114 #define DB_APP_ACK 17 /* server response to DB_APP_MSG */
115 
116 /*----------------------------------------------------------------------+
117 | |
118 | MicroStation command window defines. |
119 | |
120 +----------------------------------------------------------------------*/
121 #define NO_MESSAGE 0
122 #define NO_FIELD 0
123 #define STATUS_FIELD 1
124 #define MESSAGE_FIELD 2
125 #define COMMAND_FIELD 3
126 #define PROMPT_FIELD 4
127 #define KEYIN_FIELD 5
128 #define ERROR_FIELD 6
129 
130 /*----------------------------------------------------------------------+
131 | |
132 | Database server requests. |
133 | |
134 | These are the possible database server requests. These are requests|
135 | for database services which originate within MicroStation and are |
136 | passed to the database server through a message queue. The server |
137 | fills the request and then replies with a message through the same |
138 | message queue. |
139 +----------------------------------------------------------------------*/
140 #define DB_STARTUP 1 /* start up and initialize database */
141 #define DB_TERMINATE 2 /* terminate database server */
142 #define DB_ATTACH_AE 10 /* attach the AE to an element */
143 #define DB_OPEN_REPORT 11 /* inititialize a database fence report */
144 #define DB_CLOSE_REPORT 12 /* close a database fence report */
145 #define DB_ELEMENT_REPORT 13 /* process element for fence report */
146 #define DB_REVIEW_ATTRIBUTES 14 /* review attributes of an element */
147 #define DB_DETACH_LINK 15 /* remove database linkages from element */
148 #define DB_SELECT_AE 16 /* select the active entity graphically */
149 #define DB_DELETE_ELEMENT 18 /* process linkages for deleted element */
150 #define DB_ELEMENT_FILTER 19 /* filter function for single element op */
151 #define DB_FENCE_FILTER 20 /* database fence filter function */
152 #define DB_UCM_READ 21 /* process user command DBREAD operator */
153 #define DB_UCM_WRITE 22 /* process user command DBWRITE operator */
154 #define DB_INITIALIZE_TCB 24 /* set up TCB during drawing init */
155 #define DB_DEFINE_APPL_ELM 25 /* define application element for scan */
156 #define DB_PROCESS_APPL_ELM 26 /* process application element */
157 #define DB_SHUTDOWN 28 /* shut down and close the database */
158 #define DB_COPY_ELEMENT 30 /* copy element */
159 #define DB_LOGIN 41 /* MicroStation log on message */
160 #define DB_UCM_ADD 46 /* process user command DBADD operator */
161 #define DB_UCM_DELETE 47 /* process user command DBDELETE operator*/
162 #define DB_ATTACH_DA 48 /* attach linkage to existing text node */
163 #define DB_LOAD_DA 49 /* load linkage text to text node */
164 #define DB_GENERATE_DA 50 /* create new textnodes with linkage text*/
165 
166 /*----------------------------------------------------------------------+
167 | |
168 | Server keyin requests. |
169 | |
170 +----------------------------------------------------------------------*/
171 #define DB_PROCESS_KEYIN 3 /* process a direct database keyin */
172 #define DB_OPTIONS 4 /* database setup tutorial */
173 #define DB_DEFINE 5 /* process a DB= keyin */
174 #define DB_FIND_ENTITY 6 /* locate a record and setup as AE */
175 #define DB_EDIT_AE 7 /* edit the active entity */
176 #define DB_CREATE_ENTITY 8 /* add a record to the database */
177 #define DB_SHOW_AE 9 /* AE=$, display the active entity */
178 #define DB_DEFINE_SEARCH 17 /* process a DS= fence search keyin */
179 #define DB_LINKAGE_MODE 23 /* process an ACTIVE LINK <> keyin */
180 #define DB_DELETE_MODE 27 /* process SET DELETE <> keyin */
181 #define DB_REVIEW_TABLE 29 /* process RA= keyin */
182 #define DB_REPORT_SPEC 31 /* process RS= keyin */
183 #define DB_FORM_COMMAND 59 /* process FORM keyin */
184 #define DB_FORM_DISPLAY 60 /* display form */
185 #define DB_CONFIRM_MODE 65 /* confirmation mode */
186 #define DB_INSERT_AE 66 /* AE = keyin */
187 #define DB_AUTOCOMMIT 67 /* auto commit SQL transactions */
188 #define DB_RELEASE 68 /* release resources on disconnect */
189 #define DB_MDLDIALOGS 69 /* use MDL dialogs for query */
190 #define DB_DEBUG 71 /* server debug mode */
191 
192 /*----------------------------------------------------------------------+
193 | |
194 | Server application requests. |
195 | |
196 +----------------------------------------------------------------------*/
197 #define DB_NULREC 32 /* create a null record and set up as AE */
198 #define DB_GETREC 33 /* retrieves a record and sets up as AE */
199 #define DB_GETFLD 34 /* extracts a field from the AE */
200 #define DB_EDTFLD 35 /* edits a field of the AE */
201 #define DB_NEWREC 36 /* writes the AE as a new record */
202 #define DB_UPDREC 37 /* updates a given record with the AE */
203 #define DB_SCNENT 38 /* scans for a record */
204 #define DB_DELREC 39 /* deletes a record from the database */
205 #define DB_QUEUE 40 /* creates/removes message queues */
206 #define DB_GETFMT 42 /* retrieve type and length of column */
207 #define DB_GETMAX 43 /* retrieve number of columns and rows */
208 #define DB_FLDNAME 44 /* retrieve column names of a table */
209 #define DB_JNDCOL 45 /* codelist lookup */
210 
211 /*----------------------------------------------------------------------+
212 | |
213 | Server MDL requests. |
214 | |
215 +----------------------------------------------------------------------*/
216 #define DB_DECODE_LINK 51 /* decode user data linkage */
217 #define DB_READ_COLUMN 52 /* read column from table */
218 #define DB_WRITE_COLUMN 53 /* write column from table */
219 #define DB_LARGEST_MSLINK 54 /* largest MSLINK key in table */
220 #define DB_BUILD_LINK 55 /* construct linkage */
221 #define DB_DELETE_ROW 56 /* delete row from table */
222 #define DB_ADD_ROW 57 /* add a new row to a table */
223 #define DB_QUERY 58 /* query the database */
224 #define DB_DESCRIBE_TABLE 61 /* describe a database table */
225 #define DB_OPEN_CURSOR 62 /* open cursor for query by mdl */
226 #define DB_FETCH_ROW 63 /* fetch row from a table */
227 #define DB_CLOSE_CURSOR 64 /* close cursor used by mdl */
228 #define DB_ERRORTEXT 70 /* retrieve error text */
229 #define DB_BUILD_DA_LINK 72 /* build DA linkage */
230 #define DB_AE_FROM_LINK 73 /* setup AE from linkage */
231 #define DB_ENCODE_LINK 74 /* convert linkage to external format */
232 #define DB_CREATE_ENT_ROW 75 /* create new entity row with new mslink */
233 #define DB_REGISTER_QUERY 76 /* load UCM registers with query */
234 #define DB_COPY_ROW 77 /* copy existing row and generate MSLINK */
235 #define DB_GENERIC 78 /* a general request that developers can define */
236 
237 /*----------------------------------------------------------------------+
238 | |
239 | Scan comparison codes. |
240 | |
241 +----------------------------------------------------------------------*/
242 #define CC_EQ 1
243 #define CC_LT 2
244 #define CC_GT 3
245 #define CC_NE 4
246 #define CC_LE 5
247 #define CC_GE 6
248 
249 /*----------------------------------------------------------------------+
250 | |
251 | Cursor Request Types |
252 | |
253 +----------------------------------------------------------------------*/
254 #define REQUEST_WITHOUT_CURSORID 0
255 #define REQUEST_WITH_CURSORID 1
256 
257 /*----------------------------------------------------------------------+
258 | |
259 | Structure typedefs. |
260 | |
261 +----------------------------------------------------------------------*/
262 /* RIS server still uses old external program methods */
263 struct DBClient
264  {
265 #if defined (RIS)
266  WChar name[60]; /* client program's name */
267  int pid; /* process id of client */
268  int active; /* client task active */
269  int messagekey; /* key for the message path to/from the process */
270  int msqid; /* message queue id */
271 #else
272  int active; /* client task active */
273  void *extProgDescrP; /* descriptor for the client */
274 #endif
275  };
276 
277 // Persistent data structure stored in the DGN file
279  {
280  DgnPlatform::Elm_hdr ehdr; /* element header */
281  char schema[80]; /* control file name */ // CHAR_OK
282  char udlPath[256]; /* full path and file name */ // CHAR_OK
283  short extrawords[16]; /* a little extra */
284  };
285 
286 struct UCMArg
287  {
288  WChar *field; /* field name */
289  WChar *value; /* field value (DBWRITE only */
290 #if defined (DBASE)
291  short fieldnum; /* index of field in database structure */
292  short fieldoffset; /* offset of field in record */
293 #endif
294  };
295 
297  {
298  long code; /* return code status of request */
299  long msg_fld; /* message field to output message text */
300  WChar msg[DB_MAX_ERROR_DISPLAY]; /* message text; valid if msg_fld non-zero */
301  };
302 
304  {
305  long type; /* type of message */
306  size_t length; /* number of bytes in message */
307  ProcessID sendpid; /* sending task's PID */
308  long request; /* database request type */
309  RequestStatus status; /* return status */
310  bool isCallocd; /* whether or not data buffer was callocd */
311  size_t callocdLength; /* if isCallocd, this is the callocd length */
312  long databaseID; /* id of target database (FUTURE EXPANSION) */
313  };
314 
315 struct DBMessage
316  {
317  RequestHeader hdr; /* message header */
318  union /* message data */
319  {
321  short *shortdata;
322  } u;
324  };
325 
327  {
328  long type; /* type of message */
329  long request; /* database request type */
330  long length; /* number of bytes in message */
331  long sendpid; /* sending task's PID */
332  RequestStatus status; /* return status */
333  };
334 
336  {
337  Ver4RequestHeader hdr; /* message header */
338  union /* message data */
339  {
342  } u;
343  };
344 
346  {
347  long type; /* type of message */
348  long length; /* number of bytes in message */
349  ProcessID sendpid; /* sending task's PID */
350  long request; /* database request type */
351  RequestStatus status; /* return status */
352  };
353 
355  {
356  Ver42RequestHeader hdr; /* message header */
357  union /* message data */
358  {
361  } u;
362  };
363 
365  {
366  bool connectedToDB; /* if a user is connected to the database */
367  bool active; /* if the database server is up */
368  };
369 
371  {
372  struct TableDescr *next; /* next table in the list */
373  WChar name[MAX_TABLE_LENGTH+1]; /* table name */
374  UShort entity; /* entity number */
375  WChar screenform[MAX_SCREEN_FORM+1]; /* screen form */
376  WChar reporttable[MAX_REPORT_TABLE+1]; /* output report table */
377  WChar sqlreview[MAX_SQL_REVIEW+1]; /* SQL SELECT for review */
378  WChar fencefilter[MAX_FENCE_FILTER+1]; /* SQL SELECT for fence filter */
379  WChar dastable[MAX_DAS_TABLE+1]; /* table with DAS info */
381  };
382 
384  {
385  struct
386  {
387  int valid; /* currently attached database is valid */
388  WChar filename[MAXFILELENGTH]; /* database file specification */
389  TableDescr *table; /* pointer to linked list of tables */
390  int nextMode; /* RIS only - mode for max mslink */
391  int serverType; /* brand of database server */
392  int useTempTables; /* use temp AE tables */
393  int randomMsforms; /* using randomly-generated msforms table name */
394  int xbaseExclusive;/* XBASE only - exclusive mode - no locking */
395  int maxAttempts; /* Max insert/update attempts for new mslink */
396  } db;
397  struct
398  {
399  short type; /* SQL statement type */
400  long tuples; /* tuples returned from last query */
401  short active; /* is there a query currently active? */
402  } query;
403  long rowsProcessed; /* rows processed for any sql statement */
404  struct
405  {
406  int (*queryInitialize)(); /* prepare for query */
407  int (*queryCleanUp)(); /* clean up after query */
408  int (*executeSQL)(); /* execute SQL statement (non SELECT) */
409  int (*processRow)(); /* process returned row from query */
410  } statefunc;
411  };
412 
413 typedef short FormToggle;
414 
416  {
417  short columns;
418  short rows;
419  short items;
420  };
421 
423  {
426  };
427 
429  {
430  short columns;
431  short rows;
432  short items;
433  short continued;
434  };
435 
437  {
440  };
441 
443  {
444  short columns;
445  short rows;
446  WChar data[DB_BUFFER_SIZE - (sizeof(short) * 2)];
447  };
448 
449 struct DBLogin
450  {
451  WChar taskname[132]; /* process name */
452  ProcessID pid; /* process ID */
453  };
454 
455 /* MicroCSL request/acknowledge messages */
457  {
458  UShort entity; /* entity number of table */
459  UInt32 mslink; /* MSLINK key of row to delete */
460  };
461 
463  {
464  UShort entity; /* entity number of table */
465  };
466 
468  {
469  UShort entity; /* entity number of table */
470  UInt32 mslink; /* MSLINK key of row to establish as AE */
471  };
472 
474  {
475  UShort entity; /* entity number of table */
476  UInt32 mslink; /* MSLINK key of record to read */
477  UShort fieldno; /* field number to read */
478  };
479 
481  {
482  WChar value[1]; /* value of field requested */
483  };
484 
486  {
487  UShort entity; /* entity number of table */
488  UInt32 mslink; /* MSLINK key of record to write */
489  UShort fieldno; /* field number to write */
490  WChar value[1]; /* value of field to write */
491  };
492 
494  {
495  UInt32 mslink; /* MSLINK key of row added to database */
496  };
497 
499  {
500  UInt32 mslink; /* MSLINK key of row to update with AE */
501  };
502 
504  {
505  short fieldno; /* field number to compare */
506  short compcode; /* comparison code */
507  union {
508  WChar *value; /* pointer to field value */
509  long offset; /* offset of field value in buffer */
510  } u;
511  } ;
512 
514  {
515  UShort entity; /* entity number to scan */
516  UInt32 startrec; /* starting MSLINK key to begin scan */
517  short numfields; /* number of fields to compare */
518  ScanColumn scanlist[1]; /* list of field criteria */
519  };
520 
522  {
523  UInt32 mslink; /* MSLINK key of record located */
524  };
525 
527  {
528  UShort entity; /* entity number of table */
529  UShort column; /* column number to retrieve */
530  };
531 
533  {
534  UShort type; /* data type of column */
535  UShort length; /* length of column in bytes */
536  };
537 
539  {
540  UShort entity; /* entity number of table */
541  };
542 
543 struct GetMaxAck
544  {
545  UShort columns; /* number of columns in the table */
546  UInt32 rows; /* number of rows in the table */
547  };
548 
550  {
551  UShort entity; /* entity number of table */
552  UShort width; /* max width of column names */
553  UShort number; /* max number of columns to be returned */
554  };
555 
557  {
558  UShort number; /* number of column names in buffer */
559  WChar names[1]; /* column names in table */
560  };
561 
563  {
564  UShort entity; /* entity number of table */
565  UShort column; /* column number of codelist value */
566  UInt32 mslink; /* MSLINK column of row */
567  };
568 
570  {
571  WChar value[1]; /* codelist value */
572  };
573 
574 struct DABuffer
575  {
576  long numlines;
578  };
579 
580 /* MDL request/acknowledge messages */
582  {
583  WChar tableName[64]; /* table name */
584  WChar columnName[64]; /* column name to read */
585  UInt32 mslinkKey; /* MSLINK key of column to read */
586  };
587 
589  {
590  WChar value[256]; /* column value */
591  };
592 
594  {
595  WChar tableName[64]; /* table name */
596  WChar columnName[64]; /* column name to write */
597  UInt32 mslinkKey; /* MSLINK key of column to write */
598  WChar columnValue[256]; /* column name to write */
599  };
600 
602  {
603  WChar tableName[64]; /* table name */
604  UInt32 mslinkKey; /* MSLINK key of column to delete */
605  };
606 
608  {
609  short linkType; /* linkage type (ORACLE, IX) */
610  LinkProps props; /* properties of the linkage */
611  WChar tableName[64]; /* table name */
612  UInt32 mslinkKey; /* MSLINK key of column */
613  short dasType; /* displayable attribute type */
614  };
615 
617  {
618  short *attributes; /* new attributes */
619  size_t length; /* length (bytes) of the attribute block */
620  int mode; /* APPEND or REPLACE */
621  };
622 
624  {
627  };
628 
630  {
634  };
635 
636 /* This structure is used for version 4 compatibility ONLY */
637 struct DBServer
638  {
640  int active;
641  };
642 
643 /*----------------------------------------------------------------------+
644 | |
645 | General linkage formats. |
646 | |
647 +----------------------------------------------------------------------*/
648 #if !defined (GENERICLINK)
649 typedef struct
650  {
651 #if defined (BITFIELDS_REVERSED)
652  UShort info:1; /* boolean: informational linkage */
653  UShort remote:1; /* boolean: remote linkage */
654  UShort modified:1; /* boolean: user linkage has been modified */
655  UShort user:1; /* boolean: user data linkage */
656  UShort linkageClass:4; /* linkage family class */
657  UShort words:8; /* words to follow in linkage */
658 #else
659  UShort words:8; /* words to follow in linkage */
660  UShort linkageClass:4; /* linkage family class */
661  UShort user:1; /* boolean: user data linkage */
662  UShort modified:1; /* boolean: user linkage has been modified */
663  UShort remote:1; /* boolean: remote linkage */
664  UShort info:1; /* boolean: informational linkage */
665 #endif
666  UShort primary_id; /* User ID number */
667  UShort secondary_id; /* Secondary ID number */
668 
669  UShort entity; /* entity number */
670  UInt32 mslink; /* MSLINK field value */
671  byte dastype; /* displayable attribute type */
672  byte pad[3]; /* user linkages are a multiple of 4 */
674 #define GENERICLINK
675 #endif
676 
677 /*----------------------------------------------------------------------+
678 | |
679 | DMRS linkage format |
680 | |
681 +----------------------------------------------------------------------*/
682 #if !defined (DMRSLINK)
683 typedef struct
684  {
685 #if defined (BITFIELDS_REVERSED)
686  UShort info:1; /* boolean: informational linkage */
687  UShort remote:1; /* boolean: remote linkage */
688  UShort modified:1; /* boolean: user linkage has been modified */
689  UShort user:1; /* boolean: user data linkage */
690  UShort linkageClass:4; /* linkage family class */
691  UShort type:8; /* displayable attribute type */
692 #else
693  UShort type:8; /* displayable attribute type */
694  UShort linkageClass:4; /* linkage family class */
695  UShort user:1; /* boolean: user data linkage */
696  UShort modified:1; /* boolean: user linkage has been modified */
697  UShort remote:1; /* boolean: remote linkage */
698  UShort info:1; /* boolean: informational linkage */
699 #endif
700  UShort entity; /* entity number */
701  UShort occ_low; /* low word of the 24 bit occurence number */
702  byte occ_high; /* high byte of the occurence number */
703  byte reuse; /* reuse counter */
704  } DMRS_link, DMRSLink;
705 #define DMRSLINK
706 #endif
707 
708 /*----------------------------------------------------------------------+
709 | |
710 | Informix linkage format. |
711 | |
712 +----------------------------------------------------------------------*/
713 #if !defined (IXLINKAGE)
715 #define IXLINKAGE
716 #endif
717 
718 /*----------------------------------------------------------------------+
719 | |
720 | dBASE linkage format. |
721 | |
722 +----------------------------------------------------------------------*/
723 #if !defined (DBLINKAGE)
725 #define DBLINKAGE
726 #endif
727 
728 /*----------------------------------------------------------------------+
729 | |
730 | Oracle linkage format. |
731 | |
732 +----------------------------------------------------------------------*/
733 #if !defined (ORACLELINKAGE)
735 #define ORACLELINKAGE
736 #endif
737 
738 /*----------------------------------------------------------------------+
739 | |
740 | MDL call back message structure. |
741 | |
742 | Changes from 256 to 640 3/24/94 to handle larger callbacks from DOS |
743 | Oracle server. Duplicate definition, see ipdfpi.h! |
744 | |
745 +----------------------------------------------------------------------*/
746 #if !defined (MDLCALLBACK_BUFFER)
747 #define MDLCALLBACK_BUFFER 640
749  {
750  short status;
751  short dataLength;
753  };
754 #endif
755 
756 /*----------------------------------------------------------------------+
757 | |
758 | MicroCSL to MDL callback defines. |
759 | |
760 +----------------------------------------------------------------------*/
761 #define CALLBACK_DisplayDebugMsg 1
762 #define CALLBACK_DisplayInfoBox 2
763 
765  {
766  short requestType;
767  WChar data[MDLCALLBACK_BUFFER - sizeof(int)];
768  };
769 
770 /*----------------------------------------------------------------------+
771 | |
772 | Defines for multi-message fetches. |
773 | |
774 +----------------------------------------------------------------------*/
775 /* State definitions */
776 #define PACK_FINISHED 1
777 #define PACK_COL_NAMES 2
778 #define PACK_COL_TYPES 3
779 #define PACK_COL_LENGTHS 4
780 #define PACK_COL_DATA 5
781 
782 #define PACK_ABORT 1
783 
784 /* state information for fetches and describes (MDL side) */
786  {
788  short state;
790  };
791 
792 /* state information for fetches and describes (server side) */
794  {
795  short active;
796  short rowActive;
797  short state;
799  };
800 
801 /*----------------------------------------------------------------------+
802 | |
803 | cursor structures (MS -> Server.ma) |
804 | |
805 +----------------------------------------------------------------------*/
807  {
808  short type;
810  size_t queryLength; /* server.ma -> MS this is length of open cursor describe */
811  WChar query[1]; /* and this is the result from the describe */
812  };
813 
815  {
816  bool isActive;
817  size_t length;
819  };
820 
821 #endif /* __dbserverH__ */
short compcode
Definition: dbserver.h:506
Definition: dbserver.h:315
struct TableDescr * next
Definition: dbserver.h:372
long type
Definition: dbserver.h:305
Definition: dbserver.h:521
WChar query[1]
Definition: dbserver.h:811
Definition: dbserver.h:532
short status
Definition: dbserver.h:750
int active
Definition: dbserver.h:272
Definition: dbserver.h:456
WChar reporttable[64+1]
Definition: dbserver.h:376
Generic_link dB_link
Definition: dbserver.h:724
#define MAX_DAS_TABLE
Definition: dbdefs.r.h:61
short extrawords[16]
Definition: dbserver.h:283
short rows
Definition: dbserver.h:418
WChar value[1]
Definition: dbserver.h:482
UInt32 mslink
Definition: dbserver.h:625
struct SQLStatedata::@180 db
WChar names[1]
Definition: dbserver.h:559
long sendpid
Definition: dbserver.h:331
WChar data[2048-sizeof(Ver4DescrMessageHdr)]
Definition: dbserver.h:439
WChar tableName[64]
Definition: dbserver.h:611
Definition: dbserver.h:629
Definition: dbserver.h:607
long tuples
Definition: dbserver.h:400
#define DA_DATA_SIZE
Definition: dbserver.h:65
short processedForState
Definition: dbserver.h:798
Ver4RequestHeader hdr
Definition: dbserver.h:337
Definition: dbserver.h:764
Definition: dbserver.h:467
Definition: dbserver.h:370
int active
Definition: dbserver.h:640
long msg_fld
Definition: dbserver.h:299
wchar_t WChar
Definition: Bentley.h:223
Definition: dbserver.h:335
Definition: MicroStation.r.h:170
union ScanColumn::@183 u
Definition: dbserver.h:383
WChar columnName[64]
Definition: dbserver.h:596
short * shortdata
Definition: dbserver.h:321
UInt32 mslinkKey
Definition: dbserver.h:585
UShort type
Definition: dbserver.h:534
short shortdata[2048/2]
Definition: dbserver.h:360
long descriptionLength
Definition: dbserver.h:632
short columns
Definition: dbserver.h:417
short descrAllocated
Definition: dbserver.h:787
Definition: dbserver.h:354
LinkProps props
Definition: dbserver.h:610
short fieldno
Definition: dbserver.h:505
short dasType
Definition: dbserver.h:613
int maxAttempts
Definition: dbserver.h:395
UInt32 mslink
Definition: dbserver.h:495
#define MAX_SQL_REVIEW
Definition: dbdefs.r.h:59
int(* queryCleanUp)()
Definition: dbserver.h:407
Definition: dbserver.h:345
struct Generic_link GenericLink
Definition: dbserver.h:549
short rows
Definition: dbserver.h:445
UShort entity
Definition: dbserver.h:374
bool isActive
Definition: dbserver.h:816
TableDescr * table
Definition: dbserver.h:389
Definition: dbserver.h:428
UShort fieldno
Definition: dbserver.h:477
short state
Definition: dbserver.h:797
Generic_link OracleLink
Definition: dbserver.h:734
bool active
Definition: dbserver.h:367
Definition: dbserver.h:415
Definition: dbserver.h:278
Definition: DgnPlatform.h:608
WChar * field
Definition: dbserver.h:288
WChar dastable[32+1]
Definition: dbserver.h:379
Definition: dbserver.h:326
Definition: dbserver.h:543
#define DB_BUFFER_SIZE
Definition: dbserver.h:64
#define MDLCALLBACK_BUFFER
Definition: dbserver.h:747
Definition: dbserver.h:806
UShort entity
Definition: dbserver.h:626
bool connectedToDB
Definition: dbserver.h:366
Generic_link IXLink
Definition: dbserver.h:714
#define MAX_FENCE_FILTER
Definition: dbdefs.r.h:60
int(* executeSQL)()
Definition: dbserver.h:408
size_t length
Definition: dbserver.h:619
size_t length
Definition: dbserver.h:817
ProcessID sendpid
Definition: dbserver.h:307
Definition: dbserver.h:785
WChar tableName[64]
Definition: dbserver.h:603
Definition: dbserver.h:436
Definition: dbserver.h:637
UShort width
Definition: dbserver.h:552
Definition: dbserver.h:793
WChar msg[512]
Definition: dbserver.h:300
long request
Definition: dbserver.h:329
Generic_link Oracle_link
Definition: dbserver.h:734
WChar data[1]
Definition: dbserver.h:425
Definition: dbserver.h:303
short active
Definition: dbserver.h:401
uint32_t UInt32
Definition: Bentley.r.h:128
short linkType
Definition: dbserver.h:609
Ver4DescrMessageHdr hdr
Definition: dbserver.h:438
int xbaseExclusive
Definition: dbserver.h:394
WChar chardata[2048]
Definition: dbserver.h:359
Definition: dbserver.h:480
WChar dummy[8]
Definition: dbserver.h:639
char udlPath[256]
Definition: dbserver.h:282
DgnPlatform::Elm_hdr ehdr
Definition: dbserver.h:280
#define MAX_REPORT_TABLE
Definition: dbdefs.r.h:58
UShort entity
Definition: dbserver.h:469
CursorID cursorID
Definition: dbserver.h:631
ProcessID sendpid
Definition: dbserver.h:349
WChar chardata[2048]
Definition: dbserver.h:340
#define DB_MAX_ERROR_DISPLAY
Definition: dbserver.h:74
UShort entity
Definition: dbserver.h:564
CursorID cursorID
Definition: dbserver.h:809
UShort number
Definition: dbserver.h:558
UInt32 mslinkKey
Definition: dbserver.h:612
UInt32 mslink
Definition: dbserver.h:523
UShort columns
Definition: dbserver.h:545
Definition: dbserver.h:493
int useTempTables
Definition: dbserver.h:392
bool isCallocd
Definition: dbserver.h:310
Definition: dbserver.h:449
UShort column
Definition: dbserver.h:529
Generic_link dBASELink
Definition: dbserver.h:724
short * attributes
Definition: dbserver.h:618
UInt32 mslink
Definition: dbserver.h:500
WChar textdata[(2048-sizeof(long))]
Definition: dbserver.h:577
long type
Definition: dbserver.h:328
UShort length
Definition: dbserver.h:535
long rowsProcessed
Definition: dbserver.h:403
union DBMessage::@177 u
UShort number
Definition: dbserver.h:553
Definition: dbserver.h:593
UInt32 mslinkKey
Definition: dbserver.h:604
WChar tableName[64]
Definition: dbserver.h:583
short state
Definition: dbserver.h:788
short rowActive
Definition: dbserver.h:796
unsigned short UShort
Definition: Bentley.r.h:133
Definition: dbserver.h:556
union Ver42DBMessage::@179 u
struct DMRS_link DMRSLink
Definition: dbserver.h:601
int nextMode
Definition: dbserver.h:390
short requestType
Definition: dbserver.h:766
Definition: dbdefs.h:195
UShort entity
Definition: dbserver.h:458
Definition: dbserver.h:364
short rows
Definition: dbserver.h:431
ScanColumn scanlist[1]
Definition: dbserver.h:518
Definition: dbserver.h:286
WChar screenform[64+1]
Definition: dbserver.h:375
Definition: dbserver.h:485
Definition: dbserver.h:814
unsigned char byte
Definition: Bentley.r.h:144
Definition: dbserver.h:296
Definition: dbserver.h:498
WChar sqlreview[2048+1]
Definition: dbserver.h:377
int(* queryInitialize)()
Definition: dbserver.h:406
short type
Definition: dbserver.h:808
int randomMsforms
Definition: dbserver.h:393
short type
Definition: dbserver.h:399
WChar data[640-sizeof(int)]
Definition: dbserver.h:767
short items
Definition: dbserver.h:432
int processedCols
Definition: dbserver.h:789
UShort entity
Definition: dbserver.h:515
int mode
Definition: dbserver.h:620
Definition: dbserver.h:748
short continued
Definition: dbserver.h:433
UInt32 mslink
Definition: dbserver.h:470
long type
Definition: dbserver.h:347
void * extProgDescrP
Definition: dbserver.h:273
char schema[80]
Definition: dbserver.h:281
WChar aeTable[MAX_TABLE_LENGTH+1]
Definition: dbserver.h:380
long offset
Definition: dbserver.h:509
long databaseID
Definition: dbserver.h:312
UInt32 rows
Definition: dbserver.h:546
Definition: dbserver.h:574
WChar description[1]
Definition: dbserver.h:633
UShort entity
Definition: dbserver.h:551
WChar buffer[2048]
Definition: dbserver.h:323
WChar value[1]
Definition: dbserver.h:571
DescrMessageHdr hdr
Definition: dbserver.h:424
UInt32 mslink
Definition: dbserver.h:459
UInt32 mslink
Definition: dbserver.h:488
long CursorID
Definition: dbdefs.h:168
UInt32 mslink
Definition: dbserver.h:476
UInt32 mslinkKey
Definition: dbserver.h:597
int serverType
Definition: dbserver.h:391
WChar data[640]
Definition: dbserver.h:752
WChar columnValue[256]
Definition: dbserver.h:598
WChar * description
Definition: dbserver.h:818
long numlines
Definition: dbserver.h:576
WChar name[MAX_TABLE_LENGTH+1]
Definition: dbserver.h:373
WChar taskname[132]
Definition: dbserver.h:451
#define MAX_SCREEN_FORM
Definition: dbdefs.r.h:55
Definition: dbserver.h:513
UShort entity
Definition: dbserver.h:528
WChar value[1]
Definition: dbserver.h:490
UShort column
Definition: dbserver.h:565
WChar * chardata
Definition: dbserver.h:320
short columns
Definition: dbserver.h:444
Definition: dbserver.h:616
Definition: dbserver.h:503
WChar * value
Definition: dbserver.h:289
size_t length
Definition: dbserver.h:306
Definition: dbserver.h:263
UInt32 mslink
Definition: dbserver.h:566
struct SQLStatedata::@182 statefunc
short shortdata[2048/2]
Definition: dbserver.h:341
Definition: dbserver.h:422
UShort fieldno
Definition: dbserver.h:489
WChar columnName[64]
Definition: dbserver.h:584
Definition: dbserver.h:623
WChar filename[MAXFILELENGTH]
Definition: dbserver.h:388
UShort entity
Definition: dbserver.h:487
Definition: dbserver.h:569
RequestHeader hdr
Definition: dbserver.h:317
ProcessID pid
Definition: dbserver.h:452
WChar tableName[64]
Definition: dbserver.h:595
size_t queryLength
Definition: dbserver.h:810
short columns
Definition: dbserver.h:430
long code
Definition: dbserver.h:298
Definition: dbserver.h:473
Definition: dbserver.h:538
long length
Definition: dbserver.h:330
short active
Definition: dbserver.h:795
UShort entity
Definition: dbserver.h:540
short items
Definition: dbserver.h:419
long request
Definition: dbserver.h:350
union Ver4DBMessage::@178 u
RequestStatus status
Definition: dbserver.h:351
UShort entity
Definition: dbserver.h:475
short numfields
Definition: dbserver.h:517
long request
Definition: dbserver.h:308
UInt32 startrec
Definition: dbserver.h:516
Definition: dbserver.h:581
int valid
Definition: dbserver.h:387
Generic_link IX_link
Definition: dbserver.h:714
short FormToggle
Definition: dbserver.h:413
UInt32 ProcessID
Definition: basetype.h:126
WChar fencefilter[2048+1]
Definition: dbserver.h:378
Definition: dbserver.h:562
RequestStatus status
Definition: dbserver.h:332
Definition: dbserver.h:462
struct SQLStatedata::@181 query
Ver42RequestHeader hdr
Definition: dbserver.h:356
WChar data[2048-(sizeof(short)*2)]
Definition: dbserver.h:446
WChar value[256]
Definition: dbserver.h:590
long length
Definition: dbserver.h:348
WChar * value
Definition: dbserver.h:508
Definition: dbserver.h:588
Definition: dbserver.h:526
int(* processRow)()
Definition: dbserver.h:409
short dataLength
Definition: dbserver.h:751
Definition: dbserver.h:442
RequestStatus status
Definition: dbserver.h:309
size_t callocdLength
Definition: dbserver.h:311
UShort entity
Definition: dbserver.h:464

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.